mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 19:04:45 +03:00
Posix ACL Support
This change adds support for Posix ACLs by storing them as an xattr which is common practice for many Linux file systems. Since the Posix ACL is stored as an xattr it will not overwrite any existing ZFS/NFSv4 ACLs which may have been set. The Posix ACL will also be non-functional on other platforms although it may be visible as an xattr if that platform understands SA based xattrs. By default Posix ACLs are disabled but they may be enabled with the new 'aclmode=noacl|posixacl' property. Set the property to 'posixacl' to enable them. If ZFS/NFSv4 ACL support is ever added an appropriate acltype will be added. This change passes the POSIX Test Suite cleanly with the exception of xacl/00.t test 45 which is incorrect for Linux (Ext4 fails too). http://www.tuxera.com/community/posix-test-suite/ Signed-off-by: Massimo Maggi <me@massimo-maggi.eu> Signed-off-by: Richard Yao <ryao@gentoo.org> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #170
This commit is contained in:
committed by
Brian Behlendorf
parent
7c2448a33e
commit
023699cd62
@@ -3971,7 +3971,7 @@ zfs_putpage(struct inode *ip, struct page *pp, struct writeback_control *wbc)
|
||||
|
||||
/*
|
||||
* Update the system attributes when the inode has been dirtied. For the
|
||||
* moment we're conservative and only update the atime, mtime, and ctime.
|
||||
* moment we only update the mode, atime, mtime, and ctime.
|
||||
*/
|
||||
int
|
||||
zfs_dirty_inode(struct inode *ip, int flags)
|
||||
@@ -3979,8 +3979,8 @@ zfs_dirty_inode(struct inode *ip, int flags)
|
||||
znode_t *zp = ITOZ(ip);
|
||||
zfs_sb_t *zsb = ITOZSB(ip);
|
||||
dmu_tx_t *tx;
|
||||
uint64_t atime[2], mtime[2], ctime[2];
|
||||
sa_bulk_attr_t bulk[3];
|
||||
uint64_t mode, atime[2], mtime[2], ctime[2];
|
||||
sa_bulk_attr_t bulk[4];
|
||||
int error;
|
||||
int cnt = 0;
|
||||
|
||||
@@ -3999,14 +3999,18 @@ zfs_dirty_inode(struct inode *ip, int flags)
|
||||
}
|
||||
|
||||
mutex_enter(&zp->z_lock);
|
||||
SA_ADD_BULK_ATTR(bulk, cnt, SA_ZPL_MODE(zsb), NULL, &mode, 8);
|
||||
SA_ADD_BULK_ATTR(bulk, cnt, SA_ZPL_ATIME(zsb), NULL, &atime, 16);
|
||||
SA_ADD_BULK_ATTR(bulk, cnt, SA_ZPL_MTIME(zsb), NULL, &mtime, 16);
|
||||
SA_ADD_BULK_ATTR(bulk, cnt, SA_ZPL_CTIME(zsb), NULL, &ctime, 16);
|
||||
|
||||
/* Preserve the mtime and ctime provided by the inode */
|
||||
/* Preserve the mode, mtime and ctime provided by the inode */
|
||||
ZFS_TIME_ENCODE(&ip->i_atime, atime);
|
||||
ZFS_TIME_ENCODE(&ip->i_mtime, mtime);
|
||||
ZFS_TIME_ENCODE(&ip->i_ctime, ctime);
|
||||
mode = ip->i_mode;
|
||||
|
||||
zp->z_mode = mode;
|
||||
zp->z_atime_dirty = 0;
|
||||
|
||||
error = sa_bulk_update(zp->z_sa_hdl, bulk, cnt, tx);
|
||||
|
||||
Reference in New Issue
Block a user