X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=block%2Fbio.c;h=d4d144363250f7dfe2e2ed41ed9fca7425c18c0a;hb=4583509b4583d12e8e626a33e67e3849f4156499;hp=4f184d938942dcbbbbedbac3b330f6e4bb39a4a9;hpb=4bde961e5245bb37dab4831107bbed23e433d55a;p=firefly-linux-kernel-4.4.55.git diff --git a/block/bio.c b/block/bio.c index 4f184d938942..d4d144363250 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);