mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
f2fs: freeze filesystem when fail to update meta page due to IO error
In get_meta_page, we guarantee no failure for the returned page, but sometimes, IO error from device will incur returning an non-updated page. Then, we still use this page as updated one, exception could happen when using this kind of page. So in this condition, we'd better freeze fs by making fs readonly and and stop doing checkpoint. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
5768dcdd7f
commit
f3f338caad
@ -79,6 +79,14 @@ repeat:
|
|||||||
f2fs_put_page(page, 1);
|
f2fs_put_page(page, 1);
|
||||||
goto repeat;
|
goto repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* if there is any IO error when accessing device, make our filesystem
|
||||||
|
* readonly and make sure do not write checkpoint with non-uptodate
|
||||||
|
* meta page.
|
||||||
|
*/
|
||||||
|
if (unlikely(!PageUptodate(page)))
|
||||||
|
f2fs_stop_checkpoint(sbi);
|
||||||
out:
|
out:
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user