Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1129339rwb; Sat, 14 Jan 2023 14:51:04 -0800 (PST) X-Google-Smtp-Source: AMrXdXu1+g3FWSDH8VknbRaOvkz5oTZ/FUNv61065mEm5LWWTL4sWOwLDgfcB+0UFifJEMLkuMAn X-Received: by 2002:a17:902:eb4c:b0:192:feef:588 with SMTP id i12-20020a170902eb4c00b00192feef0588mr35249949pli.23.1673736664526; Sat, 14 Jan 2023 14:51:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673736664; cv=none; d=google.com; s=arc-20160816; b=hn8jFxEm7+DEoe08EPO6KdR6dBL2oA9vJGEpjqPAkYNacNtml61JPNaCb/LqGV83Ly EyZaafOTcTDaXzH7j5hMikTNzB4Hs+ngN1aBqiR+vtr+6u/lFVtKJAr1jLz9040GF9F5 mKULKh4eSczn6TZqIk3dxWB1hN+txyREygqeXvLYuMyxPQ/wH0VBNmAVprYAySvFZ+5k ixSuB2ZUFveNTaQFR6QOB1QFgxwoLf6fQX6IX+pWYRgRS+4xfx8i5/ABKd9wCOmHUJcH /r4NwKqwChQeRh+YMdTuWRMPxfMEYPdxLsA3N6uT2Eb9KElEGeyxQpKHangDx9EYAhbf wrhA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=MVG9UIHgr7Ddx6rqmvo9/b6OwiqdYnOMCtD9ezoSTZU=; b=Cy4Lk37POMy1EEdwwfqsNPjZaMkMwmMbjgJI+dQ7AMCABKaUQQEQl7iXyEL73vEVGE Ky+l9tbydmPWWlRUoOxJTNkcxjohlg+iWna4FaS7s6xVZzOVdWetKCrP5bvh4KLWuOy7 dAqAjZa6mqvAaK1iZAwvgUAfUmx9Tm8Wx8Y0S6tzCt1+bmqLz6c0gPtvBGEv8s46JtrH GkwaUfAgFSD5ihlwRqMA5gUbpo5alnXpmOVXWiSx/wmIEsGJDNUbTn7vifTFOG25OM5p 8b11NJlML87qFfWoZMw19nAQvDG0tV4N/zMYM6jxGW/Focw1oS3rkdKbegMuW3FTWLN/ YjkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=Ri7Zgcce; 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=ispras.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c4-20020a170902d48400b00192cb7c42a7si26490889plg.536.2023.01.14.14.50.57; Sat, 14 Jan 2023 14:51:04 -0800 (PST) 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=@ispras.ru header.s=default header.b=Ri7Zgcce; 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=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230390AbjANW1h (ORCPT + 53 others); Sat, 14 Jan 2023 17:27:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbjANW10 (ORCPT ); Sat, 14 Jan 2023 17:27:26 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 043259EFE; Sat, 14 Jan 2023 14:27:25 -0800 (PST) Received: from fedcomp.intra.ispras.ru (unknown [46.242.14.200]) by mail.ispras.ru (Postfix) with ESMTPSA id 4643740737B2; Sat, 14 Jan 2023 22:27:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 4643740737B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1673735243; bh=MVG9UIHgr7Ddx6rqmvo9/b6OwiqdYnOMCtD9ezoSTZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ri7ZgccehZLIphbbIpraaPu3cHWgT64hVlpWxfK1dNSdDuX12IHInQl7eDBz9/n93 z50zaES8k/c5WxTV/xdjIWnZcIwNZKoOkd1LnmN6UKAH8jVLMkzBzSCE21jiUvcnX+ mQESoYirS423bSVfLM2olWpbZKwkrIAVfXWAmdH4= From: Fedor Pchelkin To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Fedor Pchelkin , Jens Axboe , Christoph Hellwig , Chaitanya Kulkarni , Johannes Thumshirn , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Alexey Khoroshilov , lvc-project@linuxtesting.org Subject: [PATCH 5.10 1/1] block: fix and cleanup bio_check_ro Date: Sun, 15 Jan 2023 01:27:09 +0300 Message-Id: <20230114222709.180795-2-pchelkin@ispras.ru> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230114222709.180795-1-pchelkin@ispras.ru> References: <20230114222709.180795-1-pchelkin@ispras.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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: Christoph Hellwig commit 57e95e4670d1126c103305bcf34a9442f49f6d6a upstream. Don't use a WARN_ONCE when printing a potentially user triggered condition. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220304180105.409765-2-hch@lst.de Signed-off-by: Jens Axboe Signed-off-by: Fedor Pchelkin --- block/blk-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 26664f2a139e..921d436fa3c6 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -701,8 +701,7 @@ static inline bool bio_check_ro(struct bio *bio, struct hd_struct *part) if (op_is_flush(bio->bi_opf) && !bio_sectors(bio)) return false; - WARN_ONCE(1, - "Trying to write to read-only block-device %s (partno %d)\n", + pr_warn("Trying to write to read-only block-device %s (partno %d)\n", bio_devname(bio, b), part->partno); /* Older lvm-tools actually trigger this */ return false; -- 2.34.1