Skip to content

Commit

Permalink
f2fs: hanlde error case in f2fs_ioc_shutdown
Browse files Browse the repository at this point in the history
This patch makes f2fs_ioc_shutdown handling error case correctly.

Signed-off-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
chaseyu authored and Jaegeuk Kim committed Jan 22, 2018
1 parent bb9e3bb commit d027c48
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions fs/f2fs/file.c
Original file line number Diff line number Diff line change
@@ -1839,14 +1839,20 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg)
switch (in) {
case F2FS_GOING_DOWN_FULLSYNC:
sb = freeze_bdev(sb->s_bdev);
if (sb && !IS_ERR(sb)) {
if (IS_ERR(sb)) {
ret = PTR_ERR(sb);
goto out;
}
if (sb) {
f2fs_stop_checkpoint(sbi, false);
thaw_bdev(sb->s_bdev, sb);
}
break;
case F2FS_GOING_DOWN_METASYNC:
/* do checkpoint only */
f2fs_sync_fs(sb, 1);
ret = f2fs_sync_fs(sb, 1);
if (ret)
goto out;
f2fs_stop_checkpoint(sbi, false);
break;
case F2FS_GOING_DOWN_NOSYNC:

0 comments on commit d027c48

Please sign in to comment.