Re: On https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=775c17386a6fd
Dmitry Antipov <[email protected]> Wed, 27 May 2026 15:50:18 +0300
| Newsgroups | dev.linux.lists.ocfs2-devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2026-05-27 at 15:52 +0800, Joseph Qi wrote:
> block was never added to the ocfs2 metadata cache because the first read failed
Hm. Did you ever try to run https://syzkaller.appspot.com/text?tag=ReproC&x=14a8f142580000?
IIUC the following debug quirk shows that this is not true:
diff --git a/fs/ocfs2/buffer_head_io.c b/fs/ocfs2/buffer_head_io.c
index 701d27d908d4..77fbd9d1799f 100644
--- a/fs/ocfs2/buffer_head_io.c
+++ b/fs/ocfs2/buffer_head_io.c
@@ -187,6 +187,12 @@ int ocfs2_read_blocks_sync(struct ocfs2_super *osb, u64 block,
return status;
}
+enum ocfs2_validation_bits {
+ BH_FailedValidation = BH_PrivateStart + 7,
+};
+
+BUFFER_FNS(FailedValidation, failed_validation)
+
/* Caller must provide a bhs[] with all NULL or non-NULL entries, so it
* will be easier to handle read failure.
*/
@@ -380,16 +386,20 @@ int ocfs2_read_blocks(struct ocfs2_caching_info *ci, u64 block, int nr,
BUG_ON(buffer_jbd(bh));
clear_buffer_needs_validate(bh);
status = validate(sb, bh);
- if (status)
+ if (status) {
+ set_buffer_failed_validation(bh);
goto read_failure;
+ }
}
}
/* Always set the buffer in the cache, even if it was
* a forced read, or read-ahead which hasn't yet
* completed. */
- if (bh)
+ if (bh) {
+ BUG_ON(buffer_failed_validation(bh));
ocfs2_set_buffer_uptodate(ci, bh);
+ }
}
ocfs2_metadata_cache_io_unlock(ci);
==>
executing program
[ 44.509473][ T5467] loop0: detected capacity change from 0 to 32768
[ 44.515278][ T5467] =======================================================
[ 44.515278][ T5467] WARNING: The mand mount option has been deprecated and
[ 44.515278][ T5467] and is ignored by this kernel. Remove the mand
[ 44.515278][ T5467] option from the mount to silence this warning.
[ 44.515278][ T5467] =======================================================
[ 44.536046][ T5467] JBD2: Ignoring recovery information on journal
[ 44.577220][ T5467] ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode.
[ 44.611995][ T5467] (repro-30b53487d,5467,0):ocfs2_check_set_options:1244 ERROR: Invalid heartbeat mount options
[ 44.621817][ T5467] loop0: detected capacity change from 32768 to 32767
[ 44.628016][ T5467] OCFS2: ERROR (device loop0): int ocfs2_validate_dx_root(struct super_block *, struct buffer_head *): Dir Index Root # 74 has bad signature XDIR01
[ 44.629720][ T5467] On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.
[ 44.630205][ T5467] OCFS2: File system is now read-only.
[ 44.631290][ T5467] (repro-30b53487d,5467,0):ocfs2_find_entry_dx:1065 ERROR: status = -30
[ 44.631898][ T5467] ------------[ cut here ]------------
[ 44.632168][ T5467] kernel BUG at fs/ocfs2/buffer_head_io.c:400!
Dmitry