Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3851495rwb; Mon, 16 Jan 2023 14:04:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXsti31TbVEVM57/3fCZASrBspzq2Q6lcEDuvjAQFFWX5dPJ/bi+3cX7CpcFU5zKBfBx8kMe X-Received: by 2002:a17:907:a2c6:b0:7c1:92b2:fa9e with SMTP id re6-20020a170907a2c600b007c192b2fa9emr562414ejc.59.1673906698868; Mon, 16 Jan 2023 14:04:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673906698; cv=none; d=google.com; s=arc-20160816; b=RlmY67jaeyKsSza7Rk4lppmmiMMP7FAYVP6x72DkOMO2oZ5xsvAPQj+WG32kZuBwkE SvnHJIzo4Mo6dWENJrNv1+782FdoNzu364LTgUweVvd3Bo+vP5gRoiOssrQzDPHsDJKo ufctA8B1QOBfFI4Ck+lAng9iwDoRt+GjES1kYgqBjFlc52boRcxWZVLzAkpn6sqEtp2j 8oZtSLLRJ5oE0JExabCIdCo1J/9O5vfL2Ox06lraWfztBhKCnkJQiu6OMwXAKMyb3g7C x/28zJFRXyDGMCO+AQqhfTvvGSn19fzSyzbfoqfbOEmc7SmsqjkpAFyilHByzw9+qSyJ rf7w== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=JgF6PdGUqUIiW+PcAMJiQ/9RP2j3tExghwoZn9wrIig=; b=JfY+bKlhfyH81qay/hllriCkOhkodMuIL38ZKAfSuU+IrjBYW6V9A1Jni21N5ECvMu 9GkqbsNMfiJax44LgHkmF8i7A4Rtb9Wwg+HzuzGlfny0u1HEKGSupffILokgu92IzpkZ DMNklhQuxsIEcK5YbaFFSPv0GHSS+BMbCnPJKq7CL6BL8XApZsiMATbYIGp1X3VP1jgy 3NiOJz3n1jiI9p7B4pCDzuAlZPv4vu6kEZKb0rWmJRzngWyz+NJHsSeerc30+Vy/5xgj PwlEzznePRwq2F4CjbA+t/VGy7zrraPoLD5L++Q3nzHlr4QhExRE8Zr50lUdSrJXG3de jDqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=KkhWXRfp; 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 o2-20020a1709061b0200b0086f05817f39si5434184ejg.39.2023.01.16.14.04.46; Mon, 16 Jan 2023 14:04:58 -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=KkhWXRfp; 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 S234018AbjAPVKX (ORCPT + 50 others); Mon, 16 Jan 2023 16:10:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233847AbjAPVKV (ORCPT ); Mon, 16 Jan 2023 16:10:21 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 358171CAE3; Mon, 16 Jan 2023 13:10:21 -0800 (PST) Received: from fedcomp.intra.ispras.ru (unknown [46.242.14.200]) by mail.ispras.ru (Postfix) with ESMTPSA id 6242740D403D; Mon, 16 Jan 2023 21:10:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 6242740D403D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1673903419; bh=JgF6PdGUqUIiW+PcAMJiQ/9RP2j3tExghwoZn9wrIig=; h=From:To:Cc:Subject:Date:From; b=KkhWXRfpLeToZU3rkquVnGfm4EHcU1i5LWLYoWHWDVaJtlye4kq/ORrphzAFEKAgt oyzHOsXFLo/2ECq0WOjp58mpa1Dk0AbvotogEbFlnB4XhP5EnWIS4aW5xF4M3dc9+A HTJznExyVaTW8+VfGSzj4IS2Z1kygMCmEAYH2fXg= 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 Subject: [PATCH 4.19] block: fix and cleanup bio_check_ro Date: Tue, 17 Jan 2023 00:10:13 +0300 Message-Id: <20230116211013.822998-1-pchelkin@ispras.ru> X-Mailer: git-send-email 2.34.1 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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 80f3e729fdd4..4fbf915d9cb0 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2179,10 +2179,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, - "generic_make_request: 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