Whamcloud - gitweb
LU-14430 mdd: fix inheritance of big default ACLs
authorMikhail Pershin <mpershin@whamcloud.com>
Fri, 12 Feb 2021 07:16:24 +0000 (10:16 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 6 Mar 2021 21:28:43 +0000 (21:28 +0000)
commit42c2519fcabf5fca60a69a8cc8c14f8df43d01ae
tree73b6a88ad1f709ad37cb96dacdb3b14048f4a5dd
parent4d930b8fd272e6b135ff10535fc72688f2ad8297
LU-14430 mdd: fix inheritance of big default ACLs

If the number of default ACLs in directory is more than 31, then
mdd_acl_init() fails to inherit them for a newly created file.
This limitation is caused by using a fixed-size def_acl_buf buffer
in the mdd_create()->mdd_acl_init() call chain. Instead, the
default ACL buffer should be increased when it is needed.

Patch adds check for -ERANGE after mdd_acl_init(), reallocates
default ACL buffer with required size and calls mdd_acl_init()
again. Thus big default ACL are processed as expected.

Lustre-commit: f3d03bc38a3afdef83635d578ee0b2ffdd985685
Lustre-change: https://review.whamcloud.com/41494

Fixes: 6350af100c20 ("LU-3437 mdd: Fix ACL/def_ACL during object creation")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I700da90c09f824955fcb8dc7ca0bc2f581f916a0
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/41861
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
lustre/mdd/mdd_dir.c
lustre/tests/sanity.sh