summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-30 02:16:10 -0600
committerChris Mason <chris.mason@oracle.com>2012-08-28 16:53:24 -0400
commit5986802c2fcc754040bb7ed95f30bb16c4a843b7 (patch)
treefb9a0d1054a0e345bd6c30fabc7d3726fdf6e2c5
parentaa2ffd06168e25689e0eb9662bf4595ba2bbac14 (diff)
downloadlinux-stable-5986802c2fcc754040bb7ed95f30bb16c4a843b7.tar.gz
linux-stable-5986802c2fcc754040bb7ed95f30bb16c4a843b7.tar.bz2
linux-stable-5986802c2fcc754040bb7ed95f30bb16c4a843b7.zip
Btrfs: fix some error codes in btrfs_qgroup_inherit()
These are returning zero when it should be returning a negative error code. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
-rw-r--r--fs/btrfs/qgroup.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index bc424ae5a81a..229ef8927e6b 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1369,8 +1369,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
if (srcid) {
srcgroup = find_qgroup_rb(fs_info, srcid);
- if (!srcgroup)
+ if (!srcgroup) {
+ ret = -EINVAL;
goto unlock;
+ }
dstgroup->rfer = srcgroup->rfer - level_size;
dstgroup->rfer_cmpr = srcgroup->rfer_cmpr - level_size;
srcgroup->excl = level_size;
@@ -1379,8 +1381,10 @@ int btrfs_qgroup_inherit(struct btrfs_trans_handle *trans,
qgroup_dirty(fs_info, srcgroup);
}
- if (!inherit)
+ if (!inherit) {
+ ret = -EINVAL;
goto unlock;
+ }
i_qgroups = (u64 *)(inherit + 1);
for (i = 0; i < inherit->num_qgroups; ++i) {