blk_dwrite() returns the number of blocks written. The code was only checking if the return value was different than 0. Hence, partial writes were considered successful. Fix blk_dwrite error handling by checking that all blocks are written. Signed-off-by: Francois Berder <fberder@outlook.fr> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Link: https://patch.msgid.link/BESP194MB2805BBD03E7C92727F116585DA0D2@BESP194MB2805.EURP194.PROD.OUTLOOK.COM Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>