From afc46dcf12919db63e20f853b8988702d37a64c4 Mon Sep 17 00:00:00 2001 From: johann Date: Wed, 1 Jul 2009 20:46:45 +0000 Subject: [PATCH] Branch b1_8 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 --- .../patches/ext4-claim_inode-free_inode-race.patch | 28 ++++++++++++++++++++++ .../series/ldiskfs-2.6-sles11.series | 1 + 2 files changed, 29 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/ext4-claim_inode-free_inode-race.patch 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 index 0000000..c742b38 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext4-claim_inode-free_inode-race.patch @@ -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 { diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series index ad9a0b3..b82357e 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series @@ -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 -- 1.8.3.1