linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: qgroup: Don't return 1 if qgroup is marked inconsistent during relationship assignment
@ 2018-08-10  2:34 Qu Wenruo
  2018-09-11 16:46 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Qu Wenruo @ 2018-08-10  2:34 UTC (permalink / raw)
  To: linux-btrfs

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs-progs: qgroup: Don't return 1 if qgroup is marked inconsistent during relationship assignment
  2018-08-10  2:34 [PATCH] btrfs-progs: qgroup: Don't return 1 if qgroup is marked inconsistent during relationship assignment Qu Wenruo
@ 2018-09-11 16:46 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2018-09-11 16:46 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Fri, Aug 10, 2018 at 10:34:06AM +0800, Qu Wenruo wrote:
> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-11 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10  2:34 [PATCH] btrfs-progs: qgroup: Don't return 1 if qgroup is marked inconsistent during relationship assignment Qu Wenruo
2018-09-11 16:46 ` David Sterba

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).