* [PATCH] common/attr: _acl_get_max echo 532 for f2fs
@ 2022-01-30 9:28 Sun Ke
2022-01-30 15:07 ` Chao Yu
0 siblings, 1 reply; 7+ messages in thread
From: Sun Ke @ 2022-01-30 9:28 UTC (permalink / raw)
To: fstests, guan; +Cc: chao, sunke32
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.
Signed-off-by: Sun Ke <sunke32@huawei.com>
---
common/attr | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/attr b/common/attr
index 35682d7c..56ac5cca 100644
--- a/common/attr
+++ b/common/attr
@@ -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
--
2.13.6
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] common/attr: _acl_get_max echo 532 for f2fs
2022-01-30 9:28 [PATCH] common/attr: _acl_get_max echo 532 for f2fs Sun Ke
@ 2022-01-30 15:07 ` Chao Yu
2022-02-01 17:53 ` Eric Biggers
2022-02-07 3:07 ` Sun Ke
0 siblings, 2 replies; 7+ messages in thread
From: Chao Yu @ 2022-01-30 15:07 UTC (permalink / raw)
To: Sun Ke, fstests, guan
On 2022/1/30 17:28, Sun Ke wrote:
> 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.
>
> Signed-off-by: Sun Ke <sunke32@huawei.com>
FYI:
https://patchwork.kernel.org/project/fstests/patch/20170428131307.3384-1-chao@kernel.org/
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 <chao@kernel.org>
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.
Signed-off-by: Chao Yu <chao@kernel.org>
---
v2:
- adjust the config for old kernel as well.
common/attr | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/common/attr b/common/attr
index 35682d7c..6377a936 100644
--- a/common/attr
+++ b/common/attr
@@ -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)
--
2.32.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] common/attr: _acl_get_max echo 532 for f2fs
2022-01-30 15:07 ` Chao Yu
@ 2022-02-01 17:53 ` Eric Biggers
2022-02-03 14:30 ` Chao Yu
2022-02-07 3:07 ` Sun Ke
1 sibling, 1 reply; 7+ messages in thread
From: Eric Biggers @ 2022-02-01 17:53 UTC (permalink / raw)
To: Chao Yu; +Cc: Sun Ke, fstests, guan
On Sun, Jan 30, 2022 at 11:07:17PM +0800, Chao Yu wrote:
> On 2022/1/30 17:28, Sun Ke wrote:
> > 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.
> >
> > Signed-off-by: Sun Ke <sunke32@huawei.com>
>
> FYI:
>
> https://patchwork.kernel.org/project/fstests/patch/20170428131307.3384-1-chao@kernel.org/
>
> 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 <chao@kernel.org>
> 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.
>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v2:
> - adjust the config for old kernel as well.
> common/attr | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/common/attr b/common/attr
> index 35682d7c..6377a936 100644
> --- a/common/attr
> +++ b/common/attr
> @@ -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
> ;;
Can you add a comment that explains how these numbers were calculated? They
seem very random.
- Eric
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [f2fs-dev] [PATCH] common/attr: _acl_get_max echo 532 for f2fs
2022-02-01 17:53 ` Eric Biggers
@ 2022-02-03 14:30 ` Chao Yu
0 siblings, 0 replies; 7+ messages in thread
From: Chao Yu @ 2022-02-03 14:30 UTC (permalink / raw)
To: Eric Biggers; +Cc: Sun Ke, guan, fstests, linux-f2fs-devel
On 2022/2/2 1:53, Eric Biggers wrote:
> On Sun, Jan 30, 2022 at 11:07:17PM +0800, Chao Yu wrote:
>> On 2022/1/30 17:28, Sun Ke wrote:
>>> 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.
>>>
>>> Signed-off-by: Sun Ke <sunke32@huawei.com>
>>
>> FYI:
>>
>> https://patchwork.kernel.org/project/fstests/patch/20170428131307.3384-1-chao@kernel.org/
>>
>> 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 <chao@kernel.org>
>> 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.
>>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>> v2:
>> - adjust the config for old kernel as well.
>> common/attr | 11 ++++++++---
>> 1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/common/attr b/common/attr
>> index 35682d7c..6377a936 100644
>> --- a/common/attr
>> +++ b/common/attr
>> @@ -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
>> ;;
>
> 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,
>
> - Eric
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] common/attr: _acl_get_max echo 532 for f2fs
@ 2022-02-03 14:30 ` Chao Yu
0 siblings, 0 replies; 7+ messages in thread
From: Chao Yu @ 2022-02-03 14:30 UTC (permalink / raw)
To: Eric Biggers; +Cc: Sun Ke, fstests, guan, linux-f2fs-devel
On 2022/2/2 1:53, Eric Biggers wrote:
> On Sun, Jan 30, 2022 at 11:07:17PM +0800, Chao Yu wrote:
>> On 2022/1/30 17:28, Sun Ke wrote:
>>> 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.
>>>
>>> Signed-off-by: Sun Ke <sunke32@huawei.com>
>>
>> FYI:
>>
>> https://patchwork.kernel.org/project/fstests/patch/20170428131307.3384-1-chao@kernel.org/
>>
>> 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 <chao@kernel.org>
>> 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.
>>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>> v2:
>> - adjust the config for old kernel as well.
>> common/attr | 11 ++++++++---
>> 1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/common/attr b/common/attr
>> index 35682d7c..6377a936 100644
>> --- a/common/attr
>> +++ b/common/attr
>> @@ -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
>> ;;
>
> 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,
>
> - Eric
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] common/attr: _acl_get_max echo 532 for f2fs
2022-01-30 15:07 ` Chao Yu
2022-02-01 17:53 ` Eric Biggers
@ 2022-02-07 3:07 ` Sun Ke
2022-02-07 15:46 ` Chao Yu
1 sibling, 1 reply; 7+ messages in thread
From: Sun Ke @ 2022-02-07 3:07 UTC (permalink / raw)
To: Chao Yu, fstests, guan
在 2022/1/30 23:07, Chao Yu 写道:
> On 2022/1/30 17:28, Sun Ke wrote:
>> 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.
>>
>> Signed-off-by: Sun Ke <sunke32@huawei.com>
>
> FYI:
>
> https://patchwork.kernel.org/project/fstests/patch/20170428131307.3384-1-chao@kernel.org/
>
>
> 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 <chao@kernel.org>
> 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.
>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v2:
> - adjust the config for old kernel as well.
> common/attr | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/common/attr b/common/attr
> index 35682d7c..6377a936 100644
> --- a/common/attr
> +++ b/common/attr
> @@ -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)
Sorry for reply late.
I send a v2 patch base on your patch, right?
Thanks,
Sun Ke
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] common/attr: _acl_get_max echo 532 for f2fs
2022-02-07 3:07 ` Sun Ke
@ 2022-02-07 15:46 ` Chao Yu
0 siblings, 0 replies; 7+ messages in thread
From: Chao Yu @ 2022-02-07 15:46 UTC (permalink / raw)
To: Sun Ke, fstests, guan
On 2022/2/7 11:07, Sun Ke wrote:
>
>
> 在 2022/1/30 23:07, Chao Yu 写道:
>> On 2022/1/30 17:28, Sun Ke wrote:
>>> 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.
>>>
>>> Signed-off-by: Sun Ke <sunke32@huawei.com>
>>
>> FYI:
>>
>> https://patchwork.kernel.org/project/fstests/patch/20170428131307.3384-1-chao@kernel.org/
>>
>>
>> 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 <chao@kernel.org>
>> 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.
>>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>> v2:
>> - adjust the config for old kernel as well.
>> common/attr | 11 ++++++++---
>> 1 file changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/common/attr b/common/attr
>> index 35682d7c..6377a936 100644
>> --- a/common/attr
>> +++ b/common/attr
>> @@ -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)
>
> Sorry for reply late.
>
> I send a v2 patch base on your patch, right?
Yes.
Thanks,
>
> Thanks,
> Sun Ke
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-02-07 15:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-30 9:28 [PATCH] common/attr: _acl_get_max echo 532 for f2fs Sun Ke
2022-01-30 15:07 ` Chao Yu
2022-02-01 17:53 ` Eric Biggers
2022-02-03 14:30 ` [f2fs-dev] " Chao Yu
2022-02-03 14:30 ` Chao Yu
2022-02-07 3:07 ` Sun Ke
2022-02-07 15:46 ` Chao Yu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.