You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
f2fs: prevent checkpoint once any IO failure is detected
This patch enhances the checkpoint routine to cope with IO errors. Basically f2fs detects IO errors from end_io_write, and the errors are able to be occurred during one of data, node, and meta page writes. In the previous code, when an IO error is occurred during writes, f2fs sets a flag, CP_ERROR_FLAG, in the raw ckeckpoint buffer which will be written to disk. Afterwards, write_checkpoint() will check the flag and remount f2fs as a read-only (ro) mode. However, even once f2fs is remounted as a ro mode, dirty checkpoint pages are freely able to be written to disk by flusher or kswapd in background. In such a case, after cold reboot, f2fs would restore the checkpoint data having CP_ERROR_FLAG, resulting in disabling write_checkpoint and remounting f2fs as a ro mode again. Therefore, let's prevent any checkpoint page (meta) writes once an IO error is occurred, and remount f2fs as a ro mode right away at that moment. Reported-by: Oliver Winker <oliver@oli1170.net> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com> Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
This commit is contained in:
+1
-2
@@ -929,8 +929,7 @@ void allocate_new_segments(struct f2fs_sb_info *);
|
||||
struct page *get_sum_page(struct f2fs_sb_info *, unsigned int);
|
||||
struct bio *f2fs_bio_alloc(struct block_device *, int);
|
||||
void f2fs_submit_bio(struct f2fs_sb_info *, enum page_type, bool sync);
|
||||
int write_meta_page(struct f2fs_sb_info *, struct page *,
|
||||
struct writeback_control *);
|
||||
void write_meta_page(struct f2fs_sb_info *, struct page *);
|
||||
void write_node_page(struct f2fs_sb_info *, struct page *, unsigned int,
|
||||
block_t, block_t *);
|
||||
void write_data_page(struct inode *, struct page *, struct dnode_of_data*,
|
||||
|
||||
Reference in New Issue
Block a user