diff --git a/drivers/block/loop.c b/drivers/block/loop.c index a5f993ac28ddce4e4bf670b06ebc8c321011bdc3..e5a051577a5e617008f263b8cb5c9f914e1fe6a7 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -245,10 +245,8 @@ static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec, ret = pagecache_write_end(file, mapping, pos, size, copied, page, fsdata); - if (ret < 0) + if (ret < 0 || ret != copied) goto fail; - if (ret < copied) - copied = ret; if (unlikely(transfer_result)) goto fail;