[PATCH 5/6] Btrfs-progs: btrfs-restore, don't allow users to specify -r and -f at the same time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These two options are used for same purpose, but they are exclusive with
each other. Make it clear to common users.

Signed-off-by: Wang Shilong <wangsl.fnst@xxxxxxxxxxxxxx>
---
 cmds-restore.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cmds-restore.c b/cmds-restore.c
index 8267ab6..3a29ed6 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -1212,6 +1212,11 @@ int cmd_restore(int argc, char **argv)
 	else if (list_roots && optind >= argc)
 		usage(cmd_restore_usage);
 
+	if (fs_location && root_objectid) {
+		fprintf(stderr, "don't use -f and -r at the same time.\n");
+		return 1;
+	}
+
 	if ((ret = check_mounted(argv[optind])) < 0) {
 		fprintf(stderr, "Could not check mount status: %s\n",
 			strerror(-ret));
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux