linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <fdmanana@gmail.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file.
Date: Tue, 15 Apr 2014 17:15:50 +0800	[thread overview]
Message-ID: <534CF8C6.1050405@cn.fujitsu.com> (raw)
In-Reply-To: <CAL3q7H7Wvgs0ejnd6iAVJMf6mi98tHGcCKu52+FMY98rMrBeHQ@mail.gmail.com>


-------- Original Message --------
Subject: Re: [PATCH 4/4] btrfs-progs: Fix the return value when 
executing 'btrfs pro get' on a uncompress file.
From: Filipe David Manana <fdmanana@gmail.com>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Date: 2014年04月15日 17:09
> On Tue, Apr 15, 2014 at 8:04 AM, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
>> When executing 'btrfs pro get' on a file which is not compressed, return
>> value will always be 50 since prop_compress() return -ENOATTR.
>>
>> But this should be ignored and other prop_XXX() returns 0, so when
>> prop_compress() is executed on uncompress file, it should return 0.
>>
>> Signed-off-by: Qu Wenruo <quwenro@cn.fujitsu.com>
>> ---
>>   props.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/props.c b/props.c
>> index 4d0aeea..49ee982 100644
>> --- a/props.c
>> +++ b/props.c
>> @@ -146,6 +146,7 @@ static int prop_compression(enum prop_object_type type,
>>                          fprintf(stderr,
>>                                  "ERROR: failed to %s compression for %s. %s\n",
>>                                  value ? "set" : "get", object, strerror(-ret));
>> +               ret = 0;
>>                  goto out;
> Hi Qu,
>
> So this should set ret to 0 if error ==  -ENOATTR. And of course the
> check above should be against  -ENOATTR and not -ENODATA.
>
> thanks
Thanks for pointing it out, I'll send the v2 patch soon.

Thanks,
Qu
>
>
>>          }
>>          if (!value) {
>> --
>> 1.9.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>


      reply	other threads:[~2014-04-15  9:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15  7:04 [PATCH 1/4] btrfs-progs: Convert man page for btrfs-restore Qu Wenruo
2014-04-15  7:04 ` [PATCH 2/4] btrfs-progs: Convert man page for btrfs-property Qu Wenruo
2014-04-15  7:04 ` [PATCH 3/4] btrfs-progs: Add btrfs wiki reference to man pages Qu Wenruo
2014-04-15 16:55   ` David Sterba
2014-04-15  7:04 ` [PATCH 4/4] btrfs-progs: Fix the return value when executing 'btrfs pro get' on a uncompress file Qu Wenruo
2014-04-15  9:09   ` Filipe David Manana
2014-04-15  9:15     ` Qu Wenruo [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=534CF8C6.1050405@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=fdmanana@gmail.com \
    --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 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).