diff mbox

Fix ZPL miswrite of default POSIX ACL

Message ID 1461765658-20493-1-git-send-email-colin.king@canonical.com
State New
Headers show

Commit Message

Colin Ian King April 27, 2016, 2 p.m. UTC
From: Ned Bass <bass6@llnl.gov>

BugLink: http://bugs.launchpad.net/bugs/1574801

Commit 4967a3e introduced a typo that caused the ZPL to store the
intended default ACL as an access ACL. Due to caching this problem
may not become visible until the filesystem is remounted or the inode
is evicted from the cache. Fix the typo and add a regression test.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Closes #4520
(backport from 98f03691a4c08f38ca4538c468e9523f8e6b24be https://github.com/zfsonlinux/zfs.git)
(dropped redundant modifications to zfs tests, we don't have these)
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 zfs/module/zfs/zpl_xattr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kamal Mostafa April 27, 2016, 2:12 p.m. UTC | #1

Tim Gardner April 27, 2016, 2:22 p.m. UTC | #2

Kamal Mostafa April 27, 2016, 3:34 p.m. UTC | #3
Applied to Xenial.
diff mbox

Patch

diff --git a/zfs/module/zfs/zpl_xattr.c b/zfs/module/zfs/zpl_xattr.c
index 6a1acd7..4200919 100644
--- a/zfs/module/zfs/zpl_xattr.c
+++ b/zfs/module/zfs/zpl_xattr.c
@@ -969,7 +969,7 @@  zpl_set_acl(struct inode *ip, int type, struct posix_acl *acl)
 		break;
 
 	case ACL_TYPE_DEFAULT:
-		name = XATTR_NAME_POSIX_ACL_ACCESS;
+		name = XATTR_NAME_POSIX_ACL_DEFAULT;
 		if (!S_ISDIR(ip->i_mode))
 			return (acl ? -EACCES : 0);
 		break;