Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Adrian Bunk <bunk@stusta.de>
Cc: nfs@lists.sourceforge.net, neilb@cse.unsw.edu.au,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC: 2.6 patch] include/linux/nfsd/nfsfh.h: fix a NULL
Date: Sun, 12 Nov 2006 10:58:47 -0500	[thread overview]
Message-ID: <1163347127.6612.66.camel@lade.trondhjem.org> (raw)
In-Reply-To: <20061112131748.GI25057@stusta.de>

On Sun, 2006-11-12 at 14:17 +0100, Adrian Bunk wrote:
> dereference
> Reply-To: 
> Fcc: =sent-mail
> 
> When we know fhp->fh_dentry is NULL, a code path where it's being 
> dereferenced isn't a good choice.
> 
> Spotted by the coverity checker.
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
> 
> --- linux-2.6/include/linux/nfsd/nfsfh.h.old	2006-11-12 14:13:34.000000000 +0100
> +++ linux-2.6/include/linux/nfsd/nfsfh.h	2006-11-12 14:13:49.000000000 +0100
> @@ -330,8 +330,7 @@ fh_unlock(struct svc_fh *fhp)
>  {
>  	if (!fhp->fh_dentry)
>  		printk(KERN_ERR "fh_unlock: fh not verified!\n");
> -
> -	if (fhp->fh_locked) {
> +	else if (fhp->fh_locked) {
>  		fill_post_wcc(fhp);
>  		mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex);
>  		fhp->fh_locked = 0;
> 

This issue has come up on lkml before. Please just convert that check
for fhp->fh_dentry into a BUG_ON().

Trond


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2006-11-12 15:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-12 13:17 [RFC: 2.6 patch] include/linux/nfsd/nfsfh.h: fix a NULL Adrian Bunk
2006-11-12 15:58 ` Trond Myklebust [this message]
2006-11-12 17:48   ` [2.6 patch] include/linux/nfsd/nfsfh.h:fh_unlock(): change an error to a BUG_ON() Adrian Bunk
2006-11-13  4:52     ` Neil Brown

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=1163347127.6612.66.camel@lade.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@cse.unsw.edu.au \
    --cc=nfs@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox