提交 02ecd2c2 编写于 作者: J Josef Bacik 提交者: Chris Mason

Btrfs: do not bug_on if we try to cow a free space cache inode

We can just return an error and we'll bail out properly.  We still want to catch
this case to make sure we don't have a bug somewhere, so just warn if this pops
up.  Thanks,
Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
Signed-off-by: NChris Mason <chris.mason@fusionio.com>
上级 0ef8b726
...@@ -843,7 +843,10 @@ static noinline int cow_file_range(struct inode *inode, ...@@ -843,7 +843,10 @@ static noinline int cow_file_range(struct inode *inode,
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
int ret = 0; int ret = 0;
BUG_ON(btrfs_is_free_space_inode(inode)); if (btrfs_is_free_space_inode(inode)) {
WARN_ON_ONCE(1);
return -EINVAL;
}
num_bytes = ALIGN(end - start + 1, blocksize); num_bytes = ALIGN(end - start + 1, blocksize);
num_bytes = max(blocksize, num_bytes); num_bytes = max(blocksize, num_bytes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册