Message ID | 1418873555-4530-1-git-send-email-guihc.fnst@cn.fujitsu.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 53eec46..a35e2ad 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -281,21 +281,6 @@ again: vname = basename(dupvname); free(cpath); - if (!test_issubvolname(vname)) { - fprintf(stderr, "ERROR: incorrect subvolume name '%s'\n", - vname); - ret = 1; - goto out; - } - - len = strlen(vname); - if (len == 0 || len >= BTRFS_VOL_NAME_MAX) { - fprintf(stderr, "ERROR: snapshot name too long '%s'\n", - vname); - ret = 1; - goto out; - } - fd = open_file_or_dir(dname, &dirstream); if (fd < 0) { fprintf(stderr, "ERROR: can't access '%s'\n", dname);
When we want to delete a subvol, we first check to see whether it is a subvolume or not. After the check, we are sure that it is a valid subvol, don't have to check its name. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> --- cmds-subvolume.c | 15 --------------- 1 file changed, 15 deletions(-)