summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2020-07-01 10:27:09 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2020-07-07 21:51:48 -0700
commitd7cd3702ca95b1e957493de8f962b47a87b4c6aa (patch)
treeee45090a4cdc5c660ec6cdbb809c91c849bff499 /fs
parentb7973091f0b205260fa819f85298f0ae1297cf84 (diff)
downloadlinux-d7cd3702ca95b1e957493de8f962b47a87b4c6aa.tar.bz2
f2fs: fix return value of move_data_block()
If f2fs_grab_cache_page() fails, it needs to return -ENOMEM. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/f2fs/gc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 6eec3b2d606d..9a40761445d3 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -849,8 +849,10 @@ static int move_data_block(struct inode *inode, block_t bidx,
mpage = f2fs_grab_cache_page(META_MAPPING(fio.sbi),
fio.old_blkaddr, false);
- if (!mpage)
+ if (!mpage) {
+ err = -ENOMEM;
goto up_out;
+ }
fio.encrypted_page = mpage;