Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3419756rwa; Tue, 23 Aug 2022 04:36:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6MHoVgey5wIFdPml9rlbGwyi1IV72cSrK8VD2A9bzQDyybyCDUvJ7VdooLAr85pbpjbEc1 X-Received: by 2002:a17:902:f610:b0:172:990e:33cd with SMTP id n16-20020a170902f61000b00172990e33cdmr23732593plg.145.1661254118955; Tue, 23 Aug 2022 04:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254118; cv=none; d=google.com; s=arc-20160816; b=r0QF91tP8CfHJRQlTmbhErdIHtYBUd9oi8QWxGxJZqMefDajKGeGdt+Z8doBfncXdS 3Nu0Xk29dj5IkshPHLsV/hLdQYG8JGgsp6ah9W2NOUMybavokb/dxAE8syXdp6C0UubO o7TJljADPaJ5QxTTjXMRhZdypQkl0iA3pDJJhTVCI6E34FTa9vfz8tTd/N7K4g3vG5rg aFwfhQrozDlDyBvpmzuKPQcoqo0FpS2uUd/WyxYb4JZ/DYgFHtSOo8KP84hrj540/AyB qKrSg1ag66LPoqqI/974/WGd35Z0Efm0brftS16I0FFdoaoH4IVrsG076/3/LQRG1u0x pdgQ== 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=GWhDjkl2Wdm36HsBPF8Y2m4Ts8GYEZifk1DusRf5ULc=; b=GiqDEk8/pDqEn+i7beFeFrOjieRx5p8VOA9vezP0eaUaqACBiekzktMUkZEjTWlXS3 /exRpTTdtRDdoe+2W83X2IHPPAdvp6Qle9JMg9tN+SxE/TuajisKh7uuT7/pi69PnX57 mF7lEdH8Wy+FclBgFHxbpciG32EtsMdw0wHbv9/sEGKNC9yC08QiaaNuzLXjy4e1eAC2 afaqO/pmF/0H4xDi71BCYyl3Ft19ishbpOAl9JDMirIM4o/wazT5eQKULawWtHmHgMxE JxXoTGNhSD0t6p1R2VYrViqtK93DM5weFGIqZPCM9fsjWwJYQUOgAagCvVzj0MBcjz3e 1dDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jp9YTX2U; 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 k4-20020a654344000000b003ab358a4d44si14345144pgq.199.2022.08.23.04.28.27; Tue, 23 Aug 2022 04:28:38 -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=jp9YTX2U; 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 S1355337AbiHWKio (ORCPT + 99 others); Tue, 23 Aug 2022 06:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354710AbiHWKWF (ORCPT ); Tue, 23 Aug 2022 06:22:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20BF56440; Tue, 23 Aug 2022 02:03: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 dfw.source.kernel.org (Postfix) with ESMTPS id 1895561499; Tue, 23 Aug 2022 09:03:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 232D8C433C1; Tue, 23 Aug 2022 09:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245405; bh=EeBB5HggqEsJGqx0uHZ8rWSlljvoPfmqgZe5hO3GUs4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jp9YTX2U8bPrgbMdnSNQP16OJUyWmQVX3PsakaECt2QJwHiacrtT1pPL3zU+FaaK4 +04Y4TDLCr/U37gQOAcEz2Ag2lIOcufcT0R5kb2ljtvxWlQbtxs8jD/ebovhiF966y U5Q/NFibQLP6D7m4vRr77wlLOmXlnZNOLnTKYtV4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Snitzer , Sasha Levin Subject: [PATCH 4.19 067/287] dm: return early from dm_pr_call() if DM device is suspended Date: Tue, 23 Aug 2022 10:23:56 +0200 Message-Id: <20220823080102.485958853@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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 d2ee97cd7d14..324d1dd58e2b 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -3122,6 +3122,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