• Joe Thornber's avatar
    dm thin: fix to consistently zero-fill reads to unprovisioned blocks · 5f027a3b
    Joe Thornber authored
    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: default avatarEric Sandeen <sandeen@redhat.com>
    Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    Cc: stable@vger.kernel.org
dm-thin.c 102 KB