public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: "Udo A. Steinberg" <reality@delusion.de>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [OOPS]: Linux-2.5.1-pre5
Date: Tue, 4 Dec 2001 10:49:28 +0100	[thread overview]
Message-ID: <20011204104928.E13391@suse.de> (raw)
In-Reply-To: <3C0BA978.A26EF6C0@delusion.de>
In-Reply-To: <3C0BA978.A26EF6C0@delusion.de>

[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]

On Mon, Dec 03 2001, Udo A. Steinberg wrote:
> Unable to handle kernel NULL pointer dereference at virtual address 00000028
> c01d0538
> *pde = 00000000
> Oops: 0000
> CPU:    0
> EIP:    0010:[<c01d0538>]    Not tainted
> Using defaults from ksymoops -t elf32-i386 -a i386
> EFLAGS: 00010286
> eax: 00000000   ebx: c1be11c0   ecx: 00000030   edx: 00000200
> esi: 00000001   edi: c1be14c0   ebp: c10688ac   esp: cac1bdb0
> ds: 0018   es: 0018   ss: 0018
> Process kdeinit (pid: 223, stackpage=cac1b000)
> Stack: 00000030 00000001 c1be11c0 00000000 c0135af7 00000001 c1be11c0 c010820c
>        0000000b c1101ad4 000001f0 00000020 00000a0e c010a238 c1101ad4 c1be14c0
>        c10688ac c1be14c0 c0135b5c c1be14c0 000001f0 00000018 00000018 ffffff0b
> Call Trace: [<c0135af7>] [<c010820c>] [<c010a238>] [<c0135b5c>] [<c01346bc>]
>    [<c012c328>] [<c012c5e0>] [<c012c64c>] [<c012cf51>] [<c012d19c>] [<c012d230>]
>    [<c013f8d3>] [<c02638d5>] [<c022177f>] [<c013fb03>] [<c013fed2>] [<c01c9b5f>]
>    [<c0106d1b>]
> Code: 8b 48 28 66 c1 ea 09 0f b7 d2 0f af 53 04 89 10 0f b7 53 0c
> 
> >>EIP; c01d0538 <submit_bh+48/d0>   <=====

This should fix it.

-- 
Jens Axboe


[-- Attachment #2: bio-pre5-1 --]
[-- Type: text/plain, Size: 2221 bytes --]

--- /opt/kernel/linux-2.5.1-pre5/fs/bio.c	Tue Dec  4 04:42:00 2001
+++ fs/bio.c	Tue Dec  4 04:45:56 2001
@@ -35,7 +35,7 @@
 #include <asm/uaccess.h>
 
 kmem_cache_t *bio_cachep;
-static spinlock_t __cacheline_aligned bio_lock = SPIN_LOCK_UNLOCKED;
+static spinlock_t __cacheline_aligned_in_smp bio_lock = SPIN_LOCK_UNLOCKED;
 static struct bio *bio_pool;
 static DECLARE_WAIT_QUEUE_HEAD(bio_pool_wait);
 static DECLARE_WAIT_QUEUE_HEAD(biovec_pool_wait);
@@ -74,7 +74,7 @@
 	struct bio *bio;
 
 	if ((bio = bio_pool)) {
-		BUG_ON(bio_pool_free <= 0);
+		BIO_BUG_ON(bio_pool_free <= 0);
 		bio_pool = bio->bi_next;
 		bio->bi_next = NULL;
 		bio_pool_free--;
@@ -90,7 +90,7 @@
 
 	spin_lock_irqsave(&bio_lock, flags);
 	bio = __bio_pool_get();
-	BUG_ON(!bio && bio_pool_free);
+	BIO_BUG_ON(!bio && bio_pool_free);
 	spin_unlock_irqrestore(&bio_lock, flags);
 
 	return bio;
@@ -121,8 +121,7 @@
 	}
 }
 
-#define BIO_CAN_WAIT(gfp_mask)	\
-	(((gfp_mask) & (__GFP_WAIT | __GFP_IO)) == (__GFP_WAIT | __GFP_IO))
+#define BIO_CAN_WAIT(gfp_mask)	((gfp_mask) & __GFP_WAIT)
 
 static inline struct bio_vec *bvec_alloc(int gfp_mask, int nr, int *idx)
 {
@@ -198,13 +197,15 @@
 {
 	struct biovec_pool *bp = &bvec_list[bio->bi_max];
 
-	BUG_ON(bio->bi_max >= BIOVEC_NR_POOLS);
+	BIO_BUG_ON(bio->bi_max >= BIOVEC_NR_POOLS);
 
 	/*
 	 * cloned bio doesn't own the veclist
 	 */
-	if (!(bio->bi_flags & (1 << BIO_CLONED)))
+	if (!(bio->bi_flags & (1 << BIO_CLONED))) {
 		kmem_cache_free(bp->bp_cachep, bio->bi_io_vec);
+		wake_up_nr(&bp->bp_wait, 1);
+	}
 
 	bio_pool_put(bio);
 }
@@ -212,13 +213,13 @@
 inline void bio_init(struct bio *bio)
 {
 	bio->bi_next = NULL;
-	atomic_set(&bio->bi_cnt, 1);
 	bio->bi_flags = 0;
 	bio->bi_rw = 0;
 	bio->bi_vcnt = 0;
 	bio->bi_idx = 0;
 	bio->bi_size = 0;
 	bio->bi_end_io = NULL;
+	atomic_set(&bio->bi_cnt, 1);
 }
 
 static inline struct bio *__bio_alloc(int gfp_mask, bio_destructor_t *dest)
@@ -314,14 +315,13 @@
  **/
 void bio_put(struct bio *bio)
 {
-	BUG_ON(!atomic_read(&bio->bi_cnt));
+	BIO_BUG_ON(!atomic_read(&bio->bi_cnt));
 
 	/*
 	 * last put frees it
 	 */
 	if (atomic_dec_and_test(&bio->bi_cnt)) {
-		BUG_ON(bio->bi_next);
-
+		BIO_BUG_ON(bio->bi_next);
 		bio_free(bio);
 	}
 }

  parent reply	other threads:[~2001-12-04  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-03 16:34 [OOPS]: Linux-2.5.1-pre5 Udo A. Steinberg
2001-12-04  5:22 ` Mike Galbraith
2001-12-04  5:33   ` Alexander Viro
2001-12-04  9:49 ` Jens Axboe [this message]
2001-12-04 17:54   ` David C. Hansen
2001-12-04 18:43     ` Jens Axboe

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=20011204104928.E13391@suse.de \
    --to=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reality@delusion.de \
    /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