diff options
author | Bob Peterson <rpeterso@redhat.com> | 2012-04-04 22:11:16 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2012-04-05 05:20:10 -0400 |
commit | 5e2f7d617b574dadf3ad125e4821ce1b180b1626 (patch) | |
tree | 5976cc0546b526751441fb2ace3cac2337261e21 /fs/gfs2/rgrp.c | |
parent | 97cc008aaa8c1f02699b478ca890e81810244131 (diff) |
GFS2: Make sure rindex is uptodate before starting transactions
This patch removes the call from gfs2_blk2rgrd to function
gfs2_rindex_update and replaces it with individual calls.
The former way turned out to be too problematic.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/rgrp.c')
-rw-r--r-- | fs/gfs2/rgrp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 19354a20e5b1..3df65c9ab73b 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -332,9 +332,6 @@ 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 | |||
338 | spin_lock(&sdp->sd_rindex_spin); | 335 | spin_lock(&sdp->sd_rindex_spin); |
339 | n = sdp->sd_rindex_tree.rb_node; | 336 | n = sdp->sd_rindex_tree.rb_node; |
340 | while (n) { | 337 | while (n) { |
@@ -928,6 +925,10 @@ int gfs2_fitrim(struct file *filp, void __user *argp) | |||
928 | } else if (copy_from_user(&r, argp, sizeof(r))) | 925 | } else if (copy_from_user(&r, argp, sizeof(r))) |
929 | return -EFAULT; | 926 | return -EFAULT; |
930 | 927 | ||
928 | ret = gfs2_rindex_update(sdp); | ||
929 | if (ret) | ||
930 | return ret; | ||
931 | |||
931 | rgd = gfs2_blk2rgrpd(sdp, r.start, 0); | 932 | rgd = gfs2_blk2rgrpd(sdp, r.start, 0); |
932 | rgd_end = gfs2_blk2rgrpd(sdp, r.start + r.len, 0); | 933 | rgd_end = gfs2_blk2rgrpd(sdp, r.start + r.len, 0); |
933 | 934 | ||