aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorBob Peterson <rpeterso@redhat.com>2012-03-05 10:19:35 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2012-03-05 10:10:34 -0500
commit58884c4df005ee5ee854cfcd0385d5a6bf25aa30 (patch)
tree7acef9d1e5d66241b151fd85f7d71cc56022c855 /fs
parent6aad1c3d3eba3db38b3a1200e2b02ff3af501c5a (diff)
GFS2: make sure rgrps are up to date in func gfs2_blk2rgrpd
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/rgrp.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 6ff9f17f9ac2..19bde40b4864 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)
332 struct rb_node *n, *next; 332 struct rb_node *n, *next;
333 struct gfs2_rgrpd *cur; 333 struct gfs2_rgrpd *cur;
334 334
335 if (gfs2_rindex_update(sdp))
336 return NULL;
337
335 spin_lock(&sdp->sd_rindex_spin); 338 spin_lock(&sdp->sd_rindex_spin);
336 n = sdp->sd_rindex_tree.rb_node; 339 n = sdp->sd_rindex_tree.rb_node;
337 while (n) { 340 while (n) {
@@ -917,10 +920,6 @@ int gfs2_fitrim(struct file *filp, void __user *argp)
917 if (!blk_queue_discard(q)) 920 if (!blk_queue_discard(q))
918 return -EOPNOTSUPP; 921 return -EOPNOTSUPP;
919 922
920 ret = gfs2_rindex_update(sdp);
921 if (ret)
922 return ret;
923
924 if (argp == NULL) { 923 if (argp == NULL) {
925 r.start = 0; 924 r.start = 0;
926 r.len = ULLONG_MAX; 925 r.len = ULLONG_MAX;
@@ -1671,13 +1670,8 @@ int gfs2_check_blk_type(struct gfs2_sbd *sdp, u64 no_addr, unsigned int type)
1671{ 1670{
1672 struct gfs2_rgrpd *rgd; 1671 struct gfs2_rgrpd *rgd;
1673 struct gfs2_holder rgd_gh; 1672 struct gfs2_holder rgd_gh;
1674 int error; 1673 int error = -EINVAL;
1675
1676 error = gfs2_rindex_update(sdp);
1677 if (error)
1678 return error;
1679 1674
1680 error = -EINVAL;
1681 rgd = gfs2_blk2rgrpd(sdp, no_addr, 1); 1675 rgd = gfs2_blk2rgrpd(sdp, no_addr, 1);
1682 if (!rgd) 1676 if (!rgd)
1683 goto fail; 1677 goto fail;