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=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 94C46C433E7 for ; Sun, 18 Oct 2020 20:01:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 594FB22269 for ; Sun, 18 Oct 2020 20:01:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603051260; bh=cq+HexrErJpDokrOjx21YF85E9vSbfnJd5Mi4Q7CgEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hchoLrwUFkGksndWPJj84TT0VVskNbKRSVFd7FUAnupHyxGiDOvseTQ/Z+gk493YP TlihBDtYhV89rihyS3X27emSnFxjsLE0b/fS11y1vNaC/XCHu/0VD5NCoPdWRq7U0m OiJ5Pmo89qDy4zEEMru+KtGPN04XxQd4PFYKss3M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727430AbgJRTSU (ORCPT ); Sun, 18 Oct 2020 15:18:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:56026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbgJRTSL (ORCPT ); Sun, 18 Oct 2020 15:18:11 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CBE73222B9; Sun, 18 Oct 2020 19:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603048690; bh=cq+HexrErJpDokrOjx21YF85E9vSbfnJd5Mi4Q7CgEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ehTZYdBbVd5DDUAPxNUAWUkDxDhxZIRt7UCr3ONLRaA0Le8tfFhBb0EmsKZLEbAhA iXCERRhTRJKMdK/rZxkZ+tjPgKzwjbVdtxxVoU8k0jiVMwQvDcEZGTj5Ddv4F3aGPQ 4SBR8//Xwfm6JQTY7FjtAMU38A+MDENomwF1LK3E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tetsuo Handa , Christoph Hellwig , Jens Axboe , Sasha Levin , linux-block@vger.kernel.org Subject: [PATCH AUTOSEL 5.9 002/111] block: ratelimit handle_bad_sector() message Date: Sun, 18 Oct 2020 15:16:18 -0400 Message-Id: <20201018191807.4052726-2-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201018191807.4052726-1-sashal@kernel.org> References: <20201018191807.4052726-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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