libnfs icon indicating copy to clipboard operation
libnfs copied to clipboard

Max file path name supported by libnfs

Open bishnu1184 opened this issue 1 year ago • 3 comments

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)"

bishnu1184 avatar Oct 15 '24 10:10 bishnu1184

I will have a look at this tomorrow. Please keep reminding me if I forget.

On Tue, 15 Oct 2024 at 20:47, bishnu1184 @.***> wrote:

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 http://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 http://10.105.140.239/home/nfs_share/baseFolder/SubDirectory1/SubDirectory2/SubDirectory3/SubDirectory4/SubDirectory5/SubDirectory6/SubDirectory7/SubDirectory8) failed with NFS4ERR_RESOURCE(-5)"

— Reply to this email directly, view it on GitHub https://github.com/sahlberg/libnfs/issues/495, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADY3EC3XLKPS66NAGX3GGTZ3TXDVAVCNFSM6AAAAABP63FOZKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DQMZXHAZDSNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sahlberg avatar Oct 16 '24 00:10 sahlberg

Have you got the opportunity to check this ?

bishnu1184 avatar Oct 18 '24 10:10 bishnu1184

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

sahlberg avatar Oct 20 '24 21:10 sahlberg

Works here. Limit is likely in the backing filesystem on the server.

sahlberg avatar Dec 18 '24 20:12 sahlberg