Skip to contentSkip to conversation

common/attr: remove the MAX_ATTRS and MAX_ATTRVAL_SIZE for nfs

PATCH In review Hao Xu 3 participants 3 messages Aug 4, 2021 – Aug 8, 2021

Subsystems (2)
lore
Share & tools
lore

Hao Xu

author
#0 lore raw

PATCH 1/1 common/attr: remove the MAX_ATTRS and MAX_ATTRVAL_SIZE for nfs

The block size of localfs for nfs may be different with nfs itself. So it's pointless to test nfs on xattrs size, just remove the special judge code.

Fixes commit da3cdb3b91ca ("common/attr: set MAX_ATTR values correctly for NFS")
---
 common/attr | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/attr +2 -2
index 42ceab92335a..542dff34bf55 100644
@@ -253,7 +253,7 @@ _getfattr()
 
 # set maximum total attr space based on fs type
 case "$FSTYP" in
-xfs|udf|pvfs2|9p|ceph|nfs)
+xfs|udf|pvfs2|9p|ceph)
 	MAX_ATTRS=1000
 	;;
 *)
@@ -273,7 +273,7 @@ xfs|udf|btrfs)
 pvfs2)
 	MAX_ATTRVAL_SIZE=8192
 	;;
-9p|ceph|nfs)
+9p|ceph)
 	MAX_ATTRVAL_SIZE=65536
 	;;
 bcachefs)
Signature · 1 line
2.24.4
#1 lore raw
Quoted 33 lines · Hao Xu

The block size of localfs for nfs may be different with nfs itself. So it's pointless to test nfs on xattrs size, just remove the special judge code.

Fixes commit da3cdb3b91ca ("common/attr: set MAX_ATTR values correctly for NFS")
---
 common/attr | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/attr +2 -3
index 42ceab92335a..542dff34bf55 100644
@@ -253,7 +253,7 @@ _getfattr()
 
 # set maximum total attr space based on fs type
 case "$FSTYP" in
-xfs|udf|pvfs2|9p|ceph|nfs)
+xfs|udf|pvfs2|9p|ceph)
        MAX_ATTRS=1000
        ;;
 *)
@@ -273,7 +273,7 @@ xfs|udf|btrfs)
 pvfs2)
        MAX_ATTRVAL_SIZE=8192
        ;;
-9p|ceph|nfs)
+9p|ceph)
        MAX_ATTRVAL_SIZE=65536
        ;;
 bcachefs)
--
Quoted 2 lines

2.24.4

That doesn't quite work either, right? You have now removed the specific values set for NFS, but the defaults will still be used (which may also be wrong).

It seems to me that there are two ways that this can be dealt with:

1) Find a way to determine the maximum attribute size over an NFS mount, possibly by trying different sizes. If it doesn't work out, skip the test
2) Always skip the test.

- Frank

#2 lore raw
In reply to Hao Xu
Quoted 15 lines · Hao Xu

The block size of localfs for nfs may be different with nfs itself. So it's pointless to test nfs on xattrs size, just remove the special judge code.

Fixes commit da3cdb3b91ca ("common/attr: set MAX_ATTR values correctly for NFS")
---
 common/attr | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/attr +0 -0
index 42ceab92335a..542dff34bf55 100644

common/attr _getfattr() · line 257

Quoted 6 lines
common/attr +1 -1
@@ -253,7 +253,7 @@ _getfattr()
 
 # set maximum total attr space based on fs type
 case "$FSTYP" in
-xfs|udf|pvfs2|9p|ceph|nfs)
+xfs|udf|pvfs2|9p|ceph)
 	MAX_ATTRS=1000

This makes generic/020 _notrun on nfs, I don't think that's what we want.

I think MAX_ATTRS is a best-effort guess based on filesystem block size, it's not a accurate hard limit. And if there's no good way to tell the fs blocksize on nfs server side, then we could make a conservative assumption, e.g. the blocksize is 1k, and colculate MAX_ATTRS and MAX_ATTRVAL_SIZE based on that assumption.

Thanks,
Eryu

Quoted 13 lines
common/attr +1 -1
 	;;
 *)
@@ -273,7 +273,7 @@ xfs|udf|btrfs)
 pvfs2)
 	MAX_ATTRVAL_SIZE=8192
 	;;
-9p|ceph|nfs)
+9p|ceph)
 	MAX_ATTRVAL_SIZE=65536
 	;;
 bcachefs)
Signature · 1 line
2.24.4