diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 11:24:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 11:24:09 -0400 |
commit | 34b064569eba3bec65bf98efe057b0578fe13297 (patch) | |
tree | cee99fb8035843776ec44ec5113fb586b2b6172b /fs | |
parent | 2e77defc5da779888f3cf65e66cd3d47ae2d690f (diff) | |
parent | 26b06a6958df0f12f1a654db8598433eb89cc024 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-fixes:
GFS2: Wait properly when flushing the ail list
GFS2: Wipe directory hash table metadata when deallocating a directory
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/bmap.c | 2 | ||||
-rw-r--r-- | fs/gfs2/log.c | 29 | ||||
-rw-r--r-- | fs/gfs2/rgrp.c | 4 |
3 files changed, 32 insertions, 3 deletions
diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index 74add2ddcc3f..e65493a8ac00 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c | |||
@@ -780,6 +780,8 @@ static int do_strip(struct gfs2_inode *ip, struct buffer_head *dibh, | |||
780 | metadata = (height != ip->i_height - 1); | 780 | metadata = (height != ip->i_height - 1); |
781 | if (metadata) | 781 | if (metadata) |
782 | revokes = (height) ? sdp->sd_inptrs : sdp->sd_diptrs; | 782 | revokes = (height) ? sdp->sd_inptrs : sdp->sd_diptrs; |
783 | else if (ip->i_depth) | ||
784 | revokes = sdp->sd_inptrs; | ||
783 | 785 | ||
784 | if (ip != GFS2_I(sdp->sd_rindex)) | 786 | if (ip != GFS2_I(sdp->sd_rindex)) |
785 | error = gfs2_rindex_hold(sdp, &ip->i_alloc->al_ri_gh); | 787 | error = gfs2_rindex_hold(sdp, &ip->i_alloc->al_ri_gh); |
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index cec26c00b50d..903115f2bb34 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c | |||
@@ -228,6 +228,27 @@ static int gfs2_ail1_empty(struct gfs2_sbd *sdp) | |||
228 | return ret; | 228 | return ret; |
229 | } | 229 | } |
230 | 230 | ||
231 | static void gfs2_ail1_wait(struct gfs2_sbd *sdp) | ||
232 | { | ||
233 | struct gfs2_ail *ai; | ||
234 | struct gfs2_bufdata *bd; | ||
235 | struct buffer_head *bh; | ||
236 | |||
237 | spin_lock(&sdp->sd_ail_lock); | ||
238 | list_for_each_entry_reverse(ai, &sdp->sd_ail1_list, ai_list) { | ||
239 | list_for_each_entry(bd, &ai->ai_ail1_list, bd_ail_st_list) { | ||
240 | bh = bd->bd_bh; | ||
241 | if (!buffer_locked(bh)) | ||
242 | continue; | ||
243 | get_bh(bh); | ||
244 | spin_unlock(&sdp->sd_ail_lock); | ||
245 | wait_on_buffer(bh); | ||
246 | brelse(bh); | ||
247 | return; | ||
248 | } | ||
249 | } | ||
250 | spin_unlock(&sdp->sd_ail_lock); | ||
251 | } | ||
231 | 252 | ||
232 | /** | 253 | /** |
233 | * gfs2_ail2_empty_one - Check whether or not a trans in the AIL has been synced | 254 | * gfs2_ail2_empty_one - Check whether or not a trans in the AIL has been synced |
@@ -878,9 +899,9 @@ void gfs2_meta_syncfs(struct gfs2_sbd *sdp) | |||
878 | gfs2_log_flush(sdp, NULL); | 899 | gfs2_log_flush(sdp, NULL); |
879 | for (;;) { | 900 | for (;;) { |
880 | gfs2_ail1_start(sdp); | 901 | gfs2_ail1_start(sdp); |
902 | gfs2_ail1_wait(sdp); | ||
881 | if (gfs2_ail1_empty(sdp)) | 903 | if (gfs2_ail1_empty(sdp)) |
882 | break; | 904 | break; |
883 | msleep(10); | ||
884 | } | 905 | } |
885 | } | 906 | } |
886 | 907 | ||
@@ -920,12 +941,14 @@ int gfs2_logd(void *data) | |||
920 | 941 | ||
921 | if (gfs2_ail_flush_reqd(sdp)) { | 942 | if (gfs2_ail_flush_reqd(sdp)) { |
922 | gfs2_ail1_start(sdp); | 943 | gfs2_ail1_start(sdp); |
923 | io_schedule(); | 944 | gfs2_ail1_wait(sdp); |
924 | gfs2_ail1_empty(sdp); | 945 | gfs2_ail1_empty(sdp); |
925 | gfs2_log_flush(sdp, NULL); | 946 | gfs2_log_flush(sdp, NULL); |
926 | } | 947 | } |
927 | 948 | ||
928 | wake_up(&sdp->sd_log_waitq); | 949 | if (!gfs2_ail_flush_reqd(sdp)) |
950 | wake_up(&sdp->sd_log_waitq); | ||
951 | |||
929 | t = gfs2_tune_get(sdp, gt_logd_secs) * HZ; | 952 | t = gfs2_tune_get(sdp, gt_logd_secs) * HZ; |
930 | if (freezing(current)) | 953 | if (freezing(current)) |
931 | refrigerator(); | 954 | refrigerator(); |
diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 7273ad3c85ba..9b780df3fd54 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c | |||
@@ -1629,6 +1629,10 @@ void __gfs2_free_data(struct gfs2_inode *ip, u64 bstart, u32 blen) | |||
1629 | gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); | 1629 | gfs2_rgrp_out(rgd, rgd->rd_bits[0].bi_bh->b_data); |
1630 | 1630 | ||
1631 | gfs2_trans_add_rg(rgd); | 1631 | gfs2_trans_add_rg(rgd); |
1632 | |||
1633 | /* Directories keep their data in the metadata address space */ | ||
1634 | if (ip->i_depth) | ||
1635 | gfs2_meta_wipe(ip, bstart, blen); | ||
1632 | } | 1636 | } |
1633 | 1637 | ||
1634 | /** | 1638 | /** |