Re: [PATCH] mtd:Fix issue where write_cached_data() fails but write() still returns success

From: Miquel Raynal
Date: Tue Mar 24 2020 - 18:05:39 EST


On Fri, 2020-03-20 at 03:15:11 UTC, Xiaoming Ni wrote:
> mtdblock_flush()
> -->write_cached_data()
> --->erase_write()
> mtdblock: erase of region [0x40000, 0x20000] on "xxx" failed
>
> Because mtdblock_flush() always returns 0,
> even if write_cached_data() fails and data is not written to the device,
> syscall_write() still returns success
>
> Signed-off-by: Xiaoming Ni <nixiaoming@xxxxxxxxxx>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel