Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max file path name supported by libnfs #495

Open
bishnu1184 opened this issue Oct 15, 2024 · 3 comments
Open

Max file path name supported by libnfs #495

bishnu1184 opened this issue Oct 15, 2024 · 3 comments

Comments

@bishnu1184
Copy link

Hi Ronnie,

I would like to know what is the max file path limit supported by libnfs.
As per RFC https://www.rfc-editor.org/rfc/rfc1094.html Max filename limit is 255 and max path limit is 1024.
But when we tested in our environment it look like it failed with following error for file path more than ~250 characters

_Failed to create directory structure: long_path/2024-10-15 09-46-25AM GMT/10.105.140.239/home/nfs_share/baseFolder/SubDirectory1/SubDirectory2/SubDirectory3/SubDirectory4/SubDirectory5/SubDirectory6/SubDirectory7/SubDirectory8/SubDirectory9. Error code :-34 the error message received is mkdir call failed with "NFS4: (path /long_path/2024-10-15 09-46-25AM_GMT/10.105.140.239/home/nfs_share/baseFolder/SubDirectory1/SubDirectory2/SubDirectory3/SubDirectory4/SubDirectory5/SubDirectory6/SubDirectory7/SubDirectory8) failed with NFS4ERR_RESOURCE(-5)"

@sahlberg
Copy link
Owner

sahlberg commented Oct 16, 2024 via email

@bishnu1184
Copy link
Author

Have you got the opportunity to check this ?

@sahlberg
Copy link
Owner

sahlberg commented Oct 20, 2024

Looks like it is working in my tests. Note, these limitations are for the nfs protocol itself. There may be additional length restrictions imposed by the backing filesystems.
Are you testing against windows? I think windows has a ~250 character limitation in its filesystems and that will limit the path sizes for nfs as well.

I tested with a Linux server with EXT4 as the backing filesystem
and I can create individual components that are 255 bytes in size and also directory paths that are longer than 750 characters.

Test of file component that is 255 characters in length:

$ ./utils/nfs-stat nfs://10.10.10.11/data/SNAP-1/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde
File:nfs://10.10.10.11/data/SNAP-1/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde
Size: 4096 Blocks: 8 IO Block: 4096 directory
Inode:266797057 Links 2
Access: (0755/drwxr-xr-x) Uid: ( 0/root) Gid: ( 0/root)
Access: Mon Oct 21 06:47:08 2024
Modify: Mon Oct 21 06:47:08 2024
Change: Mon Oct 21 06:47:08 2024

$ ./examples/nfs-io mkdir nfs://10.10.10.11/data/SNAP-1/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde

Test creating a 255 character long directory name in a 255 character long directory, total path 511 bytes:

./examples/nfs-io mkdir nfs://10.10.10.11/data/SNAP-1/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde

And we can access the 511 bytes long path:
$ ./utils/nfs-stat nfs://10.10.10.11/data/SNAP-1/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde
File:nfs://10.10.10.11/data/SNAP-1/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde
Size: 4096 Blocks: 8 IO Block: 4096 directory
Inode:266797058 Links 2
Access: (0755/drwxr-xr-x) Uid: ( 1000/sahlberg) Gid: ( 1000/sahlberg)
Access: Mon Oct 21 06:53:12 2024
Modify: Mon Oct 21 06:53:12 2024
Change: Mon Oct 21 06:53:12 2024

Test creating a dirctory path that is ~750 bytes long:

$ ./examples/nfs-io mkdir nfs://10.10.10.11/data/SNAP-1/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcde

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants