linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dave@jikos.cz>
To: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org, chris.mason@fusionio.com
Subject: Re: [PATCH] Btrfs: fix error processing in btrfs_set_acl()
Date: Fri, 5 Oct 2012 12:02:55 +0200	[thread overview]
Message-ID: <20121005100255.GC14582@twin.jikos.cz> (raw)
In-Reply-To: <201210050935.AA00014@FM-323941448.jp.fujitsu.com>

Hi,

On Fri, Oct 05, 2012 at 06:35:07PM +0900, Tsutomu Itoh wrote:
> The error is only returned when kmalloc() fails.
> Therefore, to return the error to the caller directly here, I changed the code.

  "fix error processing in btrfs_set_acl()"

what bug does it 'fix' ? IMHO this is a minor cleanup that is not much
needed. The return path after 'posix_acl_to_xattr' uses the if/goto
pattern in the same if (acl) { ... } block, visually this does not help
the original code is correct and "looks ok".
  
> --- a/fs/btrfs/acl.c
> +++ b/fs/btrfs/acl.c
> @@ -136,10 +136,8 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans,
>  	if (acl) {
>  		size = posix_acl_xattr_size(acl->a_count);
>  		value = kmalloc(size, GFP_NOFS);
> -		if (!value) {
> -			ret = -ENOMEM;
> -			goto out;
> -		}
> +		if (!value)
> +			return -ENOMEM;
>  
>  		ret = posix_acl_to_xattr(acl, value, size);
>  		if (ret < 0)


david

  reply	other threads:[~2012-10-05 10:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05  9:35 [PATCH] Btrfs: fix error processing in btrfs_set_acl() Tsutomu Itoh
2012-10-05 10:02 ` David Sterba [this message]
2012-10-05 16:59   ` Tsutomu Itoh

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=20121005100255.GC14582@twin.jikos.cz \
    --to=dave@jikos.cz \
    --cc=chris.mason@fusionio.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=t-itoh@jp.fujitsu.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).