From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3ADC048C406 for ; Thu, 6 Aug 2026 17:00:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786035611; cv=none; b=KEk711m+EudX9uomC7r8x8CBc/P3MWFbD+eosMWvhocw9fRs/AzpfZh4sCly99Hiann7V/TLpgmJod3/PomKkElpcbh0IXFSNtYTf8vPEMFYBU3WAA6N+ZnosbNEwfaCPGrRl3GM1gBmTsKgtZ8AEL8Cpp7bGhrBTDC2x7k4tuM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786035611; c=relaxed/simple; bh=92j6zzfTbfyHLTwkDGD6bYfpfzSkLDZ7TK79qat2c7g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D5o+X1Glz5hvfOodaucg4j8gplQ1KeiX5G8IYpl6RtcCrf42g76ksfVTdW8j6tpref+/JVhGGz1OGrpCSWqCPN5GVmkhAfdqTGwztBUZcBAhvY5NRlrtzJQ01mNb1h1Y8c3V1ab681YI9bYNxT2LODCcA7RUx4oT/YY/TwJIxp0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VXHWA5pY; arc=none smtp.client-ip=209.85.221.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VXHWA5pY" Received: by mail-vk1-f182.google.com with SMTP id 71dfb90a1353d-5c2c0e261aeso700398e0c.0 for ; Thu, 06 Aug 2026 10:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786035608; x=1786640408; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Y0IvqThbFa3F9XFl8mEQfcRObacw4VhqXeJ5e5/Q63c=; b=VXHWA5pYllrSyJHP+Y1cW45sd9QyBnAXJFHXXQW3HsvtWFj+dNMk1t5z/PNZv2GDmT nBTs3sjvl4rowBP/1xgGEKnsdNQ8bxw/RrPisX1RGIsyT+BlmaCaI2UGD1RtXFSM/Vah eANb+YT/p99zHQuDGCef2a8qLpO2F3wCIl4QQaQ+1FQY3TkLt+cFPg+zQlyNJvCBvHPV vP9uBEFxZ1j2jmX/5lhIDi7Zlq2+jVeeHUR4G/1GhM9TPxPZN4P5V21YXug8kkc4GiIy oKmZ0ItaiS4P2YT5zc53QlpmMb+igjjNpFcYZ3u53z9QmaJNwgLukVF5+d7858rxPp95 cD0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786035608; x=1786640408; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Y0IvqThbFa3F9XFl8mEQfcRObacw4VhqXeJ5e5/Q63c=; b=ozEWbkzbrbeEkd/N9Q6N5TA5Es7hIT92fbo7TfiAq2f94YyY1W2qJ6Jyeb7Rua1ZJb tDdLj+147a/cTdZtkw1n+FqOox482seEXHHBXrw9Bf37pX6wjQStL3NZo/mlNCAPy4UO F+vBQTy7Fa1cKzfwxE3PKeojeJwPl09raNSj2OMVGGCHJxk7MLRC3hWLPNr97ABy/5jd t3FlyJpRNRNHrAjjQ63Rs6UGlGfXbqQLPOAAq9jsikGfRHiV088Gykyk2TwPrBYz6hJJ LXM5y7essBnaYCgkzxkFTs9JnSKoAU+fs2ATtixKIbK7LK15LT0o3y8A5lL8lktvFJ+P X/dw== X-Forwarded-Encrypted: i=1; AHgh+Rr8TD69z76Hnn5UejGFCq8taw4/qMyquzRXFAt7PXYMlMbBrKqThby2h250lF98zeenkyM1e99PaBWtBWA=@vger.kernel.org X-Gm-Message-State: AOJu0YzOio7+UP07KBzzdnO28Ottw75ahv6GzZBouEu0YGczydAW/KQz PM9C3yWQpXlb3C4RXcquez/lJgshMYlUDgpigYL+poRycdYTFVCEhjKE X-Gm-Gg: AR+sD13/cNHVYIfLN8G/ylBUGtZMfRL1aaPL/3MRo9PvPb0C4Yfvlw0OBmu9+0TLnu0 k7XZWNWq5WWydcJ8BdA0wxlHe6Jwr5op2K15jXB+BnIdShIr8BnSdFU7fpEjPS3z887teT9wym/ vw+0pH0YS73Y2/w+0wPaunngdwYydMP2kNY1SYh786fBnh3IWaXdRwRKV6j2BFWD5vp1SteV0Cl 7oNSQN0wcwAKFepqfMpxyoBHWfLjHP9tpnhs8S4JVaFOtzcDRPzbzE2HP0QKc2WO0F0GEX6uFBu X5Ofwjbya3/IC3YKVZWUZ13yvRQzqCBznnD078w6CgSn/U5lXSKXaljBCqOV7eu98pfMort8tlh YTFq7MdlzRHtvZ3ls+et4ShavEH4qkA2QjOJ/BuWF9lJiAshxOvcTt4d/rpspTydmXceefb3y00 SKJb1W2VVpwNNYhDIssqdW/UpQy02w9GKkZRVYWlTapT1OpOsNZ0xZAJpdRR9dHVLx2uZRGDlFG uUJHpw= X-Received: by 2002:a05:6122:390a:b0:5a2:5c65:850f with SMTP id 71dfb90a1353d-5c3d91f3c3cmr1985318e0c.10.1786035608151; Thu, 06 Aug 2026 10:00:08 -0700 (PDT) Received: from syssplab.cs.fiu.edu (nat1.cs.fiu.edu. [131.94.134.89]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-5c3d05c594fsm3706321e0c.8.2026.08.06.10.00.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Aug 2026 10:00:07 -0700 (PDT) From: Chao Shi To: Jan Kara , Christian Brauner , Alexander Viro , Matthew Wilcox , linux-fsdevel@vger.kernel.org Cc: Theodore Ts'o , Andreas Dilger , Baokun Li , Ojaswin Mujoo , Ritesh Harjani , Zhang Yi , Zhang Yi , Bob Copeland , Namjae Jeon , Sungjong Seo , Yuezhang Mo , OGAWA Hirofumi , Mark Fasheh , Joel Becker , Joseph Qi , Andreas Gruenbacher , linux-ext4@vger.kernel.org, ocfs2-devel@lists.linux.dev, gfs2@lists.linux.dev, linux-kernel@vger.kernel.org, Chao Shi , Weidong Zhu Subject: [PATCH v2 19/21] ext4, jbd2: report fast commit write errors with BH_Write_EIO Date: Thu, 6 Aug 2026 12:58:42 -0400 Message-ID: <970d8b9603d4620ab73038f49bc36831e37e00a0.1785951556.git.coshi036@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ext4_end_buffer_io_sync() is the third completion handler in this series that reports a failed write by clearing BH_Uptodate, and jbd2_fc_wait_bufs() is the only thing that looks at the result. Convert both. Like the jbd2 handler, this one stops touching BH_Uptodate at all. ext4_fc_submit_bh() marks the buffer up to date before submitting, so setting it again on completion said nothing. The local flag and the debug messages are reworded to describe the write rather than the buffer's contents, which the write does not change. They have to move in the same patch. The handler lives in ext4 and the wait in jbd2, but neither is used by anything else: the buffers are ext4's fast commit blocks, submitted by ext4_fc_submit_bh() and waited for by jbd2_fc_wait_bufs(). Converting one without the other silently disables fast commit write error reporting. Acked-by: Weidong Zhu Signed-off-by: Chao Shi --- fs/ext4/fast_commit.c | 11 +++++------ fs/jbd2/journal.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c index 8e2259799614..a2028fbd4540 100644 --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -203,17 +203,16 @@ static inline void ext4_fc_set_snap_err(int *snap_err, int err) static void ext4_end_buffer_io_sync(struct bio *bio) { struct buffer_head *bh; - bool uptodate = bio_endio_bh(bio, &bh); + bool success = bio_endio_bh(bio, &bh); BUFFER_TRACE(bh, ""); - if (uptodate) { - ext4_debug("%s: Block %lld up-to-date", + if (success) { + ext4_debug("%s: Block %lld written", __func__, bh->b_blocknr); - set_buffer_uptodate(bh); } else { - ext4_debug("%s: Block %lld not up-to-date", + ext4_debug("%s: Block %lld write failed", __func__, bh->b_blocknr); - clear_buffer_uptodate(bh); + mark_buffer_write_io_error(bh); } unlock_buffer(bh); diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 6e05dc47e20a..72e8ccbf7de4 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -886,7 +886,7 @@ int jbd2_fc_wait_bufs(journal_t *journal, int num_blks) * Update j_fc_off so jbd2_fc_release_bufs can release remain * buffer head. */ - if (unlikely(!buffer_uptodate(bh))) { + if (unlikely(buffer_write_io_error(bh))) { journal->j_fc_off = i + 1; return -EIO; } -- 2.43.0