From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: Song Liu <song@kernel.org>, "Theodore Ts'o" <tytso@mit.edu>,
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 [thread overview]
Message-ID: <20220304180105.409765-3-hch@lst.de> (raw)
In-Reply-To: <20220304180105.409765-1-hch@lst.de>
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 <hch@lst.de>
---
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
next prev parent reply other threads:[~2022-03-04 18:01 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-04 18:00 remove bio_devname Christoph Hellwig
2022-03-04 18:00 ` [PATCH 01/10] block: fix and cleanup bio_check_ro Christoph Hellwig
2022-03-07 3:05 ` Chaitanya Kulkarni
2022-03-04 18:00 ` Christoph Hellwig [this message]
2022-03-07 3:05 ` [PATCH 02/10] block: remove handle_bad_sector Chaitanya Kulkarni
2022-03-04 18:00 ` [PATCH 03/10] pktcdvd: remove a pointless debug check in pkt_submit_bio Christoph Hellwig
2022-03-04 18:00 ` [PATCH 04/10] dm-crypt: stop using bio_devname Christoph Hellwig
2022-03-07 3:07 ` Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 05/10] dm-integrity: " Christoph Hellwig
2022-03-07 3:07 ` Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 06/10] md-multipath: " Christoph Hellwig
2022-03-04 19:14 ` Song Liu
2022-03-07 3:07 ` Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 07/10] raid1: " Christoph Hellwig
2022-03-04 19:14 ` Song Liu
2022-03-07 3:06 ` Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 08/10] raid5-ppl: " Christoph Hellwig
2022-03-04 19:14 ` Song Liu
2022-03-04 18:01 ` [PATCH 09/10] ext4: " Christoph Hellwig
2022-03-07 3:08 ` Chaitanya Kulkarni
2022-03-04 18:01 ` [PATCH 10/10] block: remove bio_devname Christoph Hellwig
2022-03-07 3:06 ` Chaitanya Kulkarni
2022-03-07 11:38 ` Johannes Thumshirn
2022-03-07 13:42 ` Jens Axboe
2022-03-07 16:45 ` Mike Snitzer
2022-03-07 16:48 ` Christoph Hellwig
2022-03-07 16:56 ` Mike Snitzer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220304180105.409765-3-hch@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).