Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2271099pxm; Fri, 4 Mar 2022 12:48:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJydRd5yczFB5WDWP+3jSANs0ppCHpTCmZc2b21qv+NVxqNVr9cQhFnrgMAv7aAD1Ftm+3cy X-Received: by 2002:a17:90b:4f4e:b0:1bf:887:9352 with SMTP id pj14-20020a17090b4f4e00b001bf08879352mr12449405pjb.199.1646426881718; Fri, 04 Mar 2022 12:48:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646426881; cv=none; d=google.com; s=arc-20160816; b=oeXfO6OPUHOD5zXZaiH380LXlRaCKfzL5sHCYYS4pEsTy4VSF+wxpyPbCl57uy9Dwr LMLnPe3KgHRrK5nsSP93l/or7aBH2NwnoY6F0/zNUQkWjTm4SFKznkbmNi8A7ikMN7GW sdENKzc8iGW85bktnxFYvCW+6UJ/rYfPrJNkHDfvxEd8jfeba2E9+g6I039350OBt/ZC 5ZBuua0PBs2pxpI0LZeE8wmn9/nbrRtSZ8JzH700F+R8QunTA0yvIy2GwDuGUC7iq+OK mivvTW02h7MqY41XahV9rsry9lrTJorkQGGNMeYVsc64kJxmmIsDI8clqDD91DqCyImR J8PQ== 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; bh=NWtAUb4gt6zNHPNza/nGMcjOF5pGzpcQM7yFjfrfEIo=; b=mMvi/Bsi2wnbMwlFbMahREmkzhKQwID5NFKe2jyCOqRUtKxCiAGhjyrobi7OKmb3f6 oVMh5l58MTp86Tdo+K9M7O8QBVconh/MRV3gcL3TIkYG449sLfk61DHPzVzRcswT6y49 jip2w/oc7gOrqkA92+fLdk3HQoJ4HDDRpmr89EW86UW+rFaAkGp81K7mtUdlNtZWp6Ut 3u+hsU7J/0g0wxoD8nS2D7OdLrq8SB5x5YY1/lkLy7RZ/PzvsbNNX2eFgfU/ii8e/PGs R7z1XzHgNoEcOwy/kkG3BmuPD2k/YcuYTGt2YAgzXYrmwA64HDpsv7zllC3j7H53EEzs b5rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=yExG+NqY; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s7-20020a056a00178700b004f0f0f8529esi6480396pfg.72.2022.03.04.12.48.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:48:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=yExG+NqY; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DA8DC29F138; Fri, 4 Mar 2022 11:48:33 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241435AbiCDSCG (ORCPT + 99 others); Fri, 4 Mar 2022 13:02:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241434AbiCDSCE (ORCPT ); Fri, 4 Mar 2022 13:02:04 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 000811C57FA; Fri, 4 Mar 2022 10:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=NWtAUb4gt6zNHPNza/nGMcjOF5pGzpcQM7yFjfrfEIo=; b=yExG+NqYNxRV9CC+/9fRZWr5nn TUvaUoTkY+ZhC+cpPLmwguOhjPac4SXuGE9YK/nvaU6rVuh0RvFtT8HKOGDIgQK4VUfzIdP+yUuoz gbr7m3o8aNElu2HEOqM9wp+iMRX69QGr1QAdLHX/OuseQsuSgm7C+vd2D6HErtfq2JuGNpR5FMALW kBVxenOoMbYd2CbaHU4rPQ/Uq7evIZc0l2LnCgyrTL7v8Q993LrQkxbdN/2ihIJb8qN0fRd0kgPn1 758lDTvUi7Pb6g44ivxeEUMlep/VjImej67QDiJuMdZNZH0q4sor8h+VzL/5LbA+Y/owVYbngI5nk XAaKkQiQ==; Received: from [2001:4bb8:180:5296:cded:8d4b:ace6:f3c] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQCEq-00BUjX-Jo; Fri, 04 Mar 2022 18:01:13 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Song Liu , "Theodore Ts'o" , linux-block@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-ext4@vger.kernel.org Subject: [PATCH 02/10] block: remove handle_bad_sector Date: Fri, 4 Mar 2022 19:00:57 +0100 Message-Id: <20220304180105.409765-3-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220304180105.409765-1-hch@lst.de> References: <20220304180105.409765-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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-ext4@vger.kernel.org Use the %pg format specifier instead of the stack hungry bdevname function, and remove handle_bad_sector given that it is not pointless. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 34e1b7fdb7c89..4d858fc08f8ba 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -540,17 +540,6 @@ bool blk_get_queue(struct request_queue *q) } EXPORT_SYMBOL(blk_get_queue); -static void handle_bad_sector(struct bio *bio, sector_t maxsector) -{ - char b[BDEVNAME_SIZE]; - - pr_info_ratelimited("%s: attempt to access beyond end of device\n" - "%s: rw=%d, want=%llu, limit=%llu\n", - current->comm, - bio_devname(bio, b), bio->bi_opf, - bio_end_sector(bio), maxsector); -} - #ifdef CONFIG_FAIL_MAKE_REQUEST static DECLARE_FAULT_ATTR(fail_make_request); @@ -612,7 +601,11 @@ static inline int bio_check_eod(struct bio *bio) if (nr_sectors && maxsector && (nr_sectors > maxsector || bio->bi_iter.bi_sector > maxsector - nr_sectors)) { - handle_bad_sector(bio, maxsector); + pr_info_ratelimited("%s: attempt to access beyond end of device\n" + "%pg: rw=%d, want=%llu, limit=%llu\n", + current->comm, + bio->bi_bdev, bio->bi_opf, + bio_end_sector(bio), maxsector); return -EIO; } return 0; -- 2.30.2