CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Coly Li <[email protected]>
CC: Kent Overstreet <[email protected]>
CC: [email protected]
CC: [email protected]

From: kernel test robot <[email protected]>

drivers/md/bcache/journal.c:1159:21-22: WARNING opportunity for min()


 Check for opencoded min(), max() implementations.
 Generated patches sometimes require adding a cast to fix compile warning.
 Warnings/patches scope intentionally limited to a function body.

Generated by: scripts/coccinelle/misc/minmax.cocci

Fixes: 3b8b66931ac5 ("bcache: avoid journal deadlock by non-space of journal 
buckets")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: kernel test robot <[email protected]>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/colyli/linux-bcache.git 
journal-deadlock
head:   3b8b66931ac5737b91909363154ba00381252783
commit: 3b8b66931ac5737b91909363154ba00381252783 [3/3] bcache: avoid journal 
deadlock by non-space of journal buckets
:::::: branch date: 3 hours ago
:::::: commit date: 3 hours ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/md/bcache/journal.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -1156,10 +1156,7 @@ int bch_journal_alloc(struct cache_set *
                return -ENOMEM;
 
        /* deside how many sectors reserved for jouranl replay */
-       if (JOURANL_RESERVE < c->cache->sb.bucket_size)
-               j->reserved = JOURANL_RESERVE;
-       else
-               j->reserved = c->cache->sb.bucket_size;
+       j->reserved = min(JOURANL_RESERVE, c->cache->sb.bucket_size);
 
        return 0;
 }
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to