Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966505AbcCPK7u (ORCPT ); Wed, 16 Mar 2016 06:59:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:47137 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753861AbcCPK7q (ORCPT ); Wed, 16 Mar 2016 06:59:46 -0400 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, NeilBrown , Sergio Gelato , Jiri Slaby Subject: [PATCH 3.12 01/58] nfsd: fix problem with setting ACL on directories Date: Wed, 16 Mar 2016 11:58:46 +0100 Message-Id: <377b71e18f20d69b0df301ce7040554f40ba9651.1458125909.git.jslaby@suse.cz> X-Mailer: git-send-email 2.7.3 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1207 Lines: 38 From: NeilBrown 3.12-stable review patch. If anyone has any objections, please let me know. =============== This is a regression of 3.12 stable commit ba1816b40a87a3f3c4ca9cd54a593a10d87bd391 (nfsd: fix NFS regression). If a non-inherited ACL is set on a directory, nfsd will try to set the Posix default ACL to NULL. This gets converted to "" by generic_setxattr(). As "" is not a valid posix acl attribute value, this results in an error. So instead of setting the xattr to NULL, remove it. Fixes: ba1816b40a ("nfsd: fix NFS regression") Signed-off-by: NeilBrown Cc: Sergio Gelato Signed-off-by: Jiri Slaby --- fs/nfsd/vfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index fafac65804d6..e5f146c7c871 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -510,7 +510,7 @@ set_nfsv4_acl_one(struct dentry *dentry, struct posix_acl *pacl, char *key) int error = 0; if (!pacl) - return vfs_setxattr(dentry, key, NULL, 0, 0); + return vfs_removexattr(dentry, key); buflen = posix_acl_xattr_size(pacl->a_count); buf = kmalloc(buflen, GFP_KERNEL); -- 2.7.3