mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
f2fs: fix to do sanity check on node footer in __write_node_folio()
Add node footer sanity check during node folio's writeback, if sanity check fails, let's shutdown filesystem to avoid looping to redirty and writeback in .writepages. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
f7b929eda1
commit
0a736109c9
|
|
@ -1763,7 +1763,11 @@ static bool __write_node_folio(struct folio *folio, bool atomic, bool *submitted
|
|||
|
||||
/* get old block addr of this node page */
|
||||
nid = nid_of_node(folio);
|
||||
f2fs_bug_on(sbi, folio->index != nid);
|
||||
|
||||
if (sanity_check_node_footer(sbi, folio, nid, NODE_TYPE_REGULAR)) {
|
||||
f2fs_handle_critical_error(sbi, STOP_CP_REASON_CORRUPTED_NID);
|
||||
goto redirty_out;
|
||||
}
|
||||
|
||||
if (f2fs_get_node_info(sbi, nid, &ni, !do_balance))
|
||||
goto redirty_out;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user