From 3ea85fa8861e1fcbc14df828aa1f948ee39c7e6e Mon Sep 17 00:00:00 2001 From: Su Yanjun Date: Tue, 18 Sep 2018 09:17:54 +0800 Subject: [PATCH] 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 Signed-off-by: David Sterba --- cmds-subvolume.c | 4 ++-- 1 file 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; }