From: "J. Bruce Fields" <bfields@fieldses.org>
To: Mi Jinlong <mijinlong@cn.fujitsu.com>
Cc: "J. Bruce Fields" <bfields@redhat.com>,
"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
Bryan Schumaker <bjschuma@netapp.com>
Subject: Re: [PATCH 1/5] nfsd: distinguish functions of NFSD_MAY_* flags
Date: Mon, 11 Apr 2011 08:42:41 -0400 [thread overview]
Message-ID: <20110411124241.GA32332@fieldses.org> (raw)
In-Reply-To: <4DA2703B.8070300@cn.fujitsu.com>
On Mon, Apr 11, 2011 at 11:06:35AM +0800, Mi Jinlong wrote:
>=20
>=20
> J. Bruce Fields =E5=86=99=E9=81=93:
> > Most of the NFSD_MAY_* flags actually request permissions, but over=
the
> > years we've accreted a few that modify the behavior of the permissi=
on or
> > open code in other ways.
> >=20
> > 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.
> >=20
> > Signed-off-by: J. Bruce Fields <bfields@redhat.com>
> > ---
> > fs/nfsd/vfs.c | 2 +-
> > fs/nfsd/vfs.h | 3 +++
> > 2 files changed, 4 insertions(+), 1 deletions(-)
> >=20
> > 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, struc=
t svc_export *exp,
> > struct inode *inode =3D dentry->d_inode;
> > int err;
> > =20
> > - if (acc =3D=3D NFSD_MAY_NOP)
> > + if (acc & NFSD_MAY_MASK =3D=3D NFSD_MAY_NOP)
> > return 0;
>=20
> Maybe there is a problem, the priority of '=3D=3D' is higher than '=
&',=20
> this line equal to "if (acc & (NFSD_MAY_MASK =3D=3D NFSD_MAY_NOP))"=
,
> "return 0" will appears every time, I think it's not we really want=
=2E
>=20
> "if ((acc & NFSD_MAY_MASK) =3D=3D NFSD_MAY_NOP)" is we need,
> do you think so?
Yes, thanks--fixed.--b.
next prev parent reply other threads:[~2011-04-11 12:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-04 13:43 secinfo_no_name question Bryan Schumaker
2011-04-04 15:14 ` J. Bruce Fields
2011-04-04 15:22 ` Bryan Schumaker
2011-04-05 16:09 ` Tom Haynes
2011-04-10 16:25 ` J. Bruce Fields
2011-04-10 16:29 ` [PATCH 1/5] nfsd: distinguish functions of NFSD_MAY_* flags J. Bruce Fields
2011-04-11 3:06 ` Mi Jinlong
2011-04-11 12:42 ` J. Bruce Fields [this message]
2011-04-10 16:29 ` [PATCH 2/5] nfsd4: allow fh_verify caller to skip pseudoflavor checks J. Bruce Fields
2011-04-10 16:29 ` [PATCH 3/5] nfsd4: introduce OPDESC helper J. Bruce Fields
2011-04-10 16:29 ` [PATCH 4/5] nfsd4: make fh_verify responsibility of nfsd_lookup_dentry caller J. Bruce Fields
2011-04-10 16:29 ` [PATCH 5/5] nfsd4: fix wrongsec handling for PUTFH + op cases J. Bruce Fields
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=20110411124241.GA32332@fieldses.org \
--to=bfields@fieldses.org \
--cc=bfields@redhat.com \
--cc=bjschuma@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=mijinlong@cn.fujitsu.com \
/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.