diff options
author | Chao Yu <yuchao0@huawei.com> | 2016-08-21 23:21:29 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-08-29 18:31:11 -0700 |
commit | e932835377f95c91789c8572a5aaaa9daad5d262 (patch) | |
tree | 0a2f66a5e465646fdbeafa005ded2b475feee289 | |
parent | 58383befc3377b4e2305b98f91e445af73ba8d62 (diff) | |
download | op-kernel-dev-e932835377f95c91789c8572a5aaaa9daad5d262.zip op-kernel-dev-e932835377f95c91789c8572a5aaaa9daad5d262.tar.gz |
f2fs: check return value of write_checkpoint during fstrim
During fstrim, if one of multiple write_checkpoint failed, break off and
return error number to caller.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fs/f2fs/segment.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index a394012..020767c 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1303,6 +1303,8 @@ int f2fs_trim_fs(struct f2fs_sb_info *sbi, struct fstrim_range *range) mutex_lock(&sbi->gc_mutex); err = write_checkpoint(sbi, &cpc); mutex_unlock(&sbi->gc_mutex); + if (err) + break; } out: range->len = F2FS_BLK_TO_BYTES(cpc.trimmed); |