linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: jfs-discussion@lists.sourceforge.net, linux-ext4@vger.kernel.org,
	reiserfs-devel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com,
	linux-mtd@lists.infradead.org, viro@zeniv.linux.org.uk,
	linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com,
	linux-nfs@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [Cluster-devel] [PATCH 16/18] gfs2: use generic posix ACL infrastructure
Date: Wed, 04 Dec 2013 12:12:37 +0000	[thread overview]
Message-ID: <1386159157.2711.11.camel@menhir> (raw)
In-Reply-To: <20131201120656.539995924@bombadil.infradead.org>

Hi,

On Sun, 2013-12-01 at 03:59 -0800, Christoph Hellwig wrote:
> plain text document attachment
> (0016-gfs2-use-generic-posix-ACL-infrastructure.patch)
> This contains some major refactoring for the create path so that
> inodes are created with the right mode to start with instead of
> fixing it up later.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/gfs2/acl.c   |  229 +++++++------------------------------------------------
>  fs/gfs2/acl.h   |    4 +-
>  fs/gfs2/inode.c |   33 ++++++--
>  fs/gfs2/xattr.c |    4 +-
>  4 files changed, 61 insertions(+), 209 deletions(-)
> 
Looks very good. I'd really like to be able to do something similar with
the security xattrs, in terms of the refactoring that at inode creation
to give the xattrs ahead of the inode allocation itself. That way it
should be possible to allocate the xattr blocks at the same time as the
inode, rather than as an after thought.

Some more comments below....

> diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c
> index e82e4ac..e6c7a2c 100644
> --- a/fs/gfs2/acl.c
> +++ b/fs/gfs2/acl.c
[snip]
> -
> -static int gfs2_xattr_system_set(struct dentry *dentry, const char *name,
> -				 const void *value, size_t size, int flags,
> -				 int xtype)
> -{
> -	struct inode *inode = dentry->d_inode;
> -	struct gfs2_sbd *sdp = GFS2_SB(inode);
> -	struct posix_acl *acl = NULL;
> -	int error = 0, type;
> -
> -	if (!sdp->sd_args.ar_posix_acl)
> -		return -EOPNOTSUPP;
> -
> -	type = gfs2_acl_type(name);
> -	if (type < 0)
> -		return type;
> -	if (flags & XATTR_CREATE)
> -		return -EINVAL;
> -	if (type == ACL_TYPE_DEFAULT && !S_ISDIR(inode->i_mode))
> -		return value ? -EACCES : 0;
> -	if (!uid_eq(current_fsuid(), inode->i_uid) && !capable(CAP_FOWNER))
> -		return -EPERM;
> -	if (S_ISLNK(inode->i_mode))
> -		return -EOPNOTSUPP;
> -
> -	if (!value)
> -		goto set_acl;
>  
> -	acl = posix_acl_from_xattr(&init_user_ns, value, size);
> -	if (!acl) {
> -		/*
> -		 * acl_set_file(3) may request that we set default ACLs with
> -		 * zero length -- defend (gracefully) against that here.
> -		 */
> -		goto out;
> -	}
> -	if (IS_ERR(acl)) {
> -		error = PTR_ERR(acl);
> -		goto out;
> -	}
> -
> -	error = posix_acl_valid(acl);
> -	if (error)
> -		goto out_release;
> -
> -	error = -EINVAL;
>  	if (acl->a_count > GFS2_ACL_MAX_ENTRIES)
> -		goto out_release;
> +		return -EINVAL;
>  
>  	if (type == ACL_TYPE_ACCESS) {
>  		umode_t mode = inode->i_mode;
> +
>  		error = posix_acl_equiv_mode(acl, &mode);
> +		if (error < 0)
>  
Andy Price has pointed out a missing "return error;" here

> -		if (error <= 0) {
> -			posix_acl_release(acl);
> +		if (error == 0)
>  			acl = NULL;
>  
> -			if (error < 0)
> -				return error;
> -		}
> -

Also, there seems to be a white space error in the xfs patch around line
170 in fs/xfs/xfs_iops.c where there is an added "if (default_acl)" with
a space before the tab,

Steve.


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2013-12-04 12:12 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-01 11:59 [PATCH 00/18] Consolidate Posix ACL implementation Christoph Hellwig
2013-12-01 11:59 ` [PATCH 01/18] reiserfs: prefix ACL symbols with reiserfs_ Christoph Hellwig
2013-12-02 20:15   ` Jan Kara
2013-12-01 11:59 ` [PATCH 02/18] fs: add get_acl helper Christoph Hellwig
2013-12-02 20:14   ` Jan Kara
2013-12-01 11:59 ` [PATCH 03/18] fs: add a set_acl inode operation Christoph Hellwig
2013-12-02 20:57   ` Jan Kara
2013-12-01 11:59 ` [PATCH 04/18] fs: add generic xattr_acl handlers Christoph Hellwig
2013-12-02 20:59   ` Jan Kara
2013-12-01 11:59 ` [PATCH 05/18] fs: make posix_acl_chmod more useful Christoph Hellwig
2013-12-02 21:09   ` Jan Kara
2013-12-01 11:59 ` [PATCH 06/18] fs: make posix_acl_create " Christoph Hellwig
2013-12-02 21:11   ` Jan Kara
2013-12-01 11:59 ` [PATCH 07/18] btrfs: use generic posix ACL infrastructure Christoph Hellwig
2013-12-01 11:59 ` [PATCH 08/18] ext2/3/4: " Christoph Hellwig
2013-12-02 22:13   ` Jan Kara
2013-12-02 22:18     ` [Jfs-discussion] " gary sheppard
2013-12-01 11:59 ` [PATCH 09/18] f2fs: " Christoph Hellwig
2013-12-06  1:37   ` Jaegeuk Kim
2013-12-08  9:14     ` Christoph Hellwig
2013-12-08 23:28       ` Jaegeuk Kim
2013-12-01 11:59 ` [PATCH 10/18] hfsplus: " Christoph Hellwig
2013-12-01 14:36   ` Vyacheslav Dubeyko
2013-12-01 11:59 ` [PATCH 11/18] jffs2: " Christoph Hellwig
2013-12-01 11:59 ` [PATCH 12/18] ocfs2: " Christoph Hellwig
2013-12-02 23:00   ` Jan Kara
2013-12-03 10:48     ` Christoph Hellwig
2013-12-01 11:59 ` [PATCH 13/18] reiserfs: " Christoph Hellwig
2013-12-02 22:17   ` Jan Kara
2013-12-01 11:59 ` [PATCH 14/18] xfs: " Christoph Hellwig
2013-12-02 23:34   ` Dave Chinner
2013-12-01 11:59 ` [PATCH 15/18] jfs: " Christoph Hellwig
2013-12-02 22:11   ` [Jfs-discussion] " Dave Kleikamp
2013-12-01 11:59 ` [PATCH 16/18] gfs2: " Christoph Hellwig
2013-12-04 12:12   ` Steven Whitehouse [this message]
2013-12-06 19:47     ` [Cluster-devel] " Christoph Hellwig
2013-12-01 11:59 ` [PATCH 17/18] nfs: use generic posix ACL infrastructure for v3 Posix ACLs Christoph Hellwig
2013-12-01 11:59 ` [PATCH 18/18] fs: remove generic_acl Christoph Hellwig
2013-12-05 17:57 ` [PATCH 00/18] Consolidate Posix ACL implementation Andreas Gruenbacher
2013-12-06 19:46   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2013-12-11 10:42 [PATCH 00/18] Consolidate Posix ACL implementation V2 Christoph Hellwig
2013-12-11 10:42 ` [PATCH 16/18] gfs2: use generic posix ACL infrastructure Christoph Hellwig
2013-12-11 10:52   ` [Cluster-devel] " Steven Whitehouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386159157.2711.11.camel@menhir \
    --to=swhiteho@redhat.com \
    --cc=cluster-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).