WARNING in ntfs_evict_inode
Subsystems (2)
syzbot
syzbotHello,
syzbot found the following issue on:
HEAD commit: 238650ef6c7c Merge tag 'powerpc-7.3-4' of git://git.kernel.. git tree: upstream console+strace: https://syzkaller.appspot.com/x/log.txt?x=12baebf9580000 kernel config: https://syzkaller.appspot.com/x/.config?x=b454dc6b1b7acd30 dashboard link: https://syzkaller.appspot.com/bug?extid=3db654d91b471c4d7a7d compiler: Debian clang version 22.1.8 (++20260613092233+e80beda6e255-1~exp1~20260613092250.77), Debian LLD 22.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=144f93f9580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16baebf9580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/41924f079a65/disk-238650ef.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/09d46c75ec43/vmlinux-238650ef.xz
kernel image: https://storage.googleapis.com/syzbot-assets/061e8caeb39c/bzImage-238650ef.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/881a3ca6c010/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
------------[ cut here ]------------
ifs_is_fully_uptodate(folio, ifs) != folio_test_uptodate(folio)
WARNING: fs/iomap/buffered-io.c:295 at ifs_free+0x34a/0x410 fs/iomap/buffered-io.c:294, CPU#1: syz-executor196/5626
Modules linked in:
CPU: 1 UID: 0 PID: 5626 Comm: syz-executor196 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
RIP: 0010:ifs_free+0x34a/0x410 fs/iomap/buffered-io.c:294
Code: 41 5f 5d e9 b8 66 c1 ff e8 83 47 61 ff 90 0f 0b 90 e9 d5 fe ff ff e8 75 47 61 ff 90 0f 0b 90 e9 12 ff ff ff e8 67 47 61 ff 90 <0f> 0b 90 eb c7 44 89 e1 80 e1 07 80 c1 03 38 c1 0f 8c 08 fe ff ff
RSP: 0018:ffffc90004a3f5d8 EFLAGS: 00010293
RAX: ffffffff826553d9 RBX: 0000000000000008 RCX: ffff888038a19f40
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 000000008265d201 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: fffff9400023c4e1 R12: ffff888028521084
R13: ffff888028521000 R14: ffffea00011e2700 R15: 0000000000000000
FS: 0000555586e47400(0000) GS:ffff888125ccb000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f0595ca6000 CR3: 000000001bbb4000 CR4: 00000000003526f0
Call Trace:
<TASK>
folio_invalidate mm/truncate.c:140 [inline]
truncate_cleanup_folio+0xcb/0x190 mm/truncate.c:160
truncate_inode_pages_range+0x2c4/0xd80 mm/truncate.c:404
ntfs_evict_inode+0x19/0x40 fs/ntfs3/inode.c:2012
evict+0x624/0xb50 fs/inode.c:822
dispose_list fs/inode.c:864 [inline]
evict_inodes+0x7e3/0x870 fs/inode.c:918
generic_shutdown_super+0xaa/0x2d0 fs/super.c:741
kill_block_super+0x44/0xa0 fs/super.c:1904
ntfs3_kill_sb+0x44/0x1c0 fs/ntfs3/super.c:1940
deactivate_locked_super+0xbc/0x110 fs/super.c:589
cleanup_mnt+0x3d3/0x460 fs/namespace.c:1317
task_work_run+0x1d9/0x270 kernel/task_work.c:233
ptrace_notify+0x27c/0x2b0 kernel/signal.c:2536
ptrace_report_syscall include/linux/ptrace.h:416 [inline]
ptrace_report_syscall_exit+0x2d/0x50 include/linux/ptrace.h:477
arch_ptrace_report_syscall_exit include/linux/entry-common.h:240 [inline]
syscall_exit_work include/linux/entry-common.h:273 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:304 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:341 [inline]
do_syscall_64+0x4a0/0x520 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f6e5f33cec7
Code: bf 41 4d 56 53 b8 9d 00 00 00 0f 05 83 f8 ea 75 a2 c7 05 08 6c 0c 00 00 00 00 00 eb 96 e8 91 05 00 00 90 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 d0 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffdde381518 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 000000000001a4fc RCX: 00007f6e5f33cec7
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffdde3815d0
RBP: 00007ffdde3815d0 R08: 00007ffdde3825d0 R09: 00000000ffffffff
R10: 0000000000000000 R11: 0000000000000206 R12: 00007ffdde382680
R13: 0000555586e48760 R14: 431bde82d7b634db R15: 00007ffdde382624
</TASK>---
This report is generated by a bot. It may contain errors. See https://goo.gl/tpsmEJ for more information about syzbot. syzbot engineers can be reached at [email protected].
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
syzbot
syzbotForwarded: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
For archival purposes, forwarding an incoming command email to [email protected].
For archival purposes, forwarding an incoming command email to [email protected].
***
Subject: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
Author: [email protected]
#syz test:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
fs/ntfs3/frecord.c +1 -0
@@ -7,6 +7,7 @@#include <linux/fiemap.h> #include <linux/fs.h> +#include <linux/iomap.h> #include <linux/minmax.h> #include <linux/vmalloc.h>
@@ -1943,7 +1944,7 @@ int ni_read_folio_cmpr(struct ntfs_inode *ni,
struct folio *folio)
if (vbo >= i_size_read(&ni->vfs_inode)) {
folio_zero_range(folio, 0, folio_size(folio));
- folio_mark_uptodate(folio);
+ iomap_folio_mark_uptodate(folio);
err = 0;
goto out;
}
@@ -2521,7 +2522,8 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages,
out:
for (i = 0; i < pages_per_frame; i++) {
pg = pages[i];
- SetPageUptodate(pg);
+ if (pg)
+ iomap_folio_mark_uptodate(page_folio(pg));
}
return err;
syzbot
syzbotForwarded: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
In reply to syzbotFor archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
Author: [email protected]
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
fs/ntfs3/frecord.c +4 -2
@@ -7,6 +7,7 @@#include <linux/fiemap.h> #include <linux/fs.h> +#include <linux/iomap.h> #include <linux/minmax.h> #include <linux/vmalloc.h>
@@ -1943,7 +1944,7 @@ int ni_read_folio_cmpr(struct ntfs_inode *ni, struct folio *folio)if (vbo >=i_size_read (&ni->vfs_inode)) {folio_zero_range (folio,0 ,folio_size (folio)); -folio_mark_uptodate (folio); +iomap_folio_mark_uptodate (folio); err =0 ; goto out; }
@@ -2521,7 +2522,8 @@ int ni_read_frame(struct ntfs_inode *ni, u64 frame_vbo, struct page **pages, out:for (i =0 ; i < pages_per_frame; i++) { pg = pages[i]; -SetPageUptodate (pg); +if (pg) +iomap_folio_mark_uptodate (page_folio (pg)); }return err;
syzbot
syzbotForwarded: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
In reply to syzbotFor archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
Author: [email protected]
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
fs/ntfs3/inode.c +1 -1
@@ -842,7 +842,7 @@ static int ntfs_read_folio(struct file *file, struct folio *folio)if (ni->i_valid <= vbo) {folio_zero_range (folio,0 ,folio_size (folio)); -folio_mark_uptodate (folio); +iomap_folio_mark_uptodate (folio);folio_unlock (folio);return 0 ; }
syzbot
syzbotForwarded: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
In reply to syzbotFor archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
Author: [email protected]
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 518e5b794c06
fs/ntfs3/inode.c +1 -1
@@ -842,7 +842,7 @@ static int ntfs_read_folio(struct file *file, struct folio *folio)if (ni->i_valid <= vbo) {folio_zero_range (folio,0 ,folio_size (folio)); -folio_mark_uptodate (folio); +iomap_folio_mark_uptodate (folio);folio_unlock (folio);return 0 ; }
syzbot
syzbotForwarded: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
In reply to syzbotFor archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
Author: [email protected]
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 518e5b794c06
fs/ntfs3/inode.c +1 -1
@@ -842,7 +842,7 @@ static int ntfs_read_folio(struct file *file, struct folio *folio)if (ni->i_valid <= vbo) {folio_zero_range (folio,0 ,folio_size (folio)); -folio_mark_uptodate (folio); +iomap_folio_mark_uptodate (folio);folio_unlock (folio);return 0 ; }
syzbot
syzbotForwarded: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
In reply to syzbotFor archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: Re: [syzbot] [ntfs3?] WARNING in ntfs_evict_inode
Author: [email protected]
#syz test
fs/ntfs3/inode.c +1 -1
@@ -842,7 +842,7 @@ static int ntfs_read_folio(struct file *file, struct folio *folio)if (ni->i_valid <= vbo) {folio_zero_range (folio,0 ,folio_size (folio)); -folio_mark_uptodate (folio); +iomap_folio_mark_uptodate (folio);folio_unlock (folio);return 0 ; }
syzbot
syzbotForwarded: [PATCH] debug: log uptodate states for iomap bug
In reply to syzbotFor archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: [PATCH] debug: log uptodate states for iomap bug
Author: [email protected]
---
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 238650ef6c7c
fs/iomap/buffered-io.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/iomap/buffered-io.c +7 -2
@@ -291,8 +291,13 @@ static void ifs_free(struct folio *folio)return ;WARN_ON_ONCE (ifs->read_bytes_pending !=0 );WARN_ON_ONCE (atomic_read (&ifs->write_bytes_pending)); -WARN_ON_ONCE (ifs_is_fully_uptodate (folio, ifs) != -folio_test_uptodate (folio)); + +bool ifs_up =ifs_is_fully_uptodate (folio, ifs); +bool folio_up =folio_test_uptodate (folio); + +if (WARN_ON_ONCE (ifs_up != folio_up)) +pr_err ("IOMAP DEBUG: ifs_up=%d, folio_up=%d\n" , ifs_up, folio_up); +kfree (ifs); }
Signature · 1 line
2.47.3
PATCH 1/1 ntfs3: sync uptodate with iomap folio state in read_folio
In reply to syzbotntfs3 registers iomap page-cache helpers for its regular files. When the filesystem block size is smaller than the folio size, folios are backed by iomap_folio_state with a per-block uptodate bitmap in addition to PG_uptodate.
The i_valid <= vbo early exit in ntfs_read_folio() zeroes folios past valid data and marks them uptodate with folio_mark_uptodate(), updating only the folio flag. That leaves the iomap bitmap out of sync and ifs_free() WARNs during evict when the folio is torn down.
Use iomap_folio_mark_uptodate() to update both the folio uptodate state and the iomap uptodate bitmap.
--- fs/ntfs3/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ntfs3/inode.c +1 -1
@@ -842,7 +842,7 @@ static int ntfs_read_folio(struct file *file, struct folio *folio)if (ni->i_valid <= vbo) {folio_zero_range (folio,0 ,folio_size (folio)); -folio_mark_uptodate (folio); +iomap_folio_mark_uptodate (folio);folio_unlock (folio);return 0 ; }
Signature · 1 line
2.55.0
syzbot
syzbotForwarded: [PATCH] debug: log uptodate states for iomap bug
In reply to syzbotFor archival purposes, forwarding an incoming command email to [email protected], [email protected].
For archival purposes, forwarding an incoming command email to [email protected], [email protected].
***
Subject: [PATCH] debug: log uptodate states for iomap bug
Author: [email protected]
---
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 238650ef6c7c
fs/iomap/buffered-io.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
fs/iomap/buffered-io.c +7 -2
@@ -291,8 +291,13 @@ static void ifs_free(struct folio *folio)return ;WARN_ON_ONCE (ifs->read_bytes_pending !=0 );WARN_ON_ONCE (atomic_read (&ifs->write_bytes_pending)); -WARN_ON_ONCE (ifs_is_fully_uptodate (folio, ifs) != -folio_test_uptodate (folio)); + +bool ifs_up =ifs_is_fully_uptodate (folio, ifs); +bool folio_up =folio_test_uptodate (folio); + +if (WARN_ON_ONCE (ifs_up != folio_up)) +pr_err ("IOMAP DEBUG: ifs_up=%d, folio_up=%d\n" , ifs_up, folio_up); +kfree (ifs); }
Signature · 1 line
2.47.3