From: Wenlin Kang <wenlin.kang@windriver.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: dwmw2@infradead.org, linux-mtd@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mtd: blktrans: change blktrans_getgeo rerurn value
Date: Thu, 21 May 2015 16:01:40 +0800 [thread overview]
Message-ID: <555D90E4.6050403@windriver.com> (raw)
In-Reply-To: <20150521073741.GE11112@norris-Latitude-E6410>
On 2015年05月21日 15:37, Brian Norris wrote:
> On Thu, May 21, 2015 at 02:49:38PM +0800, Wenlin Kang wrote:
>> On 2015年05月21日 03:47, nick wrote:
>>> On 2015-05-20 03:33 PM, Brian Norris wrote:
>>>> On Wed, May 13, 2015 at 02:29:16PM +0800, Wenlin Kang wrote:
>>>>> Modify function blktrans_getgeo()'s return value to -ENXIO when
>>>>> dev->tr->getgeo == NULL.
>>>>>
>>>>> We shouldn't make the return value to 0 when dev->tr->getgeo == NULL,
>>>>> because the function blktrans_getgeo() has an output value "hd_geometry"
>>>>> which is usually used by some application, if return 0, it will make some
>>>>> application get the wrong information.
>>>>>
>>>>> Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
>>>>> ---
>>>>> drivers/mtd/mtd_blkdevs.c | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
>>>>> index 2b0c5287..f8bb16e 100644
>>>>> --- a/drivers/mtd/mtd_blkdevs.c
>>>>> +++ b/drivers/mtd/mtd_blkdevs.c
>>>>> @@ -273,7 +273,7 @@ static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo)
>>>>> if (!dev->mtd)
>>>>> goto unlock;
>>>>> - ret = dev->tr->getgeo ? dev->tr->getgeo(dev, geo) : 0;
>>>>> + ret = dev->tr->getgeo ? dev->tr->getgeo(dev, geo) : -ENXIO;
>>>> Good catch. I don't think ENXIO is correct in this case, though. Maybe
>>>> -EOPNOTSUPP or -ENOSYS? The latter might make more sense I guess.
>>>>
>>> I would recommend -EOPNOTSUPP as this as nothing to do with unimplemented
>>> functions or hardware support. This is just unsupported due to the value
>>> being NULL and therefore the hardware support is not there.
>>> Just My Option,
>>> Nick
>> As you said, -EOPNOTSUPP might be better,thanks.
> Nick's opinion is irrelevant here:
>
> https://lkml.org/lkml/2014/8/4/206
>
>> I have remade the patch and attached it, would you please check it
>> again? thanks.
> Please send patches inline (e.g., via git-send-email), not as
> attachments. But this is pretty trivial, and it's what I already tested.
>
> So, applied to l2-mtd.git.
>
> Brian
>
OK, thanks, I have resent the patch to you and list by git send-email,
please check it.
--
Thanks,
Wenlin Kang
WARNING: multiple messages have this Message-ID (diff)
From: Wenlin Kang <wenlin.kang@windriver.com>
To: Brian Norris <computersforpeace@gmail.com>
Cc: <linux-mtd@lists.infradead.org>, <dwmw2@infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: blktrans: change blktrans_getgeo rerurn value
Date: Thu, 21 May 2015 16:01:40 +0800 [thread overview]
Message-ID: <555D90E4.6050403@windriver.com> (raw)
In-Reply-To: <20150521073741.GE11112@norris-Latitude-E6410>
On 2015年05月21日 15:37, Brian Norris wrote:
> On Thu, May 21, 2015 at 02:49:38PM +0800, Wenlin Kang wrote:
>> On 2015年05月21日 03:47, nick wrote:
>>> On 2015-05-20 03:33 PM, Brian Norris wrote:
>>>> On Wed, May 13, 2015 at 02:29:16PM +0800, Wenlin Kang wrote:
>>>>> Modify function blktrans_getgeo()'s return value to -ENXIO when
>>>>> dev->tr->getgeo == NULL.
>>>>>
>>>>> We shouldn't make the return value to 0 when dev->tr->getgeo == NULL,
>>>>> because the function blktrans_getgeo() has an output value "hd_geometry"
>>>>> which is usually used by some application, if return 0, it will make some
>>>>> application get the wrong information.
>>>>>
>>>>> Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
>>>>> ---
>>>>> drivers/mtd/mtd_blkdevs.c | 2 +-
>>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
>>>>> index 2b0c5287..f8bb16e 100644
>>>>> --- a/drivers/mtd/mtd_blkdevs.c
>>>>> +++ b/drivers/mtd/mtd_blkdevs.c
>>>>> @@ -273,7 +273,7 @@ static int blktrans_getgeo(struct block_device *bdev, struct hd_geometry *geo)
>>>>> if (!dev->mtd)
>>>>> goto unlock;
>>>>> - ret = dev->tr->getgeo ? dev->tr->getgeo(dev, geo) : 0;
>>>>> + ret = dev->tr->getgeo ? dev->tr->getgeo(dev, geo) : -ENXIO;
>>>> Good catch. I don't think ENXIO is correct in this case, though. Maybe
>>>> -EOPNOTSUPP or -ENOSYS? The latter might make more sense I guess.
>>>>
>>> I would recommend -EOPNOTSUPP as this as nothing to do with unimplemented
>>> functions or hardware support. This is just unsupported due to the value
>>> being NULL and therefore the hardware support is not there.
>>> Just My Option,
>>> Nick
>> As you said, -EOPNOTSUPP might be better,thanks.
> Nick's opinion is irrelevant here:
>
> https://lkml.org/lkml/2014/8/4/206
>
>> I have remade the patch and attached it, would you please check it
>> again? thanks.
> Please send patches inline (e.g., via git-send-email), not as
> attachments. But this is pretty trivial, and it's what I already tested.
>
> So, applied to l2-mtd.git.
>
> Brian
>
OK, thanks, I have resent the patch to you and list by git send-email,
please check it.
--
Thanks,
Wenlin Kang
next prev parent reply other threads:[~2015-05-21 8:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-13 6:29 [PATCH] mtd: blktrans: change blktrans_getgeo rerurn value Wenlin Kang
2015-05-13 6:29 ` Wenlin Kang
2015-05-20 19:33 ` Brian Norris
2015-05-20 19:33 ` Brian Norris
2015-05-20 19:47 ` nick
2015-05-21 6:49 ` Wenlin Kang
2015-05-21 6:49 ` Wenlin Kang
2015-05-21 7:37 ` Brian Norris
2015-05-21 7:37 ` Brian Norris
2015-05-21 8:01 ` Wenlin Kang [this message]
2015-05-21 8:01 ` Wenlin Kang
2015-05-21 7:56 ` Richard Weinberger
2015-05-21 7:56 ` Richard Weinberger
2015-05-21 8:05 ` Brian Norris
2015-05-21 8:05 ` Brian Norris
2015-05-21 8:22 ` Wenlin Kang
2015-05-21 8:22 ` Wenlin Kang
2015-05-21 10:17 ` Richard Weinberger
2015-05-21 10:17 ` Richard Weinberger
2015-05-21 17:54 ` [PATCH] mtd: blktrans: use better error code for unimplemented ioctl() Brian Norris
2015-05-21 17:54 ` Brian Norris
2015-05-27 19:15 ` Brian Norris
2015-05-27 19:15 ` Brian Norris
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=555D90E4.6050403@windriver.com \
--to=wenlin.kang@windriver.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.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.