--- zzzz-none-000/linux-2.6.32.60/drivers/mtd/mtd_blkdevs.c 2012-10-07 21:41:24.000000000 +0000 +++ ur8-7270-606/linux-2.6.32.60/drivers/mtd/mtd_blkdevs.c 2013-10-07 15:08:30.000000000 +0000 @@ -56,18 +56,22 @@ switch(rq_data_dir(req)) { case READ: - for (; nsect > 0; nsect--, block++, buf += tr->blksize) - if (tr->readsect(dev, block, buf)) - return -EIO; + for (; nsect > 0; nsect--, block++, buf += tr->blksize) { + int ret = tr->readsect(dev, block, buf); + if (ret && (ret != -EUCLEAN)) + return ret; + } return 0; case WRITE: if (!tr->writesect) return -EIO; - for (; nsect > 0; nsect--, block++, buf += tr->blksize) - if (tr->writesect(dev, block, buf)) - return -EIO; + for (; nsect > 0; nsect--, block++, buf += tr->blksize) { + int ret = tr->writesect(dev, block, buf); + if (ret && (ret != -EUCLEAN)) + return ret; + } return 0; default: @@ -110,7 +114,7 @@ spin_lock_irq(rq->queue_lock); - if (!__blk_end_request_cur(req, res)) + if (!__blk_end_request_cur(req, (!res || (res == -EUCLEAN)) ? 0 : res)) req = NULL; }