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]
Date: Fri, 17 Feb 2012 14:25:34 +0000	[thread overview]
Message-ID: <1329488734.2735.50.camel@menhir> (raw)
In-Reply-To: <a155bf35-9c92-4b00-a32d-3ed8c3f485ab@zmail12.collab.prod.int.phx2.redhat.com>

Hi,

If we are going to do this, then perhaps we should consider reading in
the rindex on mount? That way it will always be uptodate, and we can
refuse to mount if the rindex is damaged which is probably cleaner than
doing it after the event.

The only concern is the time taken to mount large filesystems. Having
said that the rindex should be contiguous on disk in most cases, so it
should be a fairly fast operation. Worth considering, anyway I think,

Steve.

On Fri, 2012-02-17 at 09:15 -0500, Bob Peterson wrote:
> Hi,
> 
> This patch fixes a problem whereby gfs2_grow was failing and causing GFS2
> to assert. The problem was that when GFS2's fallocate operation tried to
> acquire an "allocation" it made sure the rindex was up to date, and if not,
> it called gfs2_rindex_update. However, if the file being fallocated was
> the rindex itself, it was already locked at that point. By calling
> gfs2_rindex_update at an earlier point in time, we bring rindex up to date
> and thereby avoid trying to lock it when the "allocation" is acquired.
> 
> Regards,
> 
> Bob Peterson
> Red Hat File Systems
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com> 
> --
>  fs/gfs2/file.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
> index 310f2fb..52db4c4 100644
> --- a/fs/gfs2/file.c
> +++ b/fs/gfs2/file.c
> @@ -774,6 +774,11 @@ static long gfs2_fallocate(struct file *file, int mode, loff_t offset,
>  	if (bytes == 0)
>  		bytes = sdp->sd_sb.sb_bsize;
>  
> +	error = gfs2_rindex_update(sdp);
> +	if (error) {
> +		fs_warn(sdp, "rindex update returns %d\n", error);
> +		return error;
> +	}
>  	gfs2_holder_init(ip->i_gl, LM_ST_EXCLUSIVE, 0, &ip->i_gh);
>  	error = gfs2_glock_nq(&ip->i_gh);
>  	if (unlikely(error))
> 




  reply	other threads:[~2012-02-17 14:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <b1f512c7-59c2-48d7-9c01-7d6acbf30877@zmail12.collab.prod.int.phx2.redhat.com>
2012-02-17 14:15 ` [Cluster-devel] [GFS2 PATCH] Bob Peterson
2012-02-17 14:25   ` Steven Whitehouse [this message]
2012-02-17 14:34     ` Bob Peterson
2012-02-17 14:42       ` Steven Whitehouse
2012-02-17 15:23       ` Steven Whitehouse
2008-01-28 17:15 Bob Peterson
2008-01-29  8:30 ` Steven Whitehouse

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=1329488734.2735.50.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).