summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-08 21:17:20 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-03-08 21:17:20 -0300
commiteccbe858ce6412b96fc7cb32eb23a3592f64e5f6 (patch)
treeed4f0e52d266bffc68a5b68afcfe69882b917efb /block
parent0c1ac6822620b9868cfad5b4c2c223c6cd6fbfd8 (diff)
Linux-libre 4.4.4-gnupck-4.4.4-gnu
Diffstat (limited to 'block')
-rw-r--r--block/bio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/block/bio.c b/block/bio.c
index 4f184d938..d4d144363 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1090,9 +1090,12 @@ int bio_uncopy_user(struct bio *bio)
if (!bio_flagged(bio, BIO_NULL_MAPPED)) {
/*
* if we're in a workqueue, the request is orphaned, so
- * don't copy into a random user address space, just free.
+ * don't copy into a random user address space, just free
+ * and return -EINTR so user space doesn't expect any data.
*/
- if (current->mm && bio_data_dir(bio) == READ)
+ if (!current->mm)
+ ret = -EINTR;
+ else if (bio_data_dir(bio) == READ)
ret = bio_copy_to_iter(bio, bmd->iter);
if (bmd->is_our_pages)
bio_free_pages(bio);