]> git.ipfire.org Git - thirdparty/linux.git/commit
f2fs: avoid false shutdown fserror reports
authorWenjie Qi <qwjhust@gmail.com>
Thu, 21 May 2026 10:37:48 +0000 (18:37 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 22 Jun 2026 19:52:35 +0000 (19:52 +0000)
commit484c84ecc1a497d09239ca3a12dff3cc832830ce
tree962a1f5560ff6202e35881ebd0503471c4964e27
parent5073c66a96a9c23c0c2533ed4ed06e42f9021208
f2fs: avoid false shutdown fserror reports

F2FS records image errors and checkpoint-stop reasons through the same
s_error_work worker.  The ordinary f2fs_handle_error() path only updates
s_errors, but the worker still calls fserror_report_shutdown()
unconditionally after committing the superblock.

As a result, a metadata corruption report can be followed by a synthetic
FAN_FS_ERROR event with ESHUTDOWN and an invalid superblock file handle,
even though no stop reason was recorded.

Track whether save_stop_reason() actually changed the stop_reason array
and only report the shutdown fserror for that case.  Pure s_errors updates
still commit the superblock, but no longer generate a false shutdown event.

Fixes: 50faed607d32 ("f2fs: support to report fserror")
Cc: stable@kernel.org
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Wenjie Qi <qiwenjie@xiaomi.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/super.c