Skip to contentSkip to conversation

btrfs-progs: qgroup: Don't return 1 if qgroup is marked inconsistent during relationship assignment

PATCH Applied Qu Wenruo 2 participants 2 messages Aug 10, 2018 – Sep 11, 2018 Btrfs file system

lore
Share & tools
lore

Qu Wenruo

author
#0 lore raw

PATCH 1/1 btrfs-progs: qgroup: Don't return 1 if qgroup is marked inconsistent during relationship assignment

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.

---
 cmds-qgroup.c | 1 +
 1 file changed, 1 insertion(+)
cmds-qgroup.c +1 -0
index b928edc7c408..7234bdc17bb4 100644
@@ -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);
Signature · 1 line
2.18.0
Applied
#1 lore raw
Quoted 9 lines · Qu Wenruo

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.

Applied, thanks.