linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: linux-kernel@vger.kernel.org, cluster-devel@redhat.com
Cc: Bob Peterson <rpeterso@redhat.com>,
	Steven Whitehouse <swhiteho@redhat.com>
Subject: [PATCH 08/12] GFS2: make sure rgrps are up to date in func gfs2_blk2rgrpd
Date: Mon, 19 Mar 2012 10:25:24 +0000	[thread overview]
Message-ID: <1332152728-4027-9-git-send-email-swhiteho@redhat.com> (raw)
In-Reply-To: <1332152728-4027-1-git-send-email-swhiteho@redhat.com>

From: Bob Peterson <rpeterso@redhat.com>

This patch adds a call to gfs2_rindex_update from function gfs2_blk2rgrpd
and removes calls to it that are made redundant by it. The problem is
that a gfs2_grow can add rgrps to the rindex, then put those rgrps into
use, thus rendering the rindex we read in at mount time incomplete.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 6ff9f17..19bde40 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
@@ -332,6 +332,9 @@ struct gfs2_rgrpd *gfs2_blk2rgrpd(struct gfs2_sbd *sdp, u64 blk, bool exact)
 	struct rb_node *n, *next;
 	struct gfs2_rgrpd *cur;
 
+	if (gfs2_rindex_update(sdp))
+		return NULL;
+
 	spin_lock(&sdp->sd_rindex_spin);
 	n = sdp->sd_rindex_tree.rb_node;
 	while (n) {
@@ -917,10 +920,6 @@ int gfs2_fitrim(struct file *filp, void __user *argp)
 	if (!blk_queue_discard(q))
 		return -EOPNOTSUPP;
 
-	ret = gfs2_rindex_update(sdp);
-	if (ret)
-		return ret;
-
 	if (argp == NULL) {
 		r.start = 0;
 		r.len = ULLONG_MAX;
@@ -1671,13 +1670,8 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)
 {
 	struct gfs2_rgrpd *rgd;
 	struct gfs2_holder rgd_gh;
-	int error;
-
-	error = gfs2_rindex_update(sdp);
-	if (error)
-		return error;
+	int error = -EINVAL;
 
-	error = -EINVAL;
 	rgd = gfs2_blk2rgrpd(sdp, no_addr, 1);
 	if (!rgd)
 		goto fail;
-- 
1.7.4


  parent reply	other threads:[~2012-03-19 10:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-19 10:25 GFS2: Pre-pull patch posting (merge window) Steven Whitehouse
2012-03-19 10:25 ` [PATCH 01/12] GFS2: glock statistics gathering Steven Whitehouse
2012-03-19 10:25 ` [PATCH 02/12] GFS2: Move two functions from log.c to lops.c Steven Whitehouse
2012-03-19 10:25 ` [PATCH 03/12] GFS2: FITRIM ioctl support Steven Whitehouse
2012-03-19 10:25 ` [PATCH 04/12] GFS2: Sort the ordered write list Steven Whitehouse
2012-03-19 10:25 ` [PATCH 05/12] GFS2: Make bd_cmp() static Steven Whitehouse
2012-03-19 10:25 ` [PATCH 06/12] GFS2: Unlock rindex mutex on glock error Steven Whitehouse
2012-03-19 10:25 ` [PATCH 07/12] GFS2: Eliminate sd_rindex_mutex Steven Whitehouse
2012-03-19 10:25 ` Steven Whitehouse [this message]
2012-03-19 10:25 ` [PATCH 09/12] GFS2: Flush pending glock work when evicting an inode Steven Whitehouse
2012-03-19 10:25 ` [PATCH 10/12] GFS2: Remove a __GFP_NOFAIL allocation Steven Whitehouse
2012-03-19 10:25 ` [PATCH 11/12] GFS2: Clean up log flush header writing Steven Whitehouse
2012-03-19 10:25 ` [PATCH 12/12] GFS2: call gfs2_write_alloc_required for each chunk Steven Whitehouse
2012-03-19 14:45 ` GFS2: Pre-pull patch posting (merge window) Randy Dunlap
2012-03-19 14:59   ` Steven Whitehouse
2012-03-19 15:18     ` Randy Dunlap
2012-03-19 15:34       ` Steven Whitehouse
2012-03-23 19:41         ` David Teigland
2012-03-23 19:46           ` David Miller
2012-03-23 20:06           ` Randy Dunlap
2012-03-23 20:09             ` Steven Whitehouse
2012-03-23 20:18             ` David Teigland
2012-03-23 22:06               ` Benjamin Poirier
2012-03-23 22:48                 ` Randy Dunlap
2012-03-26 10:44                 ` Steven Whitehouse
2012-04-02 15:35                   ` Randy Dunlap
2012-04-02 15:47                     ` Steven Whitehouse
2012-03-23 22:06               ` Randy Dunlap
2012-03-20  9:47       ` 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=1332152728-4027-9-git-send-email-swhiteho@redhat.com \
    --to=swhiteho@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpeterso@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).