aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-01-24 05:56:11 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-02-11 17:15:00 -0500
commit577e349514452fa3fcd99fd06e587b02d3d1cf28 (patch)
treefe4e86d3f56b8050c85b1f5fb76117d6e99c5aa9 /fs/f2fs/f2fs.h
parent7d79e75f6420fc13cfe72554b3ea5afad24c8625 (diff)
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>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index c8e2d751ef9c..f4f509766465 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -929,8 +929,7 @@ void allocate_new_segments(struct f2fs_sb_info *);
929struct page *get_sum_page(struct f2fs_sb_info *, unsigned int); 929struct page *get_sum_page(struct f2fs_sb_info *, unsigned int);
930struct bio *f2fs_bio_alloc(struct block_device *, int); 930struct bio *f2fs_bio_alloc(struct block_device *, int);
931void f2fs_submit_bio(struct f2fs_sb_info *, enum page_type, bool sync); 931void f2fs_submit_bio(struct f2fs_sb_info *, enum page_type, bool sync);
932int write_meta_page(struct f2fs_sb_info *, struct page *, 932void write_meta_page(struct f2fs_sb_info *, struct page *);
933 struct writeback_control *);
934void write_node_page(struct f2fs_sb_info *, struct page *, unsigned int, 933void write_node_page(struct f2fs_sb_info *, struct page *, unsigned int,
935 block_t, block_t *); 934 block_t, block_t *);
936void write_data_page(struct inode *, struct page *, struct dnode_of_data*, 935void write_data_page(struct inode *, struct page *, struct dnode_of_data*,