From: Kemeng Shi Date: Thu, 1 Aug 2024 01:38:09 +0000 (+0800) Subject: jbd2: remove dead check in journal_alloc_journal_head X-Git-Tag: v6.12-rc1~117^2~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2917bda8a5c97be41c34e7761863a724097cf91;p=thirdparty%2Fkernel%2Flinux.git jbd2: remove dead check in journal_alloc_journal_head We will alloc journal_head with __GFP_NOFAIL anyway, test for failure is pointless. Signed-off-by: Kemeng Shi Reviewed-by: Jan Kara Reviewed-by: Zhang Yi Link: https://patch.msgid.link/20240801013815.2393869-3-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o --- diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 33a975193f1f1..326373ab022ae 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -2866,8 +2866,7 @@ static struct journal_head *journal_alloc_journal_head(void) ret = kmem_cache_zalloc(jbd2_journal_head_cache, GFP_NOFS | __GFP_NOFAIL); } - if (ret) - spin_lock_init(&ret->b_state_lock); + spin_lock_init(&ret->b_state_lock); return ret; }