* [PATCH] ext4: fix input checking in fs/jbd2/journal.c
@ 2021-06-07 17:55 Leah Rumancik
2021-06-24 14:17 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Leah Rumancik @ 2021-06-07 17:55 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso, dan.carpenter, Leah Rumancik, kernel test robot
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@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext4: fix input checking in fs/jbd2/journal.c
2021-06-07 17:55 [PATCH] ext4: fix input checking in fs/jbd2/journal.c Leah Rumancik
@ 2021-06-24 14:17 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2021-06-24 14:17 UTC (permalink / raw)
To: Leah Rumancik; +Cc: linux-ext4, dan.carpenter, kernel test robot
On Mon, Jun 07, 2021 at 05:55:58PM +0000, Leah Rumancik wrote:
> 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@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Thanks, I've folded this fix into the base commit.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-24 14:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-07 17:55 [PATCH] ext4: fix input checking in fs/jbd2/journal.c Leah Rumancik
2021-06-24 14:17 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).