Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3850652rwb; Mon, 16 Jan 2023 14:04:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXvSb/yHCNqT/wF4wAbuJyajvVVn3O9BQo6/CdE3Zi2iyXA7IeQtKFrONHF/G/Kg/CBjXTb4 X-Received: by 2002:a17:907:76da:b0:7c1:1dc7:8837 with SMTP id kf26-20020a17090776da00b007c11dc78837mr503150ejc.66.1673906649219; Mon, 16 Jan 2023 14:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673906649; cv=none; d=google.com; s=arc-20160816; b=SFSNB6UWO3VcZ2YrfRETUQTL+M30iS3fywEieNoY/5g6zShitXmEFWQlHnmowQYXOb h27DMU7xUjso1XxR5OK/vBhful28dyRd4onCs21MSqJFwpaB+r7d2C8yXQsS9/c2HT05 pUjiwxqpEpJu5bczMIMZYvyZTZEb3ZtxovOD1wGglza6gNMPYITgvNWSn/Hx+rRbcZLX YMNIRPYAY5nicgfuVnF81QsnE1tmkF9M9Dy2D1f+iR4soCjzdwc0VlKtAsSyNVLmr/Jx SDkLRSPX5AvyiNcdYLu9INf2MhdqTss6w5r5sSHYpaAmPTBVcZhGkAGN/usVJOji4HtT qNHQ== 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=rQOetvwWdAUv1lwzSus1er84FdlFidvK55jo5RaZJyE=; b=t7KIhxUBStFqpXets1TkCeXF01eycCURfLMU2KaBPuzGCsiQtH09RG1qAb4BcL0MbN q7mRTSKYOWERinxSxBt4S+KjRotQosY+OwEMctygWqQWTX6JiNt4PR3igKwL/Wm+pd5O kn6Nj2jCP0ojTwx+piN4sYk0KjcCKx7mlcOrQCrrxPG007/kHeTBYLP8ijH2zmwAZi6R TxWxJGZh1VH8vJTj8BL7wUZrTiBg1E44a2E388GhFn2uPMtDq8d8eeXWlSgwq2yIS+fk TbSsy3sWiR8VdIJCZZDUWMsaGRGOR/9Qj9qWql+UJhfPMy/3WrlwkuWTTd5wQn4BZqqX ctYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=SzguAJ19; 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 ae1-20020a17090725c100b007c4f78e610asi2286ejc.442.2023.01.16.14.03.57; Mon, 16 Jan 2023 14:04:09 -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=SzguAJ19; 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 S231268AbjAPVH3 (ORCPT + 50 others); Mon, 16 Jan 2023 16:07:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231719AbjAPVH1 (ORCPT ); Mon, 16 Jan 2023 16:07:27 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59A907EC7; Mon, 16 Jan 2023 13:07:26 -0800 (PST) Received: from fedcomp.intra.ispras.ru (unknown [46.242.14.200]) by mail.ispras.ru (Postfix) with ESMTPSA id B13FD40D403D; Mon, 16 Jan 2023 21:07:24 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru B13FD40D403D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1673903244; bh=rQOetvwWdAUv1lwzSus1er84FdlFidvK55jo5RaZJyE=; h=From:To:Cc:Subject:Date:From; b=SzguAJ19hNxPcJIhtAXcJPYWU/G5jdrBo9mGeZ5BOEe1S7bT1i4f++7kpLWfjz4vj oO/IEaeDpS04CdsKvqLPB6XD9geNgypaQ5azEJsnwr+/eAExcX7j+gpgYR6f5cePC1 EaNOeRLCCf8/Oi/b5zGbPBClWAfO0LToEoAY0sOE= 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 5.4] block: fix and cleanup bio_check_ro Date: Tue, 17 Jan 2023 00:07:15 +0300 Message-Id: <20230116210715.805574-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 5808baa950c3..030de4fdf9b1 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -793,10 +793,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