Linux: Initialize zp in zfs_setattr_dir

The value of zp is used without having been initialized under some
conditions.  Initialize the pointer to NULL.

Add a regression test case using chown in acl/posix.  However, this is
not enough because the setup sets xattr=sa, which means zfs_setattr_dir
will not be called.  Create a second group of acl tests in acl/posix-sa
duplicating the acl/posix tests with symlinks, and remove xattr=sa from
the original acl/posix tests.  This provides more coverage for the
default xattr=on code.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10043
Closes #11025
This commit is contained in:
Ryan Moeller
2020-10-09 12:27:14 -04:00
committed by Brian Behlendorf
parent 46c71074ca
commit 5e7198b873
15 changed files with 157 additions and 6 deletions
+1 -1
View File
@@ -2543,7 +2543,7 @@ zfs_setattr_dir(znode_t *dzp)
zap_cursor_t zc;
zap_attribute_t zap;
zfs_dirlock_t *dl;
znode_t *zp;
znode_t *zp = NULL;
dmu_tx_t *tx = NULL;
uint64_t uid, gid;
sa_bulk_attr_t bulk[4];