Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2930616rwb; Mon, 15 Aug 2022 14:16:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR6jhieCCkMPirPkkouPGxFYWwJ9r+mbDo+cF9urUjJFVKKwOyaKKX7e3FT3f+FfT5fBxkSm X-Received: by 2002:a17:902:8486:b0:171:48cd:1356 with SMTP id c6-20020a170902848600b0017148cd1356mr18107630plo.153.1660598097465; Mon, 15 Aug 2022 14:14:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598097; cv=none; d=google.com; s=arc-20160816; b=J42QFfx9OmnWjXQwU1Xix93pwlkUQZdxH5sSM65blpRCXa6ndf73iYlPEBTeQlFR3q 3OQaluMJtQjY2prwx8t9LJoZMAfhEubZWSYdAMu+B8XTT4zdeup8jqK0n+74+FK5B2Fq ERP3MGBIsXig6OxkmAwaXBqdtEoaqKaHG75fBrHYBaRegt2RS/kGMonY7zhxBT6mqluU ZLFQlvoNyc+uEnEt8ydTz3qyaurJ631BVPR9WnhjGI8aY3ECm3FG/ABrmVn/i8GYqA1R Ht8kMvqCLb7n3nlJD7IZdCeaVjU8sr/9SUAMrnFrPEYjiiFFfbYEGSg9V1z8hvf34dV8 +V5g== 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=8HNHoXPlcEY/BJ8J89fSHT5UNAKvUfmX0sA29ixFpRM=; b=OmS3fDie+FVYJpSJBcSDdHRmHEkPL6JAkRb4kJj48Qe79vO3XeuxFVKytwrXjRDG9o dLSmQaO7mP0wu5G51uAHo/AsBX+fg+OhZa5kXNJW7XytbstH9UDMjNk6PRanlSSRw7RA QDTWboGvwxy5nvbgWc7SIsKrxRBnDCpsv/WvVHPw/wTnsPBl184pSHsMPRizenwGTH7T MqkPsxDvpk0x3gXooCGdBiP1Bok7YjDzv7WPuOURx5zalmkK7I0qI0WP5S9zUv7/WDK9 hopBEC0nokhRmgqW1y/QKo/UOv/kxwaRdK0XLu0dQ6qvgObQ8D3PHREwtQUt6ZfvgChW NSEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KKn8DHCg; 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 l12-20020a170902f68c00b0016daefb1c72si13980154plg.263.2022.08.15.14.14.44; Mon, 15 Aug 2022 14:14:57 -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=KKn8DHCg; 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 S243187AbiHOUyh (ORCPT + 99 others); Mon, 15 Aug 2022 16:54:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346758AbiHOUyD (ORCPT ); Mon, 15 Aug 2022 16:54:03 -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 9F1663A4A5; Mon, 15 Aug 2022 12:10:54 -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 337B160EEE; Mon, 15 Aug 2022 19:10:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 242B4C433D7; Mon, 15 Aug 2022 19:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590641; bh=MQPmSWW6qeTKmvxX5Idg4ZN9rJsHVGsA5UzbeucL58s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KKn8DHCgI1dbV5KK5J2/NtEQAQMDTXn3t90mZM29qedn27oUtvIHr0SFuT32YTDDe 5yyLAYJCv7adyZtXS1JrtJCG/x8Ad4YWhVNSQ69sptdmpaOHL/hhOmbkluvUys1Veu PwBSle+NlyKDLiMyz6atAllrwaSTA02AvFNLD/c4= 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.18 0297/1095] dm: return early from dm_pr_call() if DM device is suspended Date: Mon, 15 Aug 2022 19:54:56 +0200 Message-Id: <20220815180442.052684666@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 f01d33bc3613..e0e28a3203f8 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -2955,6 +2955,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