diff options
Diffstat (limited to 'block/bio.c')
-rw-r--r-- | block/bio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/block/bio.c b/block/bio.c index 4441522ca339..cbce3e2208f4 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1122,9 +1122,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); |