Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1956281ima; Thu, 25 Oct 2018 07:32:56 -0700 (PDT) X-Google-Smtp-Source: AJdET5c0PCfRiDwgM0CxHmdx+saMhhSNQ+au7/EsZNRmooeD38bDHLOgy6UAaBJQVrTq1LayTlax X-Received: by 2002:a17:902:e81:: with SMTP id 1-v6mr1348854plx.48.1540477976587; Thu, 25 Oct 2018 07:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477976; cv=none; d=google.com; s=arc-20160816; b=pywWA26qZz5k35vocolwgETEzJK/JOUjwwBJLmJF7umHE1DjBdTxORQNlH3Cu3nEsi JoO2gOdPo2HUpbqCGdGgR0+klY3/LSlTk9DgdNxRk7Jt2jv5SIjd44hU7HJNNZsfr3mU 8PrDXsXLYYZRBNzVxqwDTUVjWAJBWuV0AUIpkV2C2CRrPWSOgVHbm1yfDr6sTr3BrX7/ V4EqBZGNUEV7HwszWMz5bh6iPvxjS0G8T6aRYb6yZ65IPaoNPRGlbZJAkiK5kxnqpB2G Sb139tzp29qs36figqtKQYpB49czfQtHOX4KE75x9gwbaMXZcMHUM6JEXcttbJ4a/aTs 3k8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=HZf68Hi88wJSo+awIMdEflgxRrTQ2mAR/sphNbiRpqc=; b=ED5GIX422weHrx/N4oeu5u9tgxPXAxl/vBsJ76pE11uzwrMtL8dc9Bsne3fRU57wtv 7keCM+eI9P2i9SANi4/WITa50OPuABfgn/p+QdkCJtXTqmVgJRstspZq4y0emUGJQr4+ jgswviYztemF4G/Ze1zg3coX4Esm45AKnY+WQHGsVAM8PEJ3i9juwPndgUFOoQYvNmd+ nNHJ4vk/XzwKugAexUPHJqlCl+U3vH8e/yrSMf/iE2MyGDWmfsYiv6fZ8aT7GVthJr3T vSYYxxNi88O0wS2IloHTwiWiv6JtwqrQzInhoP3Zwqn5w3kMftNjW4kEnVrdsfId81R+ kiAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DZkriySr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1-v6si7808587pgv.349.2018.10.25.07.32.23; Thu, 25 Oct 2018 07:32:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DZkriySr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728088AbeJYWv6 (ORCPT + 99 others); Thu, 25 Oct 2018 18:51:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:33766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727979AbeJYWv5 (ORCPT ); Thu, 25 Oct 2018 18:51:57 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 889FB20834; Thu, 25 Oct 2018 14:18:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540477140; bh=X2F1ddpW/cHBJAuyRJJ8YajEfKByzGL8STVjE7OVe2M=; h=From:To:Cc:Subject:Date:From; b=DZkriySrwkJL54amfxrRc7lZ9JGDWOuMrexNL2Mwxe54INzRgnkiCOm3WS1XIoeT2 GxzW+TurD4Oj5uNwWlRNB9FF0oQoh6zm+l+1Wj2gObtVGawtq+7N/djmFw0SP2Evmv kSL15Ft2NHzISW2jNTyZ8vepS15JerDVtgb2yrC0= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mike Snitzer , Sasha Levin Subject: [PATCH AUTOSEL 3.18 01/98] dm thin: restore requested 'error_if_no_space' setting on OODS to WRITE transition Date: Thu, 25 Oct 2018 10:17:16 -0400 Message-Id: <20181025141853.214051-1-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Snitzer [ Upstream commit 172c238612ebf81cabccc86b788c9209af591f61 ] A thin-pool that is in out-of-data-space (OODS) mode may transition back to write mode -- without the admin adding more space to the thin-pool -- if/when blocks are released (either by deleting thin devices or discarding provisioned blocks). But as part of the thin-pool's earlier transition to out-of-data-space mode the thin-pool may have set the 'error_if_no_space' flag to true if the no_space_timeout expires without more space having been made available. That implementation detail, of changing the pool's error_if_no_space setting, needs to be reset back to the default that the user specified when the thin-pool's table was loaded. Otherwise we'll drop the user requested behaviour on the floor when this out-of-data-space to write mode transition occurs. Reported-by: Vivek Goyal Signed-off-by: Mike Snitzer Acked-by: Joe Thornber Fixes: 2c43fd26e4 ("dm thin: fix missing out-of-data-space to write mode transition if blocks are released") Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin --- drivers/md/dm-thin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 68c7102a64c8..936c57b57539 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c @@ -1909,6 +1909,7 @@ static void set_pool_mode(struct pool *pool, enum pool_mode new_mode) case PM_WRITE: if (old_mode != new_mode) notify_of_pool_mode_change(pool, "write"); + pool->pf.error_if_no_space = pt->requested_pf.error_if_no_space; dm_pool_metadata_read_write(pool->pmd); pool->process_bio = process_bio; pool->process_discard = process_discard; -- 2.17.1