* [patch 2/2] Btrfs: fix some error codes in btrfs_qgroup_inherit()
@ 2012-07-30 8:16 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-07-30 8:16 UTC (permalink / raw)
To: Chris Mason, Arne Jansen; +Cc: linux-btrfs, kernel-janitors
These are returning zero when it should be returning a negative error
code.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Applies to linux-next.
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index b650155..38b42e7 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1371,8 +1371,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;
@@ -1381,8 +1383,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) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-30 8:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 8:16 [patch 2/2] Btrfs: fix some error codes in btrfs_qgroup_inherit() Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).