From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36193C55178 for ; Tue, 27 Oct 2020 16:14:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0FF421556 for ; Tue, 27 Oct 2020 16:14:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603815268; bh=cq+HexrErJpDokrOjx21YF85E9vSbfnJd5Mi4Q7CgEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Rcig2/YtBpO9w1c23X3L2f68v87cSbRr2d8tFP3Ognv8TcbVtmjMaDU1hNc1Qpc1B +pt+wlgXvNyR47NWtw3TgNyExFIzyBaXskT51EVkuK34yK1FEDekRqREvZFsBxUeYg qY7jW/rndnyhYSCWjbfnV1w3jqKTXLt5FjJFoCYo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1806439AbgJ0QGJ (ORCPT ); Tue, 27 Oct 2020 12:06:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:51566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1802584AbgJ0PuY (ORCPT ); Tue, 27 Oct 2020 11:50:24 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1B0B2207C3; Tue, 27 Oct 2020 15:50:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813823; bh=cq+HexrErJpDokrOjx21YF85E9vSbfnJd5Mi4Q7CgEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGBUx8lUaRgYQ3sKQlKEXu10BtVa7PbA29OGWg43Xxdj88lxYsy10aD/E0a+fb3ZV Wc9fjsr44UpVRE/kU4GnYoFrcfqc3uESkW7TGcu6XF0QoK/UHJc0Mug8xqTStlE0F5 wQ6mmMw8w2mCJG1fkm6SamRGlXqQ259fA5H5w9sE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tetsuo Handa , Christoph Hellwig , Jens Axboe , Sasha Levin Subject: [PATCH 5.9 642/757] block: ratelimit handle_bad_sector() message Date: Tue, 27 Oct 2020 14:54:52 +0100 Message-Id: <20201027135520.679724878@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tetsuo Handa [ Upstream commit f4ac712e4fe009635344b9af5d890fe25fcc8c0d ] syzbot is reporting unkillable task [1], for the caller is failing to handle a corrupted filesystem image which attempts to access beyond the end of the device. While we need to fix the caller, flooding the console with handle_bad_sector() message is unlikely useful. [1] https://syzkaller.appspot.com/bug?id=f1f49fb971d7a3e01bd8ab8cff2ff4572ccf3092 Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 10c08ac506978..0014e7caae3d2 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -803,11 +803,10 @@ static void handle_bad_sector(struct bio *bio, sector_t maxsector) { char b[BDEVNAME_SIZE]; - printk(KERN_INFO "attempt to access beyond end of device\n"); - printk(KERN_INFO "%s: rw=%d, want=%Lu, limit=%Lu\n", - bio_devname(bio, b), bio->bi_opf, - (unsigned long long)bio_end_sector(bio), - (long long)maxsector); + pr_info_ratelimited("attempt to access beyond end of device\n" + "%s: rw=%d, want=%llu, limit=%llu\n", + bio_devname(bio, b), bio->bi_opf, + bio_end_sector(bio), maxsector); } #ifdef CONFIG_FAIL_MAKE_REQUEST -- 2.25.1