[PATCH] fs: fserror: avoid igrab in atomic contexts
From: Arnav Kapoor
Date: Sat Feb 14 2026 - 12:35:00 EST
fserror_report() can be called from softirq/atomic contexts. Using
igrab() there takes i_lock, which is also acquired with softirqs enabled
in process context, triggering lockdep warnings and a potential softirq
recursion deadlock.
All fserror_report() callers already hold a live reference to the inode,
so use ihold() to take a safe reference without grabbing i_lock.
Reported-by: syzbot+5eb0d61dfb76ca12670c@xxxxxxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Arnav Kapoor <arnav@xxxxxxxxxxx>
---
fs/fserror.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/fs/fserror.c b/fs/fserror.c
index 0123456789ab..fedcba987654 100644
--- a/fs/fserror.c
+++ b/fs/fserror.c
@@ -159,16 +159,13 @@ void fserror_report(struct super_block *sb, struct
inode *inode,
event->len = len;
event->error = error;
/*
- * Can't iput from non-sleeping context, so grabbing another reference
- * to the inode must be the last thing before submitting the event.
+ * Can't iput from non-sleeping context, so grabbing another reference
+ * to the inode must be the last thing before submitting the event.
+ * The caller must hold a live reference if @inode is provided.
*/
if (inode) {
- event->inode = igrab(inode);
- if (!event->inode)
- goto lost_event;
+ ihold(inode);
+ event->inode = inode;
}
/*
@@ -184,9 +181,7 @@ void fserror_report(struct super_block *sb, struct
inode *inode,
schedule_work(&event->work);
return;
-lost_event:
- fserror_free_event(event);
lost:
if (inode)
pr_err_ratelimited("%s: lost file I/O error report for ino %lu
type %u pos 0x%llx len 0x%llx error %d",
--
2.43.0
On Saturday, 14 February 2026 at 17:32:10 UTC+5:30 syzbot wrote:
Hello,
syzbot tried to test the proposed patch but the build/boot failed:
failed to apply patch:
checking file fs/fserror.c
patch: **** unexpected end of file in patch
Tested on:
commit: 770aaedb Merge tag 'bootconfig-v7.0' of git://git.kern..
git tree: upstream
kernel config: https://syzkaller.appspot.com/x/.config?x=e600149b13c010eb
dashboard link: https://syzkaller.appspot.com/bug?extid=5eb0d61dfb76ca12670c
compiler:
patch: https://syzkaller.appspot.com/x/patch.diff?x=15adac02580000