All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] loop.c oopses
@ 2002-07-16  6:24 William Lee Irwin III
  2002-07-16  7:07 ` Andrew Morton
  0 siblings, 1 reply; 20+ messages in thread
From: William Lee Irwin III @ 2002-07-16  6:24 UTC (permalink / raw)
  To: linux-kernel

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];

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2002-07-20 17:00 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-16  6:24 [BUG] loop.c oopses William Lee Irwin III
2002-07-16  7:07 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.