GFS2: Don't "get" xattrs for ACLs when ACLs are turned off
authorSteven Whitehouse <swhiteho@redhat.com>
Fri, 21 May 2010 15:12:27 +0000 (16:12 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Fri, 21 May 2010 15:12:27 +0000 (16:12 +0100)
This is to match ext3 behaviour. We should not allow getting of
xattrs relating to ACLs when ACLs are turned off.

Reported-by: Nate Straz <nstraz@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/acl.c

index 87ee309..ca991d7 100644 (file)
@@ -236,10 +236,14 @@ static int gfs2_xattr_system_get(struct dentry *dentry, const char *name,
                                 void *buffer, size_t size, int xtype)
 {
        struct inode *inode = dentry->d_inode;
+       struct gfs2_sbd *sdp = GFS2_SB(inode);
        struct posix_acl *acl;
        int type;
        int error;
 
+       if (!sdp->sd_args.ar_posix_acl)
+               return -EOPNOTSUPP;
+
        type = gfs2_acl_type(name);
        if (type < 0)
                return type;