[lvc-project] [PATCH] gfs2: Remove unnecessary sd_jdesc NULL check in gfs2_log_flush

Nikolai Kuznetsov niku.csmsu at yandex.ru
Tue Apr 14 01:34:56 MSK 2026


Previous commit added an explicit NULL check for sd_jdesc to avoid
a race with unmount. However, in gfs2_log_flush() already goto out
when SDF_JOURNAL_LIVE is cleared, which happens during the final
shutdown flush before sd_jdesc is set to NULL. The explicit check
is redundant, remove it.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 35264909e9d1 ("gfs2: Fix NULL pointer dereference in gfs2_log_flush")
Cc: stable at vger.kernel.org
Signed-off-by: Nikolai Kuznetsov <niku.csmsu at yandex.ru> 
---
 fs/gfs2/log.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 347df29d610e..e4457fe6d9d6 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -1096,8 +1096,9 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl, u32 flags)
 	lops_before_commit(sdp, tr);
 	if (gfs2_withdrawn(sdp))
 		goto out_withdraw;
-	if (sdp->sd_jdesc)
-		gfs2_log_submit_write(&sdp->sd_jdesc->jd_log_bio);
+
+	gfs2_log_submit_write(&sdp->sd_jdesc->jd_log_bio);
+
 	if (gfs2_withdrawn(sdp))
 		goto out_withdraw;
 
-- 
2.43.0




More information about the lvc-project mailing list