提交 706efc66 编写于 作者: L Li Zefan

Btrfs: check the return value of io_ctl_init()

It can return -ENOMEM.
Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
上级 a1ee5a45
...@@ -637,7 +637,10 @@ int __load_free_space_cache(struct btrfs_root *root, struct inode *inode, ...@@ -637,7 +637,10 @@ int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
if (!num_entries) if (!num_entries)
return 0; return 0;
io_ctl_init(&io_ctl, inode, root); ret = io_ctl_init(&io_ctl, inode, root);
if (ret)
return ret;
ret = readahead_cache(inode); ret = readahead_cache(inode);
if (ret) if (ret)
goto out; goto out;
...@@ -851,7 +854,9 @@ int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode, ...@@ -851,7 +854,9 @@ int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
if (!i_size_read(inode)) if (!i_size_read(inode))
return -1; return -1;
io_ctl_init(&io_ctl, inode, root); ret = io_ctl_init(&io_ctl, inode, root);
if (ret)
return -1;
/* Get the cluster for this block_group if it exists */ /* Get the cluster for this block_group if it exists */
if (block_group && !list_empty(&block_group->cluster_list)) if (block_group && !list_empty(&block_group->cluster_list))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册