diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-07-01 05:27:09 +0300 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-07-08 07:51:48 +0300 |
commit | d7cd3702ca95b1e957493de8f962b47a87b4c6aa (patch) | |
tree | ee45090a4cdc5c660ec6cdbb809c91c849bff499 /fs/f2fs/gc.c | |
parent | b7973091f0b205260fa819f85298f0ae1297cf84 (diff) | |
download | linux-d7cd3702ca95b1e957493de8f962b47a87b4c6aa.tar.xz |
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/f2fs/gc.c')
-rw-r--r-- | fs/f2fs/gc.c | 4 |
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; |