common/attr: _acl_get_max echo 532 for f2fs
PATCH 1/1 common/attr: _acl_get_max echo 532 for f2fs
Run generic/026 on f2fs, the diff:
-chacl: cannot set access acl on "largeaclfile": Argument list too long +Wrong ACL count - 532 != 531
The ACL_MAX_ENTRIES depend on MAX_VALUE_LEN(inode), MAX_VALUE_LEN(inode) I got by printk is 4244, so I think the ACL_MAX_ENTRIES should be
(4244 - 20) / 8 + 4 =532.
--- common/attr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/attr +1 -1
@@ -28,7 +28,7 @@ _acl_get_max() f2fs) _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 if [ $? -eq 0 ]; then - echo 531 + echo 532 else echo 506 fi
Signature · 1 line
2.13.6
Quoted 10 lines · Sun Ke
Run generic/026 on f2fs, the diff:
-chacl: cannot set access acl on "largeaclfile": Argument list too long +Wrong ACL count - 532 != 531
The
ACL_MAX_ENTRIESdepend onMAX_VALUE_LEN(inode),MAX_VALUE_LEN(inode)I got by printk is 4244, so I think theACL_MAX_ENTRIESshould be
(4244 - 20) / 8 + 4 =532.Signed-off-by Sun Ke <[email protected]>
FYI:
https://patchwork.kernel.org/project/fstests/patch/[email protected]/
I've update the patch based on Jaegeuk's comments, however, I forgot to send it to mailing list, so could you please check revised one below?
From 68965c837fd04795064b352589e3f7005e6d75f5 Mon Sep 17 00:00:00 2001
From: Chao Yu <[email protected]>
Date: Fri, 28 Apr 2017 20:51:11 +0800
Subject: [PATCH v2] attr: adbjust acl_max of f2fs
f2fs has set inline_xattr as a default option, and introduced a new option named 'noinline_xattr' for disabling default inline_xattr option. So in _acl_get_max we need to check 'noinline_xattr' string in fs option, otherwise we may select the wrong max acl number since we always found the string 'inline_xattr' in fs option.
Additionally, f2fs has changed disk layout of xattr block a bit, so will contain one more entry in both inline and noinline xattr inode, this patch will modify the max acl number to adjust it.
---
v2:
- adjust the config for old kernel as well.
common/attr | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
common/attr +8 -3
@@ -26,11 +26,16 @@ _acl_get_max() echo 8191 ;; f2fs) - _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + _fs_options $TEST_DEV | grep "noinline_xattr" >/dev/null 2>&1 if [ $? -eq 0 ]; then - echo 531 + echo 507 else - echo 506 + _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo 532 + else + echo 507 + fi fi ;; bcachefs)
Signature · 1 line
2.32.0
Quoted 54 lines · Chao Yu
Quoted 10 lines · Sun Ke
Run generic/026 on f2fs, the diff:
-chacl: cannot set access acl on "largeaclfile": Argument list too long +Wrong ACL count - 532 != 531
The
ACL_MAX_ENTRIESdepend onMAX_VALUE_LEN(inode),MAX_VALUE_LEN(inode)I got by printk is 4244, so I think theACL_MAX_ENTRIESshould be
(4244 - 20) / 8 + 4 =532.Signed-off-by Sun Ke <[email protected]>FYI:
https://patchwork.kernel.org/project/fstests/patch/[email protected]/
I've update the patch based on Jaegeuk's comments, however, I forgot to send it to mailing list, so could you please check revised one below?
From
68965c837fd04795064b352589e3f7005e6d75f5Mon Sep 17 00:00:00 2001
From: Chao Yu <[email protected]>
Date: Fri, 28 Apr 2017 20:51:11 +0800
Subject: [PATCH v2] attr: adbjustacl_maxof f2fsf2fs has set
inline_xattras a default option, and introduced a new option named 'noinline_xattr' for disabling defaultinline_xattroption. So in_acl_get_maxwe need to check 'noinline_xattr' string in fs option, otherwise we may select the wrong max acl number since we always found the string 'inline_xattr' in fs option.Additionally, f2fs has changed disk layout of xattr block a bit, so will contain one more entry in both inline and noinline xattr inode, this patch will modify the max acl number to adjust it.
Signed-off-by Chao Yu <[email protected]>---
v2:
- adjust the config for old kernel as well.common/attr | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)common/attr +2
-2@@ -26,11 +26,16 @@ _acl_get_max() echo 8191 ;; f2fs) - _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + _fs_options $TEST_DEV | grep "noinline_xattr" >/dev/null 2>&1 if [ $? -eq 0 ]; then - echo 531 + echo 507
common/attr _acl_get_max() · line 40
Quoted 10 lines
common/attr +6
-1else - echo 506 + _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo 532 + else + echo 507 + fi fi ;;
Can you add a comment that explains how these numbers were calculated? They seem very random.
- Eric
Quoted 60 lines · Eric Biggers
Quoted 59 lines · Chao Yu
Quoted 10 lines · Sun Ke
Run generic/026 on f2fs, the diff:
-chacl: cannot set access acl on "largeaclfile": Argument list too long +Wrong ACL count - 532 != 531
The
ACL_MAX_ENTRIESdepend onMAX_VALUE_LEN(inode),MAX_VALUE_LEN(inode)I got by printk is 4244, so I think theACL_MAX_ENTRIESshould be
(4244 - 20) / 8 + 4 =532.Signed-off-by Sun Ke <[email protected]>FYI:
https://patchwork.kernel.org/project/fstests/patch/[email protected]/
I've update the patch based on Jaegeuk's comments, however, I forgot to send it to mailing list, so could you please check revised one below?
From
68965c837fd04795064b352589e3f7005e6d75f5Mon Sep 17 00:00:00 2001
From: Chao Yu <[email protected]>
Date: Fri, 28 Apr 2017 20:51:11 +0800
Subject: [PATCH v2] attr: adbjustacl_maxof f2fsf2fs has set
inline_xattras a default option, and introduced a new option named 'noinline_xattr' for disabling defaultinline_xattroption. So in_acl_get_maxwe need to check 'noinline_xattr' string in fs option, otherwise we may select the wrong max acl number since we always found the string 'inline_xattr' in fs option.Additionally, f2fs has changed disk layout of xattr block a bit, so will contain one more entry in both inline and noinline xattr inode, this patch will modify the max acl number to adjust it.
Signed-off-by Chao Yu <[email protected]>---
v2:
- adjust the config for old kernel as well.common/attr | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)common/attr +5
-3@@ -26,11 +26,16 @@ _acl_get_max() echo 8191 ;; f2fs) - _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + _fs_options $TEST_DEV | grep "noinline_xattr" >/dev/null 2>&1 if [ $? -eq 0 ]; then - echo 531 + echo 507 else - echo 506 + _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo 532
Quoted 8 lines
common/attr _acl_get_max() · line 40
Quoted 5 lines
common/attr +3
-0+ else + echo 507 + fi fi ;;Can you add a comment that explains how these numbers were calculated? They seem very random.
I guess Sun Ke has given a good example...
If inline_xattr is enabled, max xattr size should be:
(4096 - 24 + 200) - (24 + 4) = 4244
then ACL_MAX_ENTRIES should be:
(4244 - (4 + 4 * 4)) / 8 + 4 = 532
Otherwise, if noinline_xattr is enabled, max xattr size should be:
(4096 - 24) - (24 + 4) = 4044
then ACL_MAX_ENTRIES should be:
(4044 - (4 + 4 * 4)) / 8 + 4 = 507
+Cc f2fs mailing list.
Thanks,
Quoted 2 lines
- Eric
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Quoted 56 lines · Chao Yu
Quoted 10 lines · Sun Ke
Run generic/026 on f2fs, the diff:
-chacl: cannot set access acl on "largeaclfile": Argument list too long +Wrong ACL count - 532 != 531
The
ACL_MAX_ENTRIESdepend onMAX_VALUE_LEN(inode),MAX_VALUE_LEN(inode)I got by printk is 4244, so I think theACL_MAX_ENTRIESshould be
(4244 - 20) / 8 + 4 =532.Signed-off-by Sun Ke <[email protected]>FYI:
https://patchwork.kernel.org/project/fstests/patch/[email protected]/
I've update the patch based on Jaegeuk's comments, however, I forgot to send it to mailing list, so could you please check revised one below?
From
68965c837fd04795064b352589e3f7005e6d75f5Mon Sep 17 00:00:00 2001
From: Chao Yu <[email protected]>
Date: Fri, 28 Apr 2017 20:51:11 +0800
Subject: [PATCH v2] attr: adbjustacl_maxof f2fsf2fs has set
inline_xattras a default option, and introduced a new option named 'noinline_xattr' for disabling defaultinline_xattroption. So in_acl_get_maxwe need to check 'noinline_xattr' string in fs option, otherwise we may select the wrong max acl number since we always found the string 'inline_xattr' in fs option.Additionally, f2fs has changed disk layout of xattr block a bit, so will contain one more entry in both inline and noinline xattr inode, this patch will modify the max acl number to adjust it.
Signed-off-by Chao Yu <[email protected]>---
v2:
- adjust the config for old kernel as well.common/attr | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)common/attr +2
-2@@ -26,11 +26,16 @@ _acl_get_max() echo 8191 ;; f2fs) - _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + _fs_options $TEST_DEV | grep "noinline_xattr" >/dev/null 2>&1 if [ $? -eq 0 ]; then - echo 531 + echo 507 else
common/attr _acl_get_max() · line 41
Quoted 10 lines
common/attr +6
-1- echo 506 + _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo 532 + else + echo 507 + fi fi ;; bcachefs)
Sorry for reply late.
I send a v2 patch base on your patch, right?
Thanks,
Sun Ke
Quoted 75 lines · Sun Ke
Quoted 59 lines · Chao Yu
Quoted 6 lines · Sun Ke
Run generic/026 on f2fs, the diff:
-chacl: cannot set access acl on "largeaclfile": Argument list
too long
+Wrong ACL count - 532 != 531Quoted 6 lines
The
ACL_MAX_ENTRIESdepend onMAX_VALUE_LEN(inode),MAX_VALUE_LEN(inode)I got
by printk is 4244, so I think theACL_MAX_ENTRIESshould be (4244 - 20) / 8 + 4 =532.Signed-off-by Sun Ke <[email protected]>FYI:
https://patchwork.kernel.org/project/fstests/patch/[email protected]/
I've update the patch based on Jaegeuk's comments, however, I forgot to send it to
mailing list, so could you please check revised one below?From
68965c837fd04795064b352589e3f7005e6d75f5Mon Sep 17 00:00:00 2001
From: Chao Yu <[email protected]>
Date: Fri, 28 Apr 2017 20:51:11 +0800
Subject: [PATCH v2] attr: adbjustacl_maxof f2fsf2fs has set
inline_xattras a default option, and introduced a new option named 'noinline_xattr' for disabling defaultinline_xattroption. So in_acl_get_maxwe need to check 'noinline_xattr' string in fs option, otherwise we may select the wrong max acl number since we always found the string 'inline_xattr' in fs option.Additionally, f2fs has changed disk layout of xattr block a bit, so will contain one more entry in both inline and noinline xattr inode, this patch will modify the max acl number to adjust it.
Signed-off-by Chao Yu <[email protected]>---
v2:
- adjust the config for old kernel as well.common/attr | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)common/attr +2
-2@@ -26,11 +26,16 @@ _acl_get_max() echo 8191 ;; f2fs) - _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + _fs_options $TEST_DEV | grep "noinline_xattr" >/dev/null 2>&1 if [ $? -eq 0 ]; then - echo 531 + echo 507 elsecommon/attr _acl_get_max() · line 41
Quoted 10 lines
common/attr +6
-1- echo 506 + _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1 + if [ $? -eq 0 ]; then + echo 532 + else + echo 507 + fi fi ;; bcachefs)Sorry for reply late.
Quoted 1 line
I send a v2 patch base on your patch, right?
Yes.
Thanks,
Quoted 3 lines
Thanks,
Sun Ke