From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: Stefan Behrens <sbehrens@giantdisaster.de>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs-progs: save us an unnecessary ioctl call
Date: Tue, 13 May 2014 19:26:21 +0800 [thread overview]
Message-ID: <5372015D.4070901@cn.fujitsu.com> (raw)
In-Reply-To: <5371F89B.1060401@giantdisaster.de>
On 05/13/2014 06:48 PM, Stefan Behrens wrote:
> On Tue, 13 May 2014 17:05:05 +0800, Wang Shilong wrote:
>> Btrfs device id start from 1, not 0.
>>
>> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
>> ---
>> utils.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/utils.c b/utils.c
>> index 560c557..d480353 100644
>> --- a/utils.c
>> +++ b/utils.c
>> @@ -1765,7 +1765,7 @@ int get_fs_info(char *path, struct btrfs_ioctl_fs_info_args *fi_args,
>> goto out;
>> }
> You've not seen the two assignments in get_fs_info() above the lines
> that you change:
>
> if (is_block_device(path)) {
> ...
> fi_args->max_id = devid;
> i = devid;
Oops, i did not see this one, but this condition may not meet, so
i guess the right fix is to set i=1 when declaration, something like:
int i = 1;
>
>>
>> - for (; i <= fi_args->max_id; ++i) {
>> + for (i = 1; i <= fi_args->max_id; ++i) {
>> BUG_ON(ndevs >= fi_args->num_devices);
>> ret = get_device_info(fd, i, &di_args[ndevs]);
>> if (ret == -ENODEV)
>
> --
> 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
>
next prev parent reply other threads:[~2014-05-13 11:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-13 9:05 [PATCH] Btrfs-progs: save us an unnecessary ioctl call Wang Shilong
2014-05-13 9:05 ` [PATCH] Btrfs: set right total device count for seeding support Wang Shilong
2014-05-16 14:14 ` Anand Jain
2014-05-16 14:44 ` Anand Jain
2014-05-16 14:50 ` Shilong Wang
2014-05-16 15:06 ` Anand Jain
2014-05-16 14:45 ` Shilong Wang
2014-05-13 10:48 ` [PATCH] Btrfs-progs: save us an unnecessary ioctl call Stefan Behrens
2014-05-13 11:26 ` Wang Shilong [this message]
2014-05-14 5:32 ` Anand Jain
2014-05-15 17:06 ` David Sterba
2014-05-16 4:32 ` Anand Jain
2014-05-16 4:58 ` Wang Shilong
2014-05-16 12:14 ` David Sterba
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=5372015D.4070901@cn.fujitsu.com \
--to=wangsl.fnst@cn.fujitsu.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=sbehrens@giantdisaster.de \
/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).