diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-07-17 00:02:17 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-08-01 11:52:36 -0700 |
commit | 7735730d39d75e70476c1b01435b9b1f41637f0e (patch) | |
tree | 49a25ab3800e55a162c6ad0a87ff8d84e715482b /fs/f2fs/file.c | |
parent | 18dd6470c2d14d10f5a2dd926925dc80dbd3abfd (diff) | |
download | linux-7735730d39d75e70476c1b01435b9b1f41637f0e.tar.gz linux-7735730d39d75e70476c1b01435b9b1f41637f0e.tar.bz2 linux-7735730d39d75e70476c1b01435b9b1f41637f0e.zip |
f2fs: fix to propagate error from __get_meta_page()
If caller of __get_meta_page() can handle error, let's propagate error
from __get_meta_page().
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 5e29d4053748..d41f2138b2a9 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1067,7 +1067,12 @@ static int __clone_blkaddrs(struct inode *src_inode, struct inode *dst_inode, if (ret) return ret; - f2fs_get_node_info(sbi, dn.nid, &ni); + ret = f2fs_get_node_info(sbi, dn.nid, &ni); + if (ret) { + f2fs_put_dnode(&dn); + return ret; + } + ilen = min((pgoff_t) ADDRS_PER_PAGE(dn.node_page, dst_inode) - dn.ofs_in_node, len - i); |