Skip to content

Commit

Permalink
f2fs: avoid infinite loop on cp_error
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jaegeuk Kim committed Feb 12, 2015
1 parent 08e4126 commit 871f599
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
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);
Expand Down

0 comments on commit 871f599

Please sign in to comment.