From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Subject: [PATCH 2/2] vfs: Fix the posix_acl_xattr_list return value Date: Tue, 3 Nov 2015 15:25:08 +0100 Message-ID: <1446560708-10897-3-git-send-email-agruenba@redhat.com> References: <1446560708-10897-1-git-send-email-agruenba@redhat.com> Cc: Andreas Gruenbacher To: Alexander Viro , linux-fsdevel@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36617 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634AbbKCOZR (ORCPT ); Tue, 3 Nov 2015 09:25:17 -0500 In-Reply-To: <1446560708-10897-1-git-send-email-agruenba@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: When a filesystem that contains POSIX ACLs is mounted without ACL support (-o noacl), the appropriate behavior is not to list any existing POSIX ACL xattrs. The return value for list xattr handlers in this case is 0, not an error code: several filesystems that use the POSIX ACL xattr handlers do not expect the list operation to fail. Symlinks cannot have ACLs, so posix_acl_xattr_list will never be called for symlinks in the first place. Signed-off-by: Andreas Gruenbacher --- fs/posix_acl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/posix_acl.c b/fs/posix_acl.c index b1a66e8..2fdca61 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c @@ -833,9 +833,7 @@ posix_acl_xattr_list(struct dentry *dentry, char *list, size_t list_size, size_t size; if (!IS_POSIXACL(d_backing_inode(dentry))) - return -EOPNOTSUPP; - if (d_is_symlink(dentry)) - return -EOPNOTSUPP; + return 0; if (type == ACL_TYPE_ACCESS) xname = POSIX_ACL_XATTR_ACCESS; -- 2.5.0