From: Anand Jain <anand.jain@oracle.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/4] btrfs: get device pointer from device_list_add()
Date: Wed, 10 Jan 2018 21:26:12 +0800 [thread overview]
Message-ID: <16faaf35-238e-fb6f-e33f-0c01f0011068@oracle.com> (raw)
In-Reply-To: <a5fdc40b-43fe-d4d9-3154-fec9855d3a76@suse.com>
>> @@ -742,7 +741,7 @@ static noinline int device_list_add(const char *path,
>> if (!fs_devices) {
>> fs_devices = alloc_fs_devices(disk_super->fsid);
>> if (IS_ERR(fs_devices))
>> - return PTR_ERR(fs_devices);
>> + return ERR_PTR(PTR_ERR(fs_devices));
>
> No need to do any conversion, alloc_fs_devices already returns ERR_PTR
> value so plain return fs_devices suffices.
'return fs_devices;' will get compile time warn as the
function return is of type btrfs_device *.
>>
>> list_add(&fs_devices->list, &fs_uuids);
>>
>> @@ -754,19 +753,19 @@ static noinline int device_list_add(const char *path,
>>
>> if (!device) {
>> if (fs_devices->opened)
>> - return -EBUSY;
>> + return ERR_PTR(-EBUSY);
>>
>> device = btrfs_alloc_device(NULL, &devid,
>> disk_super->dev_item.uuid);
>> if (IS_ERR(device)) {
>> /* we can safely leave the fs_devices entry around */
>> - return PTR_ERR(device);
>> + return ERR_PTR(PTR_ERR(device));
> Ditto
Here I will fix.
Thanks, Anand
next prev parent reply other threads:[~2018-01-10 13:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-10 5:16 [PATCH v3 0/4] device_list_add() peparation to add reappearing missing device Anand Jain
2018-01-10 5:16 ` [PATCH 1/4] btrfs: move pr_info into device_list_add Anand Jain
2018-01-10 5:16 ` [PATCH 2/4] btrfs: set the total_devices in device_list_add() Anand Jain
2018-01-10 5:16 ` [PATCH 3/4] btrfs: get device pointer from device_list_add() Anand Jain
2018-01-10 8:48 ` Nikolay Borisov
2018-01-10 13:26 ` Anand Jain [this message]
2018-01-10 5:16 ` [PATCH 4/4] btrfs: drop devid as device_list_add() arg Anand Jain
-- strict thread matches above, loose matches on Subject: below --
2018-01-22 13:29 [PATCH v5 0/4] device_list_add() peparation to add reappearing missing device Anand Jain
2018-01-22 13:29 ` [PATCH 3/4] btrfs: get device pointer from device_list_add() Anand Jain
2018-01-18 14:02 [PATCH RESEND v4 0/4] device_list_add() peparation to add reappearing missing device Anand Jain
2018-01-18 14:02 ` [PATCH 3/4] btrfs: get device pointer from device_list_add() Anand Jain
2018-01-10 22:53 [PATCH v4 0/4] device_list_add() peparation to add reappearing missing device Anand Jain
2018-01-10 22:53 ` [PATCH 3/4] btrfs: get device pointer from device_list_add() Anand Jain
2018-01-10 1:49 [PATCH V2 0/4] device_list_add() peparation to add reappearing missing device Anand Jain
2018-01-10 1:49 ` [PATCH 3/4] btrfs: get device pointer from device_list_add() Anand Jain
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=16faaf35-238e-fb6f-e33f-0c01f0011068@oracle.com \
--to=anand.jain@oracle.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.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).