Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934021AbbDUQcA (ORCPT ); Tue, 21 Apr 2015 12:32:00 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:57042 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754841AbbDUPc0 (ORCPT ); Tue, 21 Apr 2015 11:32:26 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Joe Thornber , Mike Snitzer , Luis Henriques Subject: [PATCH 3.16.y-ckt 003/144] dm thin: fix to consistently zero-fill reads to unprovisioned blocks Date: Tue, 21 Apr 2015 16:29:48 +0100 Message-Id: <1429630329-21748-4-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429630329-21748-1-git-send-email-luis.henriques@canonical.com> References: <1429630329-21748-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2022 Lines: 55 3.16.7-ckt10 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Joe Thornber commit 5f027a3bf184d1d36e68745f7cd3718a8b879cc0 upstream. 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 Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer [ luis: backported to 3.16: adjusted context ] Signed-off-by: Luis Henriques --- drivers/md/dm-thin.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index add44f5a87b1..7924c3987cde 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -1938,17 +1938,6 @@ static int thin_bio_map(struct dm_target *ti, struct bio *bio) return DM_MAPIO_REMAPPED; case -ENODATA: - if (get_pool_mode(tc->pool) == PM_READ_ONLY) { - /* - * This block isn't provisioned, and we have no way - * of doing so. - */ - handle_unserviceable_bio(tc->pool, bio); - cell_defer_no_holder_no_free(tc, &cell1); - return DM_MAPIO_SUBMITTED; - } - /* fall through */ - case -EWOULDBLOCK: /* * In future, the failed dm_thin_find_block above could -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/