From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] btrfs-progs: qgroup: Don't return 1 if qgroup is marked inconsistent during relationship assignment
Date: Fri, 10 Aug 2018 10:34:06 +0800 [thread overview]
Message-ID: <20180810023406.30303-1-wqu@suse.com> (raw)
BTRFS_IOC_QGROUP_ASSIGN ioctl could return >0 if qgroup is marked
inconsistent after successful relationship assignment/removal.
We leak the return value as the final return value of btrfs command.
But according to the man page, return value other than 0 means failure.
Fix this by resetting the return value to 0 for --no-rescan case.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
cmds-qgroup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/cmds-qgroup.c b/cmds-qgroup.c
index b928edc7c408..7234bdc17bb4 100644
--- a/cmds-qgroup.c
+++ b/cmds-qgroup.c
@@ -123,6 +123,7 @@ static int _cmd_qgroup_assign(int assign, int argc, char **argv,
error("quota rescan failed: %m");
} else {
warning("quotas may be inconsistent, rescan needed");
+ ret = 0;
}
}
close_file_or_dir(fd, dirstream);
--
2.18.0
next reply other threads:[~2018-08-10 5:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-10 2:34 Qu Wenruo [this message]
2018-09-11 16:46 ` [PATCH] btrfs-progs: qgroup: Don't return 1 if qgroup is marked inconsistent during relationship assignment David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180810023406.30303-1-wqu@suse.com \
--to=wqu@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).