aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>2014-12-18 11:32:35 +0800
committerDavid Sterba <dsterba@suse.cz>2015-01-14 18:34:04 +0100
commit3d47cc9ae17d939b9ad870a9f337f9c9f86d70d6 (patch)
tree006cb2b13b00d46fef62e031cfd030260a0df347 /cmds-subvolume.c
parent6eafa191c09f141831dcd77e7b9241d41fb35680 (diff)
downloadbtrfs-progs-3d47cc9ae17d939b9ad870a9f337f9c9f86d70d6.tar.gz
btrfs-progs-3d47cc9ae17d939b9ad870a9f337f9c9f86d70d6.tar.xz
btrfs-progs-3d47cc9ae17d939b9ad870a9f337f9c9f86d70d6.zip
btrfs-progs: remove uneccessary subvol name check for subvol deletion
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> [removed unused variable 'len'] Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 9618cae..3895d11 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -208,7 +208,7 @@ static const char * const cmd_subvol_delete_usage[] = {
static int cmd_subvol_delete(int argc, char **argv)
{
- int res, len, e, ret = 0;
+ int res, e, ret = 0;
int cnt;
int fd = -1;
struct btrfs_ioctl_vol_args args;
@@ -287,21 +287,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);