diff options
author | Theodore Ts'o <tytso@mit.edu> | 2017-05-01 03:08:05 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-05-01 03:08:05 +0300 |
commit | 72d622b42258a0ed0b6e8c0f40d7628de935d058 (patch) | |
tree | 02103c9900f34edfa55341f75f470328e67368fd /fs/ext4/page-io.c | |
parent | dddbd6ac8f25b2d61e3e1c7134e3b3e1b9cd8670 (diff) | |
download | linux-72d622b42258a0ed0b6e8c0f40d7628de935d058.tar.xz |
ext4: replace BUG_ON with WARN_ONCE in ext4_end_bio()
Add fallback code and a WARN_ONCE() call instead of a BUG_ON() in
the ext4_end_bio() function.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/page-io.c')
-rw-r--r-- | fs/ext4/page-io.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 208241b06662..1a82138ba739 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -297,8 +297,17 @@ static void ext4_end_bio(struct bio *bio) { ext4_io_end_t *io_end = bio->bi_private; sector_t bi_sector = bio->bi_iter.bi_sector; + char b[BDEVNAME_SIZE]; - BUG_ON(!io_end); + if (WARN_ONCE(!io_end, "io_end is NULL: %s: sector %Lu len %u err %d\n", + bdevname(bio->bi_bdev, b), + (long long) bio->bi_iter.bi_sector, + (unsigned) bio_sectors(bio), + bio->bi_error)) { + ext4_finish_bio(bio); + bio_put(bio); + return; + } bio->bi_end_io = NULL; if (bio->bi_error) { |