[kernel] r15578 - in dists/sid/linux-2.6/debian: . patches/bugfix/all patches/series

Maximilian Attems maks at alioth.debian.org
Wed Apr 28 23:30:51 UTC 2010


Author: maks
Date: Wed Apr 28 23:30:49 2010
New Revision: 15578

Log:
ext4 Issue the discard operation *before* releasing the blocks to be
reused

as we now support TRIM this can trigger..

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/all/ext4-issue-discard-operation-before-releasing-blocks.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/12

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Wed Apr 28 23:24:42 2010	(r15577)
+++ dists/sid/linux-2.6/debian/changelog	Wed Apr 28 23:30:49 2010	(r15578)
@@ -54,6 +54,8 @@
   * Backport KVM: Xen PV-on-HVM guest support.
   * Backport KVM: x86: Add KVM_GET/SET_VCPU_EVENTS. (closes: #578005)
   * hugetlb: fix infinite loop in get_futex_key() when backed by huge pages
+  * ext4: Issue the discard operation *before* releasing the blocks to be
+    reused.
 
   [ dann frazier ]
   * Add DRBD backport

Added: dists/sid/linux-2.6/debian/patches/bugfix/all/ext4-issue-discard-operation-before-releasing-blocks.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/all/ext4-issue-discard-operation-before-releasing-blocks.patch	Wed Apr 28 23:30:49 2010	(r15578)
@@ -0,0 +1,62 @@
+From: Theodore Ts'o <tytso at mit.edu>
+Date: Tue, 20 Apr 2010 20:51:59 +0000 (-0400)
+Subject: ext4: Issue the discard operation *before* releasing the blocks to be reused
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=b90f687018e6d6c77d981b09203780f7001407e5
+
+ext4: Issue the discard operation *before* releasing the blocks to be reused
+
+[ backported to 2.6.3[23] ]
+
+Otherwise, we can end up having data corruption because the blocks
+could get reused and then discarded!
+
+https://bugzilla.kernel.org/show_bug.cgi?id=15579
+
+Signed-off-by: "Theodore Ts'o" <tytso at mit.edu>
+---
+
+diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
+index 54df209..e5ab41b 100644
+--- a/fs/ext4/mballoc.c
++++ b/fs/ext4/mballoc.c
+@@ -2534,6 +2534,20 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn)
+ 		mb_debug(1, "gonna free %u blocks in group %u (0x%p):",
+ 			 entry->count, entry->group, entry);
+ 
++		if (test_opt(sb, DISCARD)) {
++			ext4_fsblk_t discard_block;
++			struct ext4_super_block *es = EXT4_SB(sb)->s_es;
++
++			discard_block = (ext4_fsblk_t)entry->group *
++						EXT4_BLOCKS_PER_GROUP(sb)
++					+ entry->start_blk
++					+ le32_to_cpu(es->s_first_data_block);
++			trace_ext4_discard_blocks(sb,
++					(unsigned long long)discard_block,
++					entry->count);
++			sb_issue_discard(sb, discard_block, entry->count);
++		}
++
+ 		err = ext4_mb_load_buddy(sb, entry->group, &e4b);
+ 		/* we expect to find existing buddy because it's pinned */
+ 		BUG_ON(err != 0);
+@@ -2555,19 +2566,6 @@ static void release_blocks_on_commit(journal_t *journal, transaction_t *txn)
+ 			page_cache_release(e4b.bd_bitmap_page);
+ 		}
+ 		ext4_unlock_group(sb, entry->group);
+-		if (test_opt(sb, DISCARD)) {
+-			ext4_fsblk_t discard_block;
+-			struct ext4_super_block *es = EXT4_SB(sb)->s_es;
+-
+-			discard_block = (ext4_fsblk_t)entry->group *
+-						EXT4_BLOCKS_PER_GROUP(sb)
+-					+ entry->start_blk
+-					+ le32_to_cpu(es->s_first_data_block);
+-			trace_ext4_discard_blocks(sb,
+-					(unsigned long long)discard_block,
+-					entry->count);
+-			sb_issue_discard(sb, discard_block, entry->count);
+-		}
+ 		kmem_cache_free(ext4_free_ext_cachep, entry);
+ 		ext4_mb_release_desc(&e4b);
+ 	}

Modified: dists/sid/linux-2.6/debian/patches/series/12
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/12	Wed Apr 28 23:24:42 2010	(r15577)
+++ dists/sid/linux-2.6/debian/patches/series/12	Wed Apr 28 23:30:49 2010	(r15578)
@@ -54,4 +54,4 @@
 + debian/sd-libata-set-capacity-abi-changes.patch
 + bugfix/all/core-x86-make-list_poison-less-deadly.patch
 + bugfix/all/hugetlb-fix-infinite-loop-in-get_futex_key-when-backed-by-huge-pages.patch
-
++ bugfix/all/ext4-issue-discard-operation-before-releasing-blocks.patch



More information about the Kernel-svn-changes mailing list