[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210607175558.3343945-1-leah.rumancik@gmail.com>
Date: Mon, 7 Jun 2021 17:55:58 +0000
From: Leah Rumancik <leah.rumancik@...il.com>
To: linux-ext4@...r.kernel.org
Cc: tytso@....edu, dan.carpenter@...cle.com,
Leah Rumancik <leah.rumancik@...il.com>,
kernel test robot <lkp@...el.com>
Subject: [PATCH] ext4: fix input checking in fs/jbd2/journal.c
Update
if (JBD2_JOURNAL_FLUSH_DISCARD & !blk_queue_discard(q))
to use && instead of &. JBD2_JOURNAL_FLUSH_DISCARD is set to 1 so &
technically works but && could be a bit faster and will maintain
correctness in the event the value of JBD2_JOURNAL_FLUSH_DISCARD is
updated.
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Leah Rumancik <leah.rumancik@...il.com>
---
fs/jbd2/journal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 521ce41c242c..f0636180b624 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1715,7 +1715,7 @@ static int __jbd2_journal_erase(journal_t *journal, unsigned int flags)
if (!q)
return -ENXIO;
- if (JBD2_JOURNAL_FLUSH_DISCARD & !blk_queue_discard(q))
+ if (JBD2_JOURNAL_FLUSH_DISCARD && !blk_queue_discard(q))
return -EOPNOTSUPP;
/*
--
2.32.0.rc1.229.g3e70b5a671-goog
Powered by blists - more mailing lists