aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColy Li <colyli@suse.de>2018-09-13 21:38:01 +0800
committerColy Li <colyli@suse.de>2018-09-13 21:38:01 +0800
commit62d1c91439fc8476206eae593e9b30274a0e49ad (patch)
tree9dafafc010b2b91653a6ad87111768ba505ab2b5
parentbb06a811e697c895953196373a92b3e3201b56ae (diff)
downloadbcache-patches-62d1c91439fc8476206eae593e9b30274a0e49ad.tar.gz
for-next: add 0001-bcache-replace-hard-coded-number-with-BUCKET_GC_GEN_.patch
-rw-r--r--for-next/0001-bcache-replace-hard-coded-number-with-BUCKET_GC_GEN_.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/for-next/0001-bcache-replace-hard-coded-number-with-BUCKET_GC_GEN_.patch b/for-next/0001-bcache-replace-hard-coded-number-with-BUCKET_GC_GEN_.patch
new file mode 100644
index 0000000..405707e
--- /dev/null
+++ b/for-next/0001-bcache-replace-hard-coded-number-with-BUCKET_GC_GEN_.patch
@@ -0,0 +1,31 @@
+From 22f3e99d62f845c8a2343179df8dc0c265afa79c Mon Sep 17 00:00:00 2001
+From: Coly Li <colyli@suse.de>
+Date: Thu, 13 Sep 2018 21:31:14 +0800
+Subject: [PATCH] bcache: replace hard coded number with BUCKET_GC_GEN_MAX
+
+In extents.c:bch_extent_bad(), number 96 is used as parameter to call
+btree_bug_on(). The purpose is to check whether stale gen value exceeds
+BUCKET_GC_GEN_MAX, so it is better to use macro BUCKET_GC_GEN_MAX to
+make the code more understandable.
+
+Signed-off-by: Coly Li <colyli@suse.de>
+---
+ drivers/md/bcache/extents.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/md/bcache/extents.c b/drivers/md/bcache/extents.c
+index 1d096742eb41..144b1d0f9b84 100644
+--- a/drivers/md/bcache/extents.c
++++ b/drivers/md/bcache/extents.c
+@@ -550,7 +550,7 @@ static bool bch_extent_bad(struct btree_keys *bk, const struct bkey *k)
+ for (i = 0; i < KEY_PTRS(k); i++) {
+ stale = ptr_stale(b->c, k, i);
+
+- btree_bug_on(stale > 96, b,
++ btree_bug_on(stale > BUCKET_GC_GEN_MAX, b,
+ "key too stale: %i, need_gc %u",
+ stale, b->c->need_gc);
+
+--
+2.16.4
+