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] [PATCH] GFS2: force a log flush when invalidating the rindex glock
Date: Tue, 14 Jun 2011 10:06:32 +0100	[thread overview]
Message-ID: <1308042392.2723.1.camel@menhir> (raw)
In-Reply-To: <20110613192740.GC15149@ether.msp.redhat.com>

Hi,

On Mon, 2011-06-13 at 14:27 -0500, Benjamin Marzinski wrote:
> Right now, there is nothing that forces the log to get flushed when a node
> drops its rindex glock so that another node can grow the filesystem. If the
> log doesn't get flushed, GFS2 can corrupt the sd_log_le_rg list in the
> following way.
> 
> A node puts an rgd on the list in rg_lo_add(), and then the rindex glock is
> dropped so the other node can grow the filesystem. When the node reacquires the
> rindex glock, that rgd gets deleted in clear_rgrpdi() before ever being
> removed from the list by gfs2_log_flush().
> 
> This code simply forces a log flush when the rindex glock is invalidated,
> solving the problem.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
> ---
>  fs/gfs2/glops.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Index: gfs2-2.6-nmw/fs/gfs2/glops.c
> ===================================================================
> --- gfs2-2.6-nmw.orig/fs/gfs2/glops.c
> +++ gfs2-2.6-nmw/fs/gfs2/glops.c
> @@ -221,8 +221,10 @@ static void inode_go_inval(struct gfs2_g
>  		}
>  	}
>  
> -	if (ip == GFS2_I(gl->gl_sbd->sd_rindex))
> +	if (ip == GFS2_I(gl->gl_sbd->sd_rindex)) {
> +		gfs2_log_flush(gl->gl_sbd, NULL);
>  		gl->gl_sbd->sd_rindex_uptodate = 0;
> +	}
>  	if (ip && S_ISREG(ip->i_inode.i_mode))
>  		truncate_inode_pages(ip->i_inode.i_mapping, 0);
>  }
> 

Now in the -nmw git tree. Thanks,

Steve.




      reply	other threads:[~2011-06-14  9:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13 19:27 [Cluster-devel] [PATCH] GFS2: force a log flush when invalidating the rindex glock Benjamin Marzinski
2011-06-14  9:06 ` 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=1308042392.2723.1.camel@menhir \
    --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).