On Mon, Apr 11, 2011 at 11:06:35AM +0800, Mi Jinlong wrote: > > > J. Bruce Fields åé: > > Most of the NFSD_MAY_* flags actually request permissions, but over the > > years we've accreted a few that modify the behavior of the permission or > > open code in other ways. > > > > Distinguish the two cases a little more. In particular, allow the > > shortcut at the start of nfsd_permission to ignore the > > non-permission-requesting bits. > > > > Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxx> > > --- > > fs/nfsd/vfs.c | 2 +- > > fs/nfsd/vfs.h | 3 +++ > > 2 files changed, 4 insertions(+), 1 deletions(-) > > > > diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c > > index 2e1cebd..ac4f0b4 100644 > > --- a/fs/nfsd/vfs.c > > +++ b/fs/nfsd/vfs.c > > @@ -2027,7 +2027,7 @@ nfsd_permission(struct svc_rqst *rqstp, struct svc_export *exp, > > struct inode *inode = dentry->d_inode; > > int err; > > > > - if (acc == NFSD_MAY_NOP) > > + if (acc & NFSD_MAY_MASK == NFSD_MAY_NOP) > > return 0; > > Maybe there is a problem, the priority of '==' is higher than '&', > this line equal to "if (acc & (NFSD_MAY_MASK == NFSD_MAY_NOP))", > "return 0" will appears every time, I think it's not we really want. > > "if ((acc & NFSD_MAY_MASK) == NFSD_MAY_NOP)" is we need, > do you think so? Yes, thanks--fixed.--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