From: "J. Bruce Fields" <bfields@fieldses.org>
To: Prasad P <pvp@us.ibm.com>
Cc: nfs-bounces@lists.sourceforge.net, nfs@lists.sourceforge.net,
smfltc@us.ibm.com
Subject: Re: [PATCH] Fix incorrect assignment
Date: Thu, 25 Oct 2007 12:03:19 -0400 [thread overview]
Message-ID: <20071025160319.GA31888@fieldses.org> (raw)
In-Reply-To: <OF5B1D195B.8B37E3EE-ON8725737F.00547AB2-8625737F.0054CCF1@us.ibm.com>
On Thu, Oct 25, 2007 at 10:26:14AM -0500, Prasad P wrote:
> nfs-bounces@lists.sourceforge.net wrote on 10/24/2007 03:57:36 PM:
>
> > On Wed, Oct 24, 2007 at 03:14:32PM -0500, Prasad P wrote:
> > >
> > >
> > > Dereferenced pointer "dentry" without checking and assigned to inode
> > > in the declaration.
> >
> > Seems reasonable, but: looking at nfsd_dispatch(), it appears that the
> > encode function is never called in this case (since rq_vers == 2 and
> > nfsacld_proc_getacl() would have returned an error if it couldn't find a
> > dentry). Am I missing something? Do you have a test case?
> >
> > --b.
>
> No, I don't have a test case. This error was found by coverity scan.
>
> After declaration of the variables, we actually check the dentry and
> dentry->d_inode, and if they are not NULL, assign dentry->d_inode to inode
> variable.
>
> if (dentry == NULL || dentry->d_inode == NULL)
> return 0;
> inode = dentry->d_inode;
Yeah, the current code is obviously a little schizophrenic. I'm just
wondering whether we should fix it by deleting the early assignment or
by removing the unnecessary checks.
--b.
>
> >
> >
> > >
> > > Cc: Steve French <smfltc@us.ibm.com>
> > > Signed-off-by: Prasad V Potluri <pvp@us.ibm.com>
> > > ---
> > >
> > > diff -uprN a/fs/nfsd/nfs2acl.c b/fs/nfsd/nfs2acl.c
> > > --- a/fs/nfsd/nfs2acl.c 2007-10-09 15:31:38.000000000 -0500
> > > +++ b/fs/nfsd/nfs2acl.c 2007-10-24 14:03:13.000000000 -0500
> > > @@ -221,7 +221,7 @@ static int nfsaclsvc_encode_getaclres(st
> > > struct nfsd3_getaclres *resp)
> > > {
> > > struct dentry *dentry = resp->fh.fh_dentry;
> > > - struct inode *inode = dentry->d_inode;
> > > + struct inode *inode;
> > > struct kvec *head = rqstp->rq_res.head;
> > > unsigned int base;
> > > int n;
> > > --
> > > Thanks.
> > >
> > > Regards,
> > > Prasad Potluri
> > > email: pvp at-sign us dot ibm dot com
> > >
> -------------------------------------------------------------------------
> > > This SF.net email is sponsored by: Splunk Inc.
> > > Still grepping through log files to find problems? Stop.
> > > Now Search log events and configuration files using AJAX and a browser.
> > > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > > _______________________________________________
> > > NFS maillist - NFS@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/nfs
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems? Stop.
> > Now Search log events and configuration files using AJAX and a browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > NFS maillist - NFS@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/nfs
> Thanks.
>
> Regards,
> Prasad Potluri
> email: pvp at-sign us dot ibm dot com
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> NFS maillist - NFS@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nfs
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2007-10-25 16:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-24 20:14 [PATCH] Fix incorrect assignment Prasad P
2007-10-24 20:57 ` J. Bruce Fields
2007-10-25 15:26 ` Prasad P
2007-10-25 16:03 ` J. Bruce Fields [this message]
2007-10-25 17:58 ` Steve French
2007-10-25 23:12 ` 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=20071025160319.GA31888@fieldses.org \
--to=bfields@fieldses.org \
--cc=nfs-bounces@lists.sourceforge.net \
--cc=nfs@lists.sourceforge.net \
--cc=pvp@us.ibm.com \
--cc=smfltc@us.ibm.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.