summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/loop.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a5f993ac28dd..e5a051577a5e 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;