mtd: blkdevs: Fix mtd block write failure

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Aug 12 14:59:02 PDT 2017


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=9a51544774a57fcb94994a61860a17f9e63a8d7b
Commit:     9a51544774a57fcb94994a61860a17f9e63a8d7b
Parent:     33983675fbd5b2447430c3dd4c205e879576b475
Author:     Abhishek Sahu <absahu at codeaurora.org>
AuthorDate: Wed Aug 2 18:03:05 2017 +0530
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Sat Aug 12 14:53:24 2017 -0700

    mtd: blkdevs: Fix mtd block write failure
    
    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 at codeaurora.org>
    Signed-off-by: Brian Norris <computersforpeace at gmail.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;
 	}



More information about the linux-mtd-cvs mailing list