From: Jaegeuk Kim Date: Sat, 10 Jan 2015 00:27:17 +0000 (-0800) Subject: f2fs: avoid infinite loop on cp_error X-Git-Tag: v4.0-rc1~97^2~31 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=871f599f4a869d24ef98b0217f19f0cc55ff59ac;p=karo-tx-linux.git f2fs: avoid infinite loop on cp_error If cp_error is set, we should avoid all the infinite loop. In f2fs_sync_file, there is a hole, and this patch fixes that. Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 5df336757d6c..710adc987937 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -247,6 +247,10 @@ go_write: sync_nodes: sync_node_pages(sbi, ino, &wbc); + /* if cp_error was enabled, we should avoid infinite loop */ + if (unlikely(f2fs_cp_error(sbi))) + goto out; + if (need_inode_block_update(sbi, ino)) { mark_inode_dirty_sync(inode); f2fs_write_inode(inode, NULL);