public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Christoph Hellwig <hch@infradead.org>
Cc: xfs@oss.sgi.com
Subject: Re: xfs: use generic Posix ACL code
Date: Mon, 08 Jun 2009 15:36:14 -0500	[thread overview]
Message-ID: <4A2D763E.1000909@sandeen.net> (raw)
In-Reply-To: <20090304173008.GA32471@infradead.org>

Christoph Hellwig wrote:
> On Fri, Feb 20, 2009 at 03:51:17PM -0500, Christoph Hellwig wrote:
>> This patch rips out the XFS ACL handling code and uses the generic
>> fs/posix_acl.c code instead.  The ondisk format is of course left
>> unchanged.
>>
>> This also introduces the same ACL caching all other Linux filesystems do
>> by adding pointers to the acl and default acl in struct xfs_inode.
> 
> FYI: there was one hunk that slipped into another patch so that it
> was missing in this one.  Correct one below:
> 
> 
> This patch rips out the XFS ACL handling code and uses the generic
> fs/posix_acl.c code instead.  The ondisk format is of course left
> unchanged.
> 
> This also introduces the same ACL caching all other Linux filesystems do
> by adding pointers to the acl and default acl in struct xfs_inode.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> 
> Index: xfs/fs/xfs/linux-2.6/xfs_acl.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ xfs/fs/xfs/linux-2.6/xfs_acl.c	2009-02-25 14:58:48.495043588 +0100
> @@ -0,0 +1,510 @@
> +/*
> + * Copyright (C) 2008 Christoph Hellwig.
> + *	Released under GPL v2.
> + */

Any reason not to have the normal full gpl header as all the other files do?

...

> +	if (!acl) {
> +		 /*
> +		  * acl_set_file(3) may request that we set default ACLs with
> +		  * zero length -- defend (gracefully) against that here.
> +		  */

                ^ weird extra space here

> Index: xfs/fs/xfs/xfs_vnodeops.c
> ===================================================================
> --- xfs.orig/fs/xfs/xfs_vnodeops.c	2009-02-24 15:32:35.855495805 +0100
> +++ xfs/fs/xfs/xfs_vnodeops.c	2009-02-25 20:19:38.999670627 +0100
> @@ -42,6 +42,7 @@
>  #include "xfs_ialloc.h"
>  #include "xfs_alloc.h"
>  #include "xfs_bmap.h"
> +#include "xfs_acl.h"
>  #include "xfs_attr.h"
>  #include "xfs_rw.h"
>  #include "xfs_error.h"
> @@ -466,8 +467,20 @@ xfs_setattr(
>  	xfs_qm_dqrele(udqp);
>  	xfs_qm_dqrele(gdqp);
>  
> -	if (code) {
> +	if (code)
>  		return code;
> +
> +	/*
> +	 * XXX(hch): Updating the ACL entries is not atomic vs the i_mode
> +	 * 	     update.  We could avoid this with linked transactions
> +	 * 	     and an passing down the transaction pointer all the

                         ^^ extra word here?

> +	 * 	     way to attr_set.  No previous user of the generic
> +	 * 	     Posix ACL code seems to care about this issue either.
> +	 */
> +	if ((mask & ATTR_MODE) && !(flags & XFS_ATTR_NOACL)) {
> +		code = xfs_acl_chmod(inode);
> +		if (code)
> +			return code;
>  	}

Don't you need to flip the error sign here?

As a general comment, should more of the new code get the XFS_ERROR()
treatment?

As another general comment, do the goto targets have spaces in front of
them intentionally?

As yet another general comment, have you double checked that the
"static" functions aren't getting into inline stack hell?

/me checks ... seems ok .... xfs_setattr grew a little but not bad.

The rest seems fine, though I um, well, never use acls and can't say I'm
super confident reviewing them :)

-Eric

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

  parent reply	other threads:[~2009-06-08 20:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20 20:51 xfs: use generic Posix ACL code Christoph Hellwig
2009-03-04 17:30 ` Christoph Hellwig
2009-03-15  8:18   ` Dave Chinner
2009-06-08 20:36   ` Eric Sandeen [this message]
2009-06-09  9:01     ` Christoph Hellwig
2009-06-09 16:40       ` Eric Sandeen

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=4A2D763E.1000909@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=hch@infradead.org \
    --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