From: Jens Axboe <jens.axboe@oracle.com>
To: Sebastian Siewior <lkml@ml.breakpoint.cc>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [BUG] panic after umount (biscted)
Date: Fri, 26 Oct 2007 13:42:30 +0200 [thread overview]
Message-ID: <20071026114230.GG5155@kernel.dk> (raw)
In-Reply-To: <20071026113524.GA10130@Chamillionaire.breakpoint.cc>
On Fri, Oct 26 2007, Sebastian Siewior wrote:
> * Jens Axboe | 2007-10-26 11:32:42 [+0200]:
>
> >On Fri, Oct 26 2007, Jens Axboe wrote:
> >> >
> >> > I hope this was usefull. Now, I'm going to rebuild my raid now....
> >> >
> >> Thanks a lot, a full report on this issue. Will get this fixed up asap.
> No problem, thanks for working on that :)
>
> >
> >Does this work?
> >
> >diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> >index 61fdaf0..cf47fcb 100644
> >--- a/drivers/scsi/scsi_lib.c
> >+++ b/drivers/scsi/scsi_lib.c
> >@@ -1115,6 +1115,8 @@ static int scsi_init_io(struct scsi_cmnd *cmd)
> > * kmapping pages)
> > */
> > cmd->use_sg = req->nr_phys_segments;
> >+ if (!cmd->use_sg)
> >+ return 0;
> >
> > /*
> > * If sg table allocation fails, requeue request later.
> >@@ -1191,7 +1193,7 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req)
> > if (req->bio) {
> > int ret;
> >
> >- BUG_ON(!req->nr_phys_segments);
> >+ BUG_ON(!req->nr_phys_segments && req->bio->bi_size);
> >
> > ret = scsi_init_io(cmd);
> > if (unlikely(ret))
> >
>
> Nope. I get [1] on manual umount and [2] on system reboot. This is
> 24-rc1 with this patch on top.
>
> [1] http://download.breakpoint.cc/bug/bug_rc1_patch_manual.jpeg 163 KiB
> [2] http://download.breakpoint.cc/bug/bug_rc1_patch_reboot.jpeg 171 KiB
Ah, second BUG() for same issue. Try this one. This?
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 61fdaf0..57fde7b 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1115,6 +1115,8 @@ static int scsi_init_io(struct scsi_cmnd *cmd)
* kmapping pages)
*/
cmd->use_sg = req->nr_phys_segments;
+ if (!cmd->use_sg)
+ return 0;
/*
* If sg table allocation fails, requeue request later.
@@ -1191,7 +1193,7 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req)
if (req->bio) {
int ret;
- BUG_ON(!req->nr_phys_segments);
+ BUG_ON(!req->nr_phys_segments && req->bio->bi_size);
ret = scsi_init_io(cmd);
if (unlikely(ret))
@@ -1236,9 +1238,10 @@ int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req)
if (ret != BLKPREP_OK)
return ret;
/*
- * Filesystem requests must transfer data.
+ * Filesystem requests must transfer data, unless it's an empty
+ * barrier.
*/
- BUG_ON(!req->nr_phys_segments);
+ BUG_ON(!req->nr_phys_segments && !bio_empty_barrier(req->bio));
cmd = scsi_get_cmd_from_req(sdev, req);
if (unlikely(!cmd))
--
Jens Axboe
next prev parent reply other threads:[~2007-10-26 11:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 7:01 [BUG] panic after umount (biscted) Sebastian Siewior
2007-10-26 9:27 ` Jens Axboe
2007-10-26 9:32 ` Jens Axboe
2007-10-26 11:35 ` Sebastian Siewior
2007-10-26 11:42 ` Jens Axboe [this message]
2007-10-27 10:44 ` Sebastian Siewior
2007-10-27 11:39 ` Jens Axboe
2007-10-27 17:56 ` Sebastian Siewior
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=20071026114230.GG5155@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@ml.breakpoint.cc \
/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