linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: blkdevs: Fix mtd block write failure
@ 2017-08-02 12:33 Abhishek Sahu
  2017-08-03 15:10 ` Boris Brezillon
  0 siblings, 1 reply; 4+ messages in thread
From: Abhishek Sahu @ 2017-08-02 12:33 UTC (permalink / raw)
  To: dwmw2, computersforpeace, boris.brezillon, marek.vasut, richard,
	cyrille.pitchen
  Cc: linux-mtd, linux-kernel, linux-arm-msm, Abhishek Sahu

All the MTD block write requests are failing with
following error messages

    mkfs.ext4  /dev/mtdblock0

    print_req_error: I/O error, dev mtdblock0, sector 0
    Buffer I/O error on dev mtdblock0, logical block 0,
    lost async page write

The control is going to default case after block write request
because of missing return.

Fixes: commit 2a842acab109 ("block: introduce new block status code type")
Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
---
 drivers/mtd/mtd_blkdevs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index f336a9b..9ec8f03 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -113,6 +113,7 @@ static blk_status_t do_blktrans_request(struct mtd_blktrans_ops *tr,
 		for (; nsect > 0; nsect--, block++, buf += tr->blksize)
 			if (tr->writesect(dev, block, buf))
 				return BLK_STS_IOERR;
+		return BLK_STS_OK;
 	default:
 		return BLK_STS_IOERR;
 	}
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: blkdevs: Fix mtd block write failure
  2017-08-02 12:33 [PATCH] mtd: blkdevs: Fix mtd block write failure Abhishek Sahu
@ 2017-08-03 15:10 ` Boris Brezillon
  2017-08-04 20:14   ` Abhishek Sahu
  0 siblings, 1 reply; 4+ messages in thread
From: Boris Brezillon @ 2017-08-03 15:10 UTC (permalink / raw)
  To: Abhishek Sahu
  Cc: dwmw2, computersforpeace, marek.vasut, richard, cyrille.pitchen,
	linux-arm-msm, linux-mtd, linux-kernel

On Wed,  2 Aug 2017 18:03:05 +0530
Abhishek Sahu <absahu@codeaurora.org> wrote:

> All the MTD block write requests are failing with
> following error messages
> 
>     mkfs.ext4  /dev/mtdblock0
> 
>     print_req_error: I/O error, dev mtdblock0, sector 0
>     Buffer I/O error on dev mtdblock0, logical block 0,
>     lost async page write
> 
> The control is going to default case after block write request
> because of missing return.
> 
> Fixes: commit 2a842acab109 ("block: introduce new block status code type")
> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>

> ---
>  drivers/mtd/mtd_blkdevs.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
> index f336a9b..9ec8f03 100644
> --- a/drivers/mtd/mtd_blkdevs.c
> +++ b/drivers/mtd/mtd_blkdevs.c
> @@ -113,6 +113,7 @@ static blk_status_t do_blktrans_request(struct mtd_blktrans_ops *tr,
>  		for (; nsect > 0; nsect--, block++, buf += tr->blksize)
>  			if (tr->writesect(dev, block, buf))
>  				return BLK_STS_IOERR;
> +		return BLK_STS_OK;
>  	default:
>  		return BLK_STS_IOERR;
>  	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: blkdevs: Fix mtd block write failure
  2017-08-03 15:10 ` Boris Brezillon
@ 2017-08-04 20:14   ` Abhishek Sahu
  2017-08-12 21:54     ` Brian Norris
  0 siblings, 1 reply; 4+ messages in thread
From: Abhishek Sahu @ 2017-08-04 20:14 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: dwmw2, computersforpeace, marek.vasut, richard, cyrille.pitchen,
	linux-arm-msm, linux-mtd, linux-kernel

On 2017-08-03 20:40, Boris Brezillon wrote:
> On Wed,  2 Aug 2017 18:03:05 +0530
> Abhishek Sahu <absahu@codeaurora.org> wrote:
> 
>> All the MTD block write requests are failing with
>> following error messages
>> 
>>     mkfs.ext4  /dev/mtdblock0
>> 
>>     print_req_error: I/O error, dev mtdblock0, sector 0
>>     Buffer I/O error on dev mtdblock0, logical block 0,
>>     lost async page write
>> 
>> The control is going to default case after block write request
>> because of missing return.
>> 
>> Fixes: commit 2a842acab109 ("block: introduce new block status code 
>> type")
>> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> 
> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> 

  Shall this patch be included for next RC since the MTD block
  write is broken in 4.13 and without this, all the writes to
  MTD block device will return failure.

>> ---
>>  drivers/mtd/mtd_blkdevs.c | 1 +
>>  1 file changed, 1 insertion(+)
>> 
>> diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
>> index f336a9b..9ec8f03 100644
>> --- a/drivers/mtd/mtd_blkdevs.c
>> +++ b/drivers/mtd/mtd_blkdevs.c
>> @@ -113,6 +113,7 @@ static blk_status_t do_blktrans_request(struct 
>> mtd_blktrans_ops *tr,
>>  		for (; nsect > 0; nsect--, block++, buf += tr->blksize)
>>  			if (tr->writesect(dev, block, buf))
>>  				return BLK_STS_IOERR;
>> +		return BLK_STS_OK;
>>  	default:
>>  		return BLK_STS_IOERR;
>>  	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mtd: blkdevs: Fix mtd block write failure
  2017-08-04 20:14   ` Abhishek Sahu
@ 2017-08-12 21:54     ` Brian Norris
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Norris @ 2017-08-12 21:54 UTC (permalink / raw)
  To: Abhishek Sahu
  Cc: Boris Brezillon, dwmw2, marek.vasut, richard, cyrille.pitchen,
	linux-arm-msm, linux-mtd, linux-kernel, Christoph Hellwig,
	Jens Axboe

Hi,

On Sat, Aug 05, 2017 at 01:44:26AM +0530, Abhishek Sahu wrote:
> On 2017-08-03 20:40, Boris Brezillon wrote:
> >On Wed,  2 Aug 2017 18:03:05 +0530
> >Abhishek Sahu <absahu@codeaurora.org> wrote:
> >
> >>All the MTD block write requests are failing with
> >>following error messages
> >>
> >>    mkfs.ext4  /dev/mtdblock0
> >>
> >>    print_req_error: I/O error, dev mtdblock0, sector 0
> >>    Buffer I/O error on dev mtdblock0, logical block 0,
> >>    lost async page write
> >>
> >>The control is going to default case after block write request
> >>because of missing return.
> >>
> >>Fixes: commit 2a842acab109 ("block: introduce new block status
> >>code type")

Looks like that never even went to the MTD list. Oh well, I still likely
wouldn't have reviewed it this closely :)

> >>Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
> >
> >Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> >
> 
>  Shall this patch be included for next RC since the MTD block
>  write is broken in 4.13 and without this, all the writes to
>  MTD block device will return failure.

Yes, applied to linux-mtd.git, and I'll try to get this out for 4.13.

> >>---
> >> drivers/mtd/mtd_blkdevs.c | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >>diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
> >>index f336a9b..9ec8f03 100644
> >>--- a/drivers/mtd/mtd_blkdevs.c
> >>+++ b/drivers/mtd/mtd_blkdevs.c
> >>@@ -113,6 +113,7 @@ static blk_status_t
> >>do_blktrans_request(struct mtd_blktrans_ops *tr,
> >> 		for (; nsect > 0; nsect--, block++, buf += tr->blksize)
> >> 			if (tr->writesect(dev, block, buf))
> >> 				return BLK_STS_IOERR;
> >>+		return BLK_STS_OK;

Ooh, that's a nasty one. No compiler warning, because it just falls back
to the 'default' case :(

Brian

> >> 	default:
> >> 		return BLK_STS_IOERR;
> >> 	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-12 21:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-02 12:33 [PATCH] mtd: blkdevs: Fix mtd block write failure Abhishek Sahu
2017-08-03 15:10 ` Boris Brezillon
2017-08-04 20:14   ` Abhishek Sahu
2017-08-12 21:54     ` Brian Norris

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).