Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752298AbdHLVyn (ORCPT ); Sat, 12 Aug 2017 17:54:43 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:38364 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbdHLVyl (ORCPT ); Sat, 12 Aug 2017 17:54:41 -0400 Date: Sat, 12 Aug 2017 14:54:38 -0700 From: Brian Norris To: Abhishek Sahu Cc: Boris Brezillon , dwmw2@infradead.org, marek.vasut@gmail.com, richard@nod.at, cyrille.pitchen@wedev4u.fr, linux-arm-msm@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Jens Axboe Subject: Re: [PATCH] mtd: blkdevs: Fix mtd block write failure Message-ID: <20170812215438.GB90795@google.com> References: <1501677185-1308-1-git-send-email-absahu@codeaurora.org> <20170803171004.3fbab4a7@bbrezillon> <58e5bfdfe27ac2f4aacacd40328772bf@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <58e5bfdfe27ac2f4aacacd40328772bf@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1846 Lines: 59 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 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 > > > >Acked-by: Boris Brezillon > > > > 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; > >> }