Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2920063rwb; Mon, 15 Aug 2022 14:04:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ctgQ/Ut0tvb9BrhA4VrUymbmCF1sCWSiWh5Al6k4jweroK7ehbDYn4ifpGIrnQLEbRzd4 X-Received: by 2002:a17:907:94d2:b0:730:87c1:e86d with SMTP id dn18-20020a17090794d200b0073087c1e86dmr11937679ejc.37.1660597466184; Mon, 15 Aug 2022 14:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660597466; cv=none; d=google.com; s=arc-20160816; b=wlE4AMWamyLnEoA4dw13bux70mPhbgwy/Ql7l4jDLLJofhNTvAs9UW/PN9RVdHS0tx 7jEUdn9060KrY/hjzIAv4kTJSeEieY5oIqBOWWoP+rBqPg0jnDyXAB71a0i+4Df6r3Pw e6nfq/h9u3hGsLCHtQ1aSdpjj4Da+1LWqcnXzzyIegjD21WPZdu3GEyepSS3UwKT06aW 7APqoG3JzcrsyMZRy7QQuojuCn5AHHWKA7iVuYnDq/z3SXGSq62OhdhWx9KasW6ZXRIR gur8T3QqkQ4nvf4l9z2+zMLEC4ZYas3ne4PCyVAA/qlIvHn4F7ywCAf5ibZ1tiTvsnAx nEaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CQiEco0cH6OF+bKOEee/dZL+geW70QHpXXkvQ0GORRA=; b=OJAWTvtI/DCvjsezSyoQXnx5JPZX4UBso+nNhyDzPk323sdGcT0XVTEsUJNkihrLrU AA4OOoc4de+f/mPSdWXILGn2vBJNxoIdQ21HjruIxE32EdPrBPYkGnRJbakJrDfPVYO9 +jAdIyNuXDxBOvuQEmCbZuAAVkctvo+qG2MU8aA8VMjL7L+beoriZrK3ZNnUDjvMdtgA V11wh8Dr8v2FzxgD1muLxhDpqnp0mLiXjpuFJnMomDwL+YV0nJLNHtDa7TCpjRomxwoA Ya92GpGEDUOmfJl/NQbLyp1Orgn93sHM3/mDFv9YZ5HoKMjNSxHjsD99yq2sWbCF6d3l xpUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="uv7jK/gl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gg4-20020a170906898400b007330c08fe49si6358122ejc.206.2022.08.15.14.04.00; Mon, 15 Aug 2022 14:04:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="uv7jK/gl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243902AbiHOSrs (ORCPT + 99 others); Mon, 15 Aug 2022 14:47:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242039AbiHOSmg (ORCPT ); Mon, 15 Aug 2022 14:42:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEF4F2B62E; Mon, 15 Aug 2022 11:26:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 63AAEB8107B; Mon, 15 Aug 2022 18:26:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4425C433D6; Mon, 15 Aug 2022 18:26:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587984; bh=QHdUGgQf2J57RM/QS1DJ+baT8eAIsJdSK29InXdY5X0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uv7jK/glguqTyJJR3pTqlDm8iFLBOSj1Z7lp/XCFX1vE1pFchMHGHmau3WrLGHD3H r/FMry3AmwrNMQ8B6tqI20+Tp497Sikk44xWzOKSkP0vJFKS6OUqkNI/er7dK1xyfW KcNhhE//LaXOI635UYhqeW2izaH+wH1TZvz9QbtY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Snitzer , Sasha Levin Subject: [PATCH 5.15 227/779] dm: return early from dm_pr_call() if DM device is suspended Date: Mon, 15 Aug 2022 19:57:51 +0200 Message-Id: <20220815180346.997801237@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Snitzer [ Upstream commit e120a5f1e78fab6223544e425015f393d90d6f0d ] Otherwise PR ops may be issued while the broader DM device is being reconfigured, etc. Fixes: 9c72bad1f31a ("dm: call PR reserve/unreserve on each underlying device") Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 36449422e7e0..41d2e1285c07 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2911,6 +2911,11 @@ static int dm_call_pr(struct block_device *bdev, iterate_devices_callout_fn fn, goto out; ti = dm_table_get_target(table, 0); + if (dm_suspended_md(md)) { + ret = -EAGAIN; + goto out; + } + ret = -EINVAL; if (!ti->type->iterate_devices) goto out; -- 2.35.1