Re: [PATCH] lockd: fix arg parsing for grace_period and timeout.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
> > 
> > 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....

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux