Re: [PATCH] common/attr: fix the MAX_ATTRS and MAX_ATTRVAL_SIZE for nfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



在 2021/7/30 下午10:01, Eryu Guan 写道:
[cc linux-nfs for review]

On Fri, Jul 30, 2021 at 08:42:52PM +0800, Hao Xu wrote:
The block size of localfs for nfs may be much smaller than nfs itself.
So we'd better set MAX_ATTRS and MAX_ATTRVAL_SIZE to 4096 to avoid
'no space' error when we test adding a bunch of xattrs to nfs.

Signed-off-by: Hao Xu <haoxu@xxxxxxxxxxxxxxxxx>

Since the xattr support is relatively new (merged a year ago for
NFSv4.2), I'd like nfs folks to take a look as well.

---

It's better to set BLOCK_SIZE to `_get_block_size $variable`
here $variable is the localfs for nfs, since I'm not familiar with
xfstests, anyone tell what's the name of it.

fstests doesn't know the exported filesystem under NFS, so I don't think
we could the block size of it.


  common/attr | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/common/attr b/common/attr
index 42ceab92335a..a833f00e0884 100644
--- a/common/attr
+++ b/common/attr
@@ -253,9 +253,13 @@ _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
  	;;
+nfs)
+	BLOCK_SIZE=4096
+	let MAX_ATTRS=$BLOCK_SIZE/40
+	;;
  *)
  	# Assume max ~1 block of attrs
  	BLOCK_SIZE=`_get_block_size $TEST_DIR`
@@ -273,12 +277,15 @@ xfs|udf|btrfs)
  pvfs2)
  	MAX_ATTRVAL_SIZE=8192
  	;;
-9p|ceph|nfs)
+9p|ceph)
  	MAX_ATTRVAL_SIZE=65536
  	;;
  bcachefs)
  	MAX_ATTRVAL_SIZE=1024
  	;;
+nfs)
+	MAX_ATTRVAL_SIZE=3840
+	;;

Where does this value come from?

3840 = 4096 - 256, which is like the case of *)
Thanks,
Eryu

  *)
  	# Assume max ~1 block of attrs
  	BLOCK_SIZE=`_get_block_size $TEST_DIR`
--
2.24.4




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux