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@xxxxxxxxxxxxxx>
---
cmds-subvolume.c | 15 ---------------
1 file changed, 15 deletions(-)
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);
--
1.8.1.4
--
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