[3.11.y.z extended stable] Patch "bcache: Fix dirty_data accounting" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Thu Jan 9 12:03:22 UTC 2014


This is a note to let you know that I have just added a patch titled

    bcache: Fix dirty_data accounting

to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From ad6ef04712a5040d9867382cea51255676807cd2 Mon Sep 17 00:00:00 2001
From: Kent Overstreet <kmo at daterainc.com>
Date: Sun, 10 Nov 2013 21:55:27 -0800
Subject: bcache: Fix dirty_data accounting

commit d24a6e1087030b6da286df9433add5fa2f21b83b upstream.

Dirty data accounting wasn't quite right - firstly, we were adding the key we're
inserting after it could have merged with another dirty key already in the
btree, and secondly we could sometimes pass the wrong offset to
bcache_dev_sectors_dirty_add() for dirty data we were overwriting - which is
important when tracking dirty data by stripe.

NOTE FOR BACKPORTERS: For 3.10 (and 3.11?) there's other accounting fixes
necessary that got squashed in with other patches; the full patch against 3.10
is 408cc2f47eeac93a, available at:
  git://evilpiepirate.org/~kent/linux-bcache.git bcache-3.10-writeback-fixes

Signed-off-by: Kent Overstreet <kmo at daterainc.com>
[ luis: backported to 3.11:
  - replaced usage of 'replace_key' by '&op->replace'
    (all the additional bits required for 3.10 are already included ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 drivers/md/bcache/btree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 9e6c9f5..230d81e 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1673,7 +1673,8 @@ static bool fix_overlapping_extents(struct btree *b,
 			if (KEY_START(k) > KEY_START(insert) + sectors_found)
 				goto check_failed;

-			if (KEY_PTRS(&op->replace) != KEY_PTRS(k))
+			if (KEY_PTRS(k) != KEY_PTRS(&op->replace) ||
+			    KEY_DIRTY(k) != KEY_DIRTY(&op->replace))
 				goto check_failed;

 			/* skip past gen */
--
1.8.3.2





More information about the kernel-team mailing list