]> www.infradead.org Git - linux.git/commitdiff
jbd2: remove dead check of JBD2_UNMOUNT in kjournald2
authorKemeng Shi <shikemeng@huaweicloud.com>
Tue, 14 May 2024 11:24:37 +0000 (19:24 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 27 Jun 2024 14:20:26 +0000 (10:20 -0400)
We always set JBD2_UNMOUNT with j_state_lock held in journal_kill_thread.
In kjournald2, we check JBD2_UNMOUNT flag two times under the same
j_state_lock. Then the second check is unnecessary.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20240514112438.1269037-9-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/jbd2/journal.c

index 079b3eeaa4d50517c4d515014487b42028eb7576..c7869b187380512cd1b4a0867a04c38b1677cf87 100644 (file)
@@ -228,8 +228,6 @@ loop:
                if (transaction && time_after_eq(jiffies,
                                                transaction->t_expires))
                        should_sleep = 0;
-               if (journal->j_flags & JBD2_UNMOUNT)
-                       should_sleep = 0;
                if (should_sleep) {
                        write_unlock(&journal->j_state_lock);
                        schedule();