From: NeilBrown <neilb@suse.de>
To: "J.Bruce Fields" <bfields@fieldses.org>
Cc: "Myklebust, Trond" <Trond.Myklebust@netapp.com>,
NFS <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] lockd: fix arg parsing for grace_period and timeout.
Date: Wed, 8 Feb 2012 09:39:30 +1100 [thread overview]
Message-ID: <20120208093930.65892fbc@notabene.brown> (raw)
In-Reply-To: <20120207144956.GA4868@fieldses.org>
[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]
On Tue, 7 Feb 2012 09:49:56 -0500 "J.Bruce Fields" <bfields@fieldses.org>
wrote:
> On Tue, Feb 07, 2012 at 01:58:43PM +0000, Myklebust, Trond wrote:
> > On Tue, 2012-02-07 at 15:35 +1100, NeilBrown wrote:
> > > If you try to set grace_period or timeout via a module parameter
> > > to lockd, and do this on a big-endian machine where
> > >
> > > sizeof(int) != sizeof(unsigned long)
> > >
> > > it won't work. This number given will be effectively shifted right
> > > by the difference in those two sizes.
> > >
> > > So cast kp->arg properly to get correct result.
> > >
> > > Signed-off-by: NeilBrown <neilb@suse.de>
> > >
> > > diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> > > index c061b9a..2444780 100644
> > > --- a/fs/lockd/svc.c
> > > +++ b/fs/lockd/svc.c
> > > @@ -440,7 +440,7 @@ static int param_set_##name(const char *val, struct kernel_param *kp) \
> > > __typeof__(type) num = which_strtol(val, &endp, 0); \
> > > if (endp == val || *endp || num < (min) || num > (max)) \
> > > return -EINVAL; \
> > > - *((int *) kp->arg) = num; \
> > > + *((type *) kp->arg) = num; \
> > > return 0; \
> > > }
> > >
> > Wow, that's a seriously old bug...
>
> Looking at a historical git repo, it was probably from "[PATCH] make NFS
> lockd port numbers assignable at run time", attributed to Jamie Lokier
> in August 2003, in 2.6.0.
>
> Anyway:
>
> > Bruce, do you want to carry it?
>
> Sure. I'm a little slow getting stuff pushed out while I track down a
> couple very tricky bugs, but it should show up in my git tree in a few
> days....
Thanks.. just goes to show how well big-endian is tested I guess :-)
especially the more obscure options.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2012-02-07 22:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120207153542.3df498ad@notabene.brown>
2012-02-07 13:58 ` [PATCH] lockd: fix arg parsing for grace_period and timeout Myklebust, Trond
2012-02-07 14:49 ` J.Bruce Fields
2012-02-07 22:39 ` NeilBrown [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120208093930.65892fbc@notabene.brown \
--to=neilb@suse.de \
--cc=Trond.Myklebust@netapp.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.