public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: linux-kernel@vger.kernel.org
Subject: [BUG] loop.c oopses
Date: Mon, 15 Jul 2002 23:24:53 -0700	[thread overview]
Message-ID: <20020716062453.GK1022@holomorphy.com> (raw)

loop.c oopses when bio_copy() returns NULL. This was encountered while
running dbench 16 on a loopback-mounted reiserfs filesystem.

It still gets buffer layer errors with this patch, but they appear to
be non-fatal.

Backtrace from buffer layer errors:

Trace; c013ec00 <try_to_free_buffers+158/228>
Trace; c01bbbea <reiserfs_releasepage+66/90>
Trace; c013d727 <try_to_release_page+3f/54>
Trace; c013192d <shrink_cache+241/3d4>
Trace; c0131c57 <shrink_caches+5f/94>
Trace; c0131cac <try_to_free_pages+20/44>
Trace; c0132800 <balance_classzone+40/188>
Trace; c01bbb0d <reiserfs_commit_write+f1/168>
Trace; c0132a9b <__alloc_pages+153/1a0>
Trace; c01327b9 <_alloc_pages+19/20>
Trace; c012dac8 <generic_file_write+458/648>
Trace; c013b2af <vfs_write+9b/120>
Trace; c013b39e <sys_write+2a/40>
Trace; c010899b <syscall_call+7/b>


If what I've done is proper, it may be necessary to allow
try_to_free_buffers() to fail if (!was_uptodate && PageUptodate(page))

Below is the attempt I made to fix this (be gentle, I'm no block io expert):


Cheers,
Bill


===== drivers/block/loop.c 1.51 vs edited =====
--- 1.51/drivers/block/loop.c	Sun Jun 16 15:50:19 2002
+++ edited/drivers/block/loop.c	Tue Jul 16 00:02:22 2002
@@ -458,6 +458,9 @@
 
 	bio = bio_copy(rbh, GFP_NOIO, rbh->bi_rw & WRITE);
 
+	if (!bio)
+		return NULL;
+
 	bio->bi_end_io = loop_end_io_transfer;
 	bio->bi_private = rbh;
 
@@ -477,6 +480,9 @@
 	struct bio_vec *from_bvec, *to_bvec;
 	char *vto, *vfrom;
 	int ret = 0, i;
+
+	if (!to_bio)
+		return -ENOMEM;
 
 	__bio_for_each_segment(from_bvec, from_bio, i, 0) {
 		to_bvec = &to_bio->bi_io_vec[i];

             reply	other threads:[~2002-07-16  6:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-16  6:24 William Lee Irwin III [this message]
2002-07-16  7:07 ` [BUG] loop.c oopses Andrew Morton
2002-07-16  8:31   ` Jens Axboe
2002-07-16  8:52     ` Andrew Morton
2002-07-16  8:48       ` Jens Axboe
2002-07-16  9:09         ` Andrew Morton
2002-07-16  8:52       ` William Lee Irwin III
2002-07-16  9:19         ` Andrew Morton
2002-07-16  9:16           ` William Lee Irwin III
2002-07-16  9:21           ` Jens Axboe
2002-07-16 12:49       ` Rik van Riel
2002-07-16 16:36         ` Jens Axboe
2002-07-16 16:49           ` Rik van Riel
2002-07-16 17:09             ` Jens Axboe
2002-07-16 19:42               ` Jari Ruusu
2002-07-16 21:14                 ` William Lee Irwin III
2002-07-16 21:36                   ` Andrew Morton
2002-07-17  5:40                 ` Jens Axboe
2002-07-17 15:31                   ` Jari Ruusu
2002-07-20 17:03                     ` William Lee Irwin III

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=20020716062453.GK1022@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    /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