summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSu Yanjun <suyj.fnst@cn.fujitsu.com>2018-09-18 09:17:54 +0800
committerDavid Sterba <dsterba@suse.com>2018-10-25 16:11:40 +0200
commit3ea85fa8861e1fcbc14df828aa1f948ee39c7e6e (patch)
treeab8dbbe3d5faddaf34ace22819ea19c9399f48b1
parent23eed7acfdc61f257da6744329dc5dbbb2da4493 (diff)
btrfs-progs: change filename limit to 255 when creating subvolume
Modify the file name length limit to meet the Linux naming convention. In addition, the file name length is always bigger than 0, no need to compare with 0 again. Issue: #145 Signed-off-by: Su Yanjun <suyj.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--cmds-subvolume.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index e7a884af..5a446c1a 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -155,7 +155,7 @@ static int cmd_subvol_create(int argc, char **argv)
}
len = strlen(newname);
- if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
+ if (len > BTRFS_VOL_NAME_MAX) {
error("subvolume name too long: %s", newname);
goto out;
}
@@ -715,7 +715,7 @@ static int cmd_subvol_snapshot(int argc, char **argv)
}
len = strlen(newname);
- if (len == 0 || len >= BTRFS_VOL_NAME_MAX) {
+ if (len > BTRFS_VOL_NAME_MAX) {
error("snapshot name too long '%s'", newname);
goto out;
}