public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: Fix error path in xfs_get_acl
Date: Mon, 12 Oct 2015 11:45:39 +1100	[thread overview]
Message-ID: <20151012004539.GA31326@dastard> (raw)
In-Reply-To: <1444569791-26719-1-git-send-email-agruenba@redhat.com>

On Sun, Oct 11, 2015 at 03:23:11PM +0200, Andreas Gruenbacher wrote:
> Error codes from xfs_attr_get other than -ENOATTR were not properly 
> reported.  Fix that, and clean the code up somewhat.

Test case for xfstests?

> In addition, the declaration of struct xfs_inode in xfs_acl.h isn't needed.
> 
> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
> ---
>  fs/xfs/xfs_acl.c | 19 +++++++------------
>  fs/xfs/xfs_acl.h |  1 -
>  2 files changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
> index 4b64167..0f4ee92 100644
> --- a/fs/xfs/xfs_acl.c
> +++ b/fs/xfs/xfs_acl.c
> @@ -122,7 +122,7 @@ struct posix_acl *
>  xfs_get_acl(struct inode *inode, int type)
>  {
>  	struct xfs_inode *ip = XFS_I(inode);
> -	struct posix_acl *acl = NULL;
> +	struct posix_acl *acl;
>  	struct xfs_acl *xfs_acl;
>  	unsigned char *ea_name;
>  	int error;
> @@ -158,18 +158,13 @@ xfs_get_acl(struct inode *inode, int type)
>  		 * cache entry, for any other error assume it is transient and
>  		 * leave the cache entry as ACL_NOT_CACHED.
>  		 */
> -		if (error == -ENOATTR)
> -			goto out_update_cache;
> -		goto out;
> -	}
> +		acl = (error == -ENOATTR) ? NULL : ERR_PTR(error);

AFAICT, this single line here is the bugfix, right?

So the entire patch could simply be replaced by:

 		if (error == -ENOATTR)
 			goto out_update_cache;
+		acl = ERR_PTR(error);
 		goto out;
 	}

Or have I missed the missed the fix in all the code rearranging you
did?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

  reply	other threads:[~2015-10-12  0:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-11 13:23 [PATCH] xfs: Fix error path in xfs_get_acl Andreas Gruenbacher
2015-10-12  0:45 ` Dave Chinner [this message]
2015-10-12  3:05   ` Andreas Gruenbacher
  -- strict thread matches above, loose matches on Subject: below --
2015-11-03 13:47 Andreas Gruenbacher

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=20151012004539.GA31326@dastard \
    --to=david@fromorbit.com \
    --cc=agruenba@redhat.com \
    --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