Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3027394rwb; Mon, 15 Aug 2022 16:25:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR41A0u+obQpgm5kfFdjweIwvYb1X1pAStdBW4U8mjjAClSCy4Dd02v+7Tq4FGTnYakTbqga X-Received: by 2002:a17:90a:df14:b0:1f3:3a50:9dc1 with SMTP id gp20-20020a17090adf1400b001f33a509dc1mr20467650pjb.139.1660605944548; Mon, 15 Aug 2022 16:25:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605944; cv=none; d=google.com; s=arc-20160816; b=cD8Q0GTz+SPAx4eUKDuwK1CTiV+TFR2Y/nnew3dTgun3Ar0k/6qnwH6dghBwBF8Kux wSA4mBzUBCrChTyndiLfJvyfkOtGPoOT15nerrgOFZQ5j2ZlvgNAOzZBEDJj0UTMiunk 7AURq4oejBgehyTZmf17maqZ78B5aUWYfsJkFfefrrWSifPGCj6tZSsR+hqPbggnk2zZ WsPB5VHNXnmpODmsgpYW0XbVLCk9dV/IchZ59FdsV9clOl894XErv1ZzXvfEzYZyHsBd qGxgr8na9wttWsmiVPttDdebVnqSiPEG3px6xRh3FV6VTjrYDqQAl+cRRNTgZSnRouLd UNig== 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=eux+aFbQ9b5Jr7hQRAHVyenwxiZF/eJY+7/VRPh9gnw=; b=g9L6U6g9UCoUSY5QDKpvO1k2IL3jnW7Ch+zOGqrn98s1UUEq//VRpBUvoVXswdJJiO I6NHEXkiEYbPsJ2C7sUq+SMfb0hxGPUcvkdswk6wJQx+wTCOV0Gt/TafNdiXRuXJ2Lk+ nii+FsKRcQBFDVQGJu73JUaF0BkgNFKZlOzp43UhcDOmIjcRGmRXTosOzB7nk81JqZtD 00ZpaNoN6t6f+vZ5u9299Rydca1C03huZQQmqr85okEBui5TnG0wghjV6g/03zRZT3bF tJTv6viF81c/TD527GfO1QgXzavV6QI99uXzvKH6TvOw1cNOcMLhDAAjjbp0AcIzFi/D hvkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C4xCYohu; 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 b2-20020a056a00114200b0052dccbf4079si12637814pfm.220.2022.08.15.16.25.33; Mon, 15 Aug 2022 16:25:44 -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=C4xCYohu; 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 S1346113AbiHOXNW (ORCPT + 99 others); Mon, 15 Aug 2022 19:13:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346501AbiHOXM1 (ORCPT ); Mon, 15 Aug 2022 19:12:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CB564F6A5; Mon, 15 Aug 2022 13:00:31 -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 242AE61226; Mon, 15 Aug 2022 20:00:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27AD4C4347C; Mon, 15 Aug 2022 20:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593630; bh=Z7UlqukebFuVLq80n+Ua2EWCCAvah8jL9gd5gLz6sek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C4xCYohuMnG0pS5y1jLrpoV6/KKK7a7oISRUVtPeVKp2116zlhaNCRABQOvtXW2aV hgI0z8qG5uHymYrAomHToQZXwkp6fJXsKUXCB9DGMH71YbW1i5pOcMrEu75bRNsRAP JL25Je1S3UhKAOYnTiNIWyri6XhKbaSAMXB5A0ys= 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.19 0299/1157] dm: return early from dm_pr_call() if DM device is suspended Date: Mon, 15 Aug 2022 19:54:15 +0200 Message-Id: <20220815180451.609414372@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 2b75f1ef7386..7c5d4734f109 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -3066,6 +3066,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