mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-11 03:31:17 +00:00
btrfs-progs: qgroup create: accept only valid qgroupid
Many qgroup commands accept the level/id format and also a path to subvolume, the qgroup id is derived from that. This does not make sense for the create command as we can't create the 0/subvolid qgroup (thus can't be derived from the path), only the higher levels. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
47b04b747d
commit
9be1b1c442
@ -142,7 +142,11 @@ static int _cmd_qgroup_create(int create, int argc, char **argv)
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.create = create;
|
||||
args.qgroupid = parse_qgroupid_or_path(argv[optind]);
|
||||
ret = parse_qgroupid(argv[optind], &args.qgroupid);
|
||||
if (ret < 0) {
|
||||
error("invalid qgroupid %s", argv[optind]);
|
||||
return 1;
|
||||
}
|
||||
path = argv[optind + 1];
|
||||
|
||||
fd = btrfs_open_dir(path, &dirstream, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user