cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 Patch] nfsd readdirplus assertion failure
Date: Tue, 06 Feb 2007 13:28:32 +0000	[thread overview]
Message-ID: <1170768512.11001.389.camel@quoit.chygwyn.com> (raw)
In-Reply-To: <1170751936.3490.14.camel@localhost>

Hi,

Now added to the GFS2 -nmw git tree. Thanks,

Steve.

On Tue, 2007-02-06 at 03:52 -0500, Wendy Cheng wrote:
> Glock assertion failure found in '07 NFS connectathon. One of the NFSDs
> is doing a "readdirplus" procedure call. It passes the logic into
> gfs2_readdir() where it obtains its directory inode glock. This is then
> followed by filehandle construction that invokes lookup code. It hits
> the assertion failure while trying to obtain the inode glock again
> inside gfs2_drevalidate().  
> 
> This patch bypasses the recursive glock call if caller already holds the
> lock.
> 
> Signed-off-by: S. Wendy Cheng <wcheng@redhat.com>
> 
>  ops_dentry.c |   16 +++++++++++-----
>  1 files changed, 11 insertions(+), 5 deletions(-)
> 
> --- linux-git/fs/gfs2/ops_dentry.c	2007-02-06 01:07:26.000000000 -0500
> +++ linux/fs/gfs2/ops_dentry.c	2007-02-06 01:05:35.000000000 -0500
> @@ -46,6 +46,7 @@ static int gfs2_drevalidate(struct dentr
>  	struct gfs2_inum_host inum;
>  	unsigned int type;
>  	int error;
> +	int had_lock=0;
>  
>  	if (inode && is_bad_inode(inode))
>  		goto invalid;
> @@ -53,9 +54,12 @@ static int gfs2_drevalidate(struct dentr
>  	if (sdp->sd_args.ar_localcaching)
>  		goto valid;
>  
> -	error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh);
> -	if (error)
> -		goto fail;
> +	had_lock = gfs2_glock_is_locked_by_me(dip->i_gl);
> +	if (!had_lock) {
> +		error = gfs2_glock_nq_init(dip->i_gl, LM_ST_SHARED, 0, &d_gh);
> +		if (error)
> +			goto fail;
> +	} 
>  
>  	error = gfs2_dir_search(parent->d_inode, &dentry->d_name, &inum,
> &type);
>  	switch (error) {
> @@ -82,13 +86,15 @@ static int gfs2_drevalidate(struct dentr
>  	}
>  
>  valid_gunlock:
> -	gfs2_glock_dq_uninit(&d_gh);
> +	if (!had_lock)
> +		gfs2_glock_dq_uninit(&d_gh);
>  valid:
>  	dput(parent);
>  	return 1;
>  
>  invalid_gunlock:
> -	gfs2_glock_dq_uninit(&d_gh);
> +	if (!had_lock)
> +		gfs2_glock_dq_uninit(&d_gh);
>  invalid:
>  	if (inode && S_ISDIR(inode->i_mode)) {
>  		if (have_submounts(dentry))
> 
> 



      reply	other threads:[~2007-02-06 13:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-06  8:52 [Cluster-devel] [GFS2 Patch] nfsd readdirplus assertion failure Wendy Cheng
2007-02-06 13:28 ` Steven Whitehouse [this message]

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=1170768512.11001.389.camel@quoit.chygwyn.com \
    --to=swhiteho@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).