mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-27 16:42:17 +00:00
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>
This commit is contained in:
parent
23eed7acfd
commit
3ea85fa886
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user