Whamcloud - gitweb
Branch b1_8
authorjohann <johann>
Wed, 1 Jul 2009 20:46:45 +0000 (20:46 +0000)
committerjohann <johann>
Wed, 1 Jul 2009 20:46:45 +0000 (20:46 +0000)
b=19875
i=girish

Fix ext4_free_inode() vs. ext4_claim_inode() race.
Backport
http://git.kernel.org/?p=linux/kernel/git/tytso/ext4.git;a=commit;h=7ce9d5d1f3c8736511daa413c64985a05b2feee3

ldiskfs/kernel_patches/patches/ext4-claim_inode-free_inode-race.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series

diff --git a/ldiskfs/kernel_patches/patches/ext4-claim_inode-free_inode-race.patch b/ldiskfs/kernel_patches/patches/ext4-claim_inode-free_inode-race.patch
new file mode 100644 (file)
index 0000000..c742b38
--- /dev/null
@@ -0,0 +1,28 @@
+Index: linux-stage/fs/ext4/ialloc.c
+===================================================================
+--- linux-stage.orig/fs/ext4/ialloc.c
++++ linux-stage/fs/ext4/ialloc.c
+@@ -189,7 +189,7 @@ void ext4_free_inode(handle_t *handle, s
+       struct ext4_group_desc *gdp;
+       struct ext4_super_block *es;
+       struct ext4_sb_info *sbi;
+-      int fatal = 0, err, count;
++      int fatal = 0, err, count, cleared;
+       ext4_group_t flex_group;
+       if (atomic_read(&inode->i_count) > 1) {
+@@ -243,9 +243,12 @@ void ext4_free_inode(handle_t *handle, s
+       if (fatal)
+               goto error_return;
++      ext4_lock_group(sb, block_group);
++      cleared = ext4_clear_bit(bit, bitmap_bh->b_data);
++      ext4_unlock_group(sb, block_group);
++
+       /* Ok, now we can actually update the inode bitmaps.. */
+-      if (!ext4_clear_bit_atomic(ext4_group_lock_ptr(sb, block_group),
+-                                 bit, bitmap_bh->b_data))
++      if (!cleared)
+               ext4_error(sb, "ext4_free_inode",
+                          "bit already cleared for inode %lu", ino);
+       else {
index ad9a0b3..b82357e 100644 (file)
@@ -25,3 +25,4 @@ ext4-lustre-i_version.patch
 ext4-lock-cached_extent.patch
 ext4-convert-group-lock-sles11.patch
 ext4-force_over_8tb-sles11.patch
+ext4-claim_inode-free_inode-race.patch