linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] common/attr: adbjust acl_max of f2fs
@ 2022-02-08  7:16 Sun Ke via Linux-f2fs-devel
  2022-02-18  2:33 ` Sun Ke via Linux-f2fs-devel
  2022-02-25  1:24 ` Chao Yu via Linux-f2fs-devel
  0 siblings, 2 replies; 3+ messages in thread
From: Sun Ke via Linux-f2fs-devel @ 2022-02-08  7:16 UTC (permalink / raw)
  To: fstests, guan; +Cc: sunke32, linux-f2fs-devel

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.

Suggested-by: Chao Yu <chao@kernel.org>
Signed-off-by: Sun Ke <sunke32@huawei.com>
---
 common/attr | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/common/attr b/common/attr
index 35682d7c..dae8a1bb 100644
--- a/common/attr
+++ b/common/attr
@@ -26,11 +26,24 @@ _acl_get_max()
 		echo 8191
 		;;
 	f2fs)
-		_fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1
+		# 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
+		_fs_options $TEST_DEV | grep "noinline_xattr" >/dev/null 2>&1
 		if [ $? -eq 0 ]; then
-			echo 531
+			echo 507
 		else
-			echo 506
+			# 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
+			_fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1
+			if [ $? -eq 0 ]; then
+				echo 532
+			else
+				echo 507
+			fi
 		fi
 		;;
 	bcachefs)
-- 
2.13.6



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH] common/attr: adbjust acl_max of f2fs
  2022-02-08  7:16 [f2fs-dev] [PATCH] common/attr: adbjust acl_max of f2fs Sun Ke via Linux-f2fs-devel
@ 2022-02-18  2:33 ` Sun Ke via Linux-f2fs-devel
  2022-02-25  1:24 ` Chao Yu via Linux-f2fs-devel
  1 sibling, 0 replies; 3+ messages in thread
From: Sun Ke via Linux-f2fs-devel @ 2022-02-18  2:33 UTC (permalink / raw)
  To: fstests, guan; +Cc: linux-f2fs-devel

Friendly ping...

在 2022/2/8 15:16, Sun Ke 写道:
> 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.
>
> Suggested-by: Chao Yu <chao@kernel.org>
> Signed-off-by: Sun Ke <sunke32@huawei.com>
> ---
>   common/attr | 19 ++++++++++++++++---
>   1 file changed, 16 insertions(+), 3 deletions(-)
>
> diff --git a/common/attr b/common/attr
> index 35682d7c..dae8a1bb 100644
> --- a/common/attr
> +++ b/common/attr
> @@ -26,11 +26,24 @@ _acl_get_max()
>   		echo 8191
>   		;;
>   	f2fs)
> -		_fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1
> +		# 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
> +		_fs_options $TEST_DEV | grep "noinline_xattr" >/dev/null 2>&1
>   		if [ $? -eq 0 ]; then
> -			echo 531
> +			echo 507
>   		else
> -			echo 506
> +			# 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
> +			_fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1
> +			if [ $? -eq 0 ]; then
> +				echo 532
> +			else
> +				echo 507
> +			fi
>   		fi
>   		;;
>   	bcachefs)


_______________________________________________
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] 3+ messages in thread

* Re: [f2fs-dev] [PATCH] common/attr: adbjust acl_max of f2fs
  2022-02-08  7:16 [f2fs-dev] [PATCH] common/attr: adbjust acl_max of f2fs Sun Ke via Linux-f2fs-devel
  2022-02-18  2:33 ` Sun Ke via Linux-f2fs-devel
@ 2022-02-25  1:24 ` Chao Yu via Linux-f2fs-devel
  1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2022-02-25  1:24 UTC (permalink / raw)
  To: Sun Ke, fstests, guan; +Cc: linux-f2fs-devel

On 2022/2/8 15:16, Sun Ke via Linux-f2fs-devel wrote:
> 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.
> 
> Suggested-by: Chao Yu <chao@kernel.org>
> Signed-off-by: Sun Ke <sunke32@huawei.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,


_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2022-02-25  1:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-08  7:16 [f2fs-dev] [PATCH] common/attr: adbjust acl_max of f2fs Sun Ke via Linux-f2fs-devel
2022-02-18  2:33 ` Sun Ke via Linux-f2fs-devel
2022-02-25  1:24 ` Chao Yu via Linux-f2fs-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).