From 9f09da616af8b6b2d5be0af53cdc5bc093036ee0 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 8 Jul 2004 19:00:04 +0000 Subject: [PATCH] 2004-07-08 Roland McGrath * resource.c (sys_quotactl): Truncate first argument to 32 bits, since that's what the kernel will do. --- resource.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/resource.c b/resource.c index 4692a37b..3bb464a0 100644 --- a/resource.c +++ b/resource.c @@ -498,10 +498,18 @@ int sys_quotactl(tcp) struct tcb *tcp; { + /* + * The Linux kernel only looks at the low 32 bits of the command + * argument, but on some 64-bit architectures (s390x) this word + * will have been sign-extended when we see it. The high 1 bits + * don't mean anything, so don't confuse the output with them. + */ + unsigned int cmd = tcp->u_arg[0]; + if (entering(tcp)) { - printxval(quotacmds, (unsigned long) tcp->u_arg[0] >> SUBCMDSHIFT, "Q_???"); + printxval(quotacmds, cmd >> SUBCMDSHIFT, "Q_???"); tprintf("|"); - printxval(quotatypes, tcp->u_arg[0] & SUBCMDMASK, "???QUOTA"); + printxval(quotatypes, cmd & SUBCMDMASK, "???QUOTA"); tprintf(", "); printstr(tcp, tcp->u_arg[1], -1); tprintf(", %lu, ", tcp->u_arg[2]); @@ -511,7 +519,7 @@ struct tcb *tcp; if (!tcp->u_arg[3]) tprintf("NULL"); - else if (!verbose(tcp) || !OLD_COMMAND(tcp->u_arg[0])) + else if (!verbose(tcp) || !OLD_COMMAND(cmd)) tprintf("%#lx", tcp->u_arg[3]); else if (umoven(tcp, tcp->u_arg[3], sizeof(struct dqblk), (char *) &dq) < 0) -- 2.50.1