All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
To: dave@jikos.cz
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: fix error processing in btrfs_set_acl()
Date: Sat, 06 Oct 2012 01:59:29 +0900	[thread overview]
Message-ID: <506F11F1.5010803@jp.fujitsu.com> (raw)
In-Reply-To: <20121005100255.GC14582@twin.jikos.cz>

(2012/10/05 19:02), David Sterba wrote:
> 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

Yes, this is a "cleanup". sorry.

- Tsutomu

> 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 16:59 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
2012-10-05 16:59   ` Tsutomu Itoh [this message]

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=506F11F1.5010803@jp.fujitsu.com \
    --to=t-itoh@jp.fujitsu.com \
    --cc=dave@jikos.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.