dm thin: fix to consistently zero-fill reads to unprovisioned blocks
authorSasha Levin <sasha.levin@oracle.com>
Fri, 10 Apr 2015 00:13:50 +0000 (20:13 -0400)
committerSasha Levin <sasha.levin@oracle.com>
Fri, 17 Apr 2015 00:11:47 +0000 (20:11 -0400)
commit58533aeccead3c0a2a1d989f5e1df5f2d8c09702
tree381939b65bf089af06bde020258bad28241088ba
parent0f4687c37c09794b8f1d701edb1372149cedd2eb
dm thin: fix to consistently zero-fill reads to unprovisioned blocks

[ Upstream commit 5f027a3bf184d1d36e68745f7cd3718a8b879cc0 ]

It was always intended that a read to an unprovisioned block will return
zeroes regardless of whether the pool is in read-only or read-write
mode.  thin_bio_map() was inconsistent with its handling of such reads
when the pool is in read-only mode, it now properly zero-fills the bios
it returns in response to unprovisioned block reads.

Eliminate thin_bio_map()'s special read-only mode handling of -ENODATA
and just allow the IO to be deferred to the worker which will result in
pool->process_bio() handling the IO (which already properly zero-fills
reads to unprovisioned blocks).

Reported-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/md/dm-thin.c