aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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,
245 245
246 ret = pagecache_write_end(file, mapping, pos, size, copied, 246 ret = pagecache_write_end(file, mapping, pos, size, copied,
247 page, fsdata); 247 page, fsdata);
248 if (ret < 0) 248 if (ret < 0 || ret != copied)
249 goto fail; 249 goto fail;
250 if (ret < copied)
251 copied = ret;
252 250
253 if (unlikely(transfer_result)) 251 if (unlikely(transfer_result))
254 goto fail; 252 goto fail;