Received: with ECARTIS (v1.0.0; list xfs); Fri, 27 Jun 2008 05:43:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m5RCgvE5002216 for ; Fri, 27 Jun 2008 05:42:58 -0700 X-ASG-Debug-ID: 1214570638-08f000c60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7A69312CE055; Fri, 27 Jun 2008 05:43:58 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id nPkJpuQDTsaezCve; Fri, 27 Jun 2008 05:43:58 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m5RChuAe018760; Fri, 27 Jun 2008 08:43:56 -0400 Received: from pobox.devel.redhat.com (pobox.devel.redhat.com [10.11.255.8]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m5RChtji020662; Fri, 27 Jun 2008 08:43:55 -0400 Received: from warthog.cambridge.redhat.com (devserv.devel.redhat.com [10.10.36.72]) by pobox.devel.redhat.com (8.13.1/8.13.1) with ESMTP id m5RChsUW014756; Fri, 27 Jun 2008 08:43:55 -0400 Received: from [127.0.0.1] (helo=warthog.procyon.org.uk) by warthog.cambridge.redhat.com with esmtp (Exim 4.68 #1 (Red Hat Linux)) id 1KCDIw-0004wY-QJ; Fri, 27 Jun 2008 13:43:54 +0100 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells X-ASG-Orig-Subj: [PATCH] Fix disabled XFS POSIX ACL handling Subject: [PATCH] Fix disabled XFS POSIX ACL handling To: hch@infradead.org, tes@sgi.com, lachlan@sgi.com Cc: xfs-masters@oss.sgi.com, xfs@oss.sgi.com, dhowells@redhat.com Date: Fri, 27 Jun 2008 13:43:54 +0100 Message-ID: <20080627124354.18978.72867.stgit@warthog.procyon.org.uk> User-Agent: StGIT/0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1214570639 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16618 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dhowells@redhat.com Precedence: bulk X-list: xfs Fix XFS POSIX ACL handling when it's not enabled. xfs_decode_acl() refers to return types that aren't defined under those circumstances. Signed-off-by: David Howells --- fs/xfs/linux-2.6/xfs_xattr.c | 14 -------------- fs/xfs/xfs_acl.c | 13 +++++++++++++ fs/xfs/xfs_acl.h | 2 ++ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_xattr.c b/fs/xfs/linux-2.6/xfs_xattr.c index b4acb68..fe93f41 100644 --- a/fs/xfs/linux-2.6/xfs_xattr.c +++ b/fs/xfs/linux-2.6/xfs_xattr.c @@ -30,20 +30,6 @@ /* - * ACL handling. Should eventually be moved into xfs_acl.c - */ - -static int -xfs_decode_acl(const char *name) -{ - if (strcmp(name, "posix_acl_access") == 0) - return _ACL_TYPE_ACCESS; - else if (strcmp(name, "posix_acl_default") == 0) - return _ACL_TYPE_DEFAULT; - return -EINVAL; -} - -/* * Get system extended attributes which at the moment only * includes Posix ACLs. */ diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index 93057af..24bcbf5 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c @@ -51,6 +51,19 @@ kmem_zone_t *xfs_acl_zone; /* + * ACL handling. + */ +int +xfs_decode_acl(const char *name) +{ + if (strcmp(name, "posix_acl_access") == 0) + return _ACL_TYPE_ACCESS; + else if (strcmp(name, "posix_acl_default") == 0) + return _ACL_TYPE_DEFAULT; + return -EINVAL; +} + +/* * Test for existence of access ACL attribute as efficiently as possible. */ int diff --git a/fs/xfs/xfs_acl.h b/fs/xfs/xfs_acl.h index 332a772..7bf8ef5 100644 --- a/fs/xfs/xfs_acl.h +++ b/fs/xfs/xfs_acl.h @@ -57,6 +57,7 @@ extern struct kmem_zone *xfs_acl_zone; (zone) = kmem_zone_init(sizeof(xfs_acl_t), (name)) #define xfs_acl_zone_destroy(zone) kmem_zone_destroy(zone) +extern int xfs_decode_acl(const char *); extern int xfs_acl_inherit(bhv_vnode_t *, mode_t mode, xfs_acl_t *); extern int xfs_acl_iaccess(struct xfs_inode *, mode_t, cred_t *); extern int xfs_acl_vtoacl(bhv_vnode_t *, xfs_acl_t *, xfs_acl_t *); @@ -80,6 +81,7 @@ extern int xfs_acl_vremove(bhv_vnode_t *, int); #define _ACL_FREE(a) ((a)? kmem_zone_free(xfs_acl_zone, (a)):(void)0) #else +#define xfs_decode_acl(name) (-EINVAL) #define xfs_acl_zone_init(zone,name) #define xfs_acl_zone_destroy(zone) #define xfs_acl_vset(v,p,sz,t) (-EOPNOTSUPP)