mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-26 08:02:21 +00:00
btrfs-progs: check option conflict for btrfs-convert
The -d, -i, -n options make no sense to rollback. Check the improper usages such as: # btrfs-convert -r -d <dev> Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
c2d83207bf
commit
2b2337830c
@ -2699,6 +2699,7 @@ int main(int argc, char *argv[])
|
||||
int noxattr = 0;
|
||||
int datacsum = 1;
|
||||
int rollback = 0;
|
||||
int usage_error = 0;
|
||||
char *file;
|
||||
while(1) {
|
||||
int c = getopt(argc, argv, "dinr");
|
||||
@ -2729,6 +2730,17 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (rollback && (!datacsum || noxattr || !packing)) {
|
||||
fprintf(stderr,
|
||||
"Usage error: -d, -i, -n options do not apply to rollback\n");
|
||||
usage_error++;
|
||||
}
|
||||
|
||||
if (usage_error) {
|
||||
print_usage();
|
||||
return 1;
|
||||
}
|
||||
|
||||
file = argv[optind];
|
||||
ret = check_mounted(file);
|
||||
if (ret < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user