linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boaz Harrosh <openosd@gmail.com>
To: Neil Brown <neilb@suse.de>
Cc: Jiri Slaby <jirislaby@gmail.com>,
	James Bottomley <James.Bottomley@suse.de>,
	linux-scsi@vger.kernel.org, hch@lst.de, jaxboe@fusionio.com,
	LKML <linux-kernel@vger.kernel.org>,
	linux-raid@vger.kernel.org
Subject: Re: BUG at drivers/scsi/scsi_lib.c:1113
Date: Thu, 22 Jul 2010 13:39:17 +0300	[thread overview]
Message-ID: <4C481FD5.4070509@gmail.com> (raw)
In-Reply-To: <20100722173716.66264bef@notabene>

On 07/22/2010 10:37 AM, Neil Brown wrote:
> On Thu, 22 Jul 2010 09:04:27 +0200
> Jiri Slaby <jirislaby@gmail.com> wrote:
> 
>> Hello,
>>
>> I'm seeing this BUG while booting:
>>
>> EXT3-fs (md1): using internal journal
>> ------------[ cut here ]------------
>> kernel BUG at /home/l/latest/xxx/drivers/scsi/scsi_lib.c:1113!
> 
> You aren't the only one.
> https://bugzilla.kernel.org/show_bug.cgi?id=16275
> 
> 
>> I bisected it down to:
>> commit 74450be123b6f3cb480c358a056be398cce6aa6e
>> Author: Christoph Hellwig <hch@lst.de>
>> Date:   Fri Jun 18 11:53:43 2010 +0200
>>
>>     block: unify flags for struct bio and struct request
>>
>>     Remove the current bio flags and reuse the request flags for the
>> bio, too.
>>     This allows to more easily trace the type of I/O from the filesystem
>>     down to the block driver.  There were two flags in the bio that were
>>     missing in the requests:  BIO_RW_UNPLUG and BIO_RW_AHEAD.  Also I've
>>     renamed two request flags that had a superflous RW in them.
>>
>>     Note that the flags are in bio.h despite having the REQ_ name - as
>>     blkdev.h includes bio.h that is the only way to go for now.
>>
>>     Signed-off-by: Christoph Hellwig <hch@lst.de>
>>     Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
>>
>>
> 
> Thanks for doing that.
> 
> I suspect that problem is that "do_sync" and "do_barriers" in
> drivers/md/raid1.c are still 'bool' and should now be 'unsigned long'.
> 
> I'm not sure how wide '_Bool' is, but I'm guess it isn't wide enough.
> 
> Could you please try changing ever 'bool' in that file to 'unsigned long'
> and see if that fixes it?
> 

Please don't. This is really bad programming, and produces slower
code. You should do:

diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 73cc74f..8bd1ecb 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -787,7 +787,7 @@ static int make_request(mddev_t *mddev, struct bio * bio)
 	struct bio_list bl;
 	struct page **behind_pages = NULL;
 	const int rw = bio_data_dir(bio);
-	const bool do_sync = (bio->bi_rw & REQ_SYNC);
+	const bool do_sync = (bio->bi_rw & REQ_SYNC) != 0;
 	bool do_barriers;
 	mdk_rdev_t *blocked_rdev;
 
Boaz

> Thanks,
> NeilBrown

  parent reply	other threads:[~2010-07-22 10:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22  7:04 BUG at drivers/scsi/scsi_lib.c:1113 Jiri Slaby
2010-07-22  7:37 ` Neil Brown
2010-07-22  8:06   ` Jiri Slaby
2010-07-22  8:36   ` Christoph Hellwig
2010-07-22  8:39     ` Jiri Slaby
2010-07-22 10:39   ` Boaz Harrosh [this message]
2010-07-22 11:44     ` [PATCH] md: bitwise operations might not fit in a "bool" Boaz Harrosh
2010-07-22 11:55       ` Neil Brown
2010-07-22 12:20         ` Boaz Harrosh
2010-07-22 12:37           ` Neil Brown
2010-07-27 22:27         ` H. Peter Anvin

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=4C481FD5.4070509@gmail.com \
    --to=openosd@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=hch@lst.de \
    --cc=jaxboe@fusionio.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=neilb@suse.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;
as well as URLs for NNTP newsgroup(s).