From: yangsheng Date: Fri, 3 Apr 2009 05:45:51 +0000 (+0000) Subject: Branch b1_6 X-Git-Tag: v1_9_167~40 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b52d0346ef1686567f89e25bdf4a402c9b6f4f91 Branch b1_6 b=18810 i=alex, johann Fix race between read_block_bitmap() and mark_diskspace_used(). --- diff --git a/ldiskfs/kernel_patches/patches/ext3-fix-race-mb-clear-bits.patch b/ldiskfs/kernel_patches/patches/ext3-fix-race-mb-clear-bits.patch new file mode 100644 index 0000000..63fa89b --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-fix-race-mb-clear-bits.patch @@ -0,0 +1,41 @@ +Index: linux-2.6.16.60-0.31/fs/ext3/mballoc.c +=================================================================== +--- linux-2.6.16.60-0.31.orig/fs/ext3/mballoc.c ++++ linux-2.6.16.60-0.31/fs/ext3/mballoc.c +@@ -1170,7 +1170,10 @@ static inline void mb_clear_bits(spinloc + cur += 32; + continue; + } +- mb_clear_bit_atomic(lock, cur, bm); ++ if (lock) ++ mb_clear_bit_atomic(lock, cur, bm); ++ else ++ mb_clear_bit(cur, bm); + cur++; + } + } +@@ -1188,7 +1191,10 @@ static inline void mb_set_bits(spinlock_ + cur += 32; + continue; + } +- mb_set_bit_atomic(lock, cur, bm); ++ if (lock) ++ mb_set_bit_atomic(lock, cur, bm); ++ else ++ mb_set_bit(cur, bm); + cur++; + } + } +@@ -2974,10 +2980,9 @@ int ext3_mb_mark_diskspace_used(struct e + } + } + #endif +- mb_set_bits(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group), bitmap_bh->b_data, +- ac->ac_b_ex.fe_start, ac->ac_b_ex.fe_len); +- + spin_lock(sb_bgl_lock(sbi, ac->ac_b_ex.fe_group)); ++ mb_set_bits(NULL, bitmap_bh->b_data, ac->ac_b_ex.fe_start, ++ ac->ac_b_ex.fe_len); + if (gdp->bg_flags & cpu_to_le16(EXT3_BG_BLOCK_UNINIT)) { + gdp->bg_flags &= cpu_to_le16(~EXT3_BG_BLOCK_UNINIT); + gdp->bg_free_blocks_count = diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series index 330b52e..3ccbb49 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series @@ -26,3 +26,4 @@ ext3-xattr-no-update-ctime-2.6.22-vanilla.patch ext3-journal-chksum-2.6.18-vanilla.patch ext3-get-raid-stripe-from-sb.patch ext3-big-endian-check-2.6-rhel5.patch +ext3-fix-race-mb-clear-bits.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series index c6934bb..9d88798 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series @@ -31,3 +31,4 @@ ext3-check-bad-inode.patch ext3-journal-chksum-2.6.18-vanilla.patch ext3-get-raid-stripe-from-sb.patch ext3-big-endian-check-2.6-sles10.patch +ext3-fix-race-mb-clear-bits.patch