linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wakko Warner <wakko@animx.eu.org>
To: Bart Van Assche <Bart.VanAssche@wdc.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"richard.weinberger@gmail.com" <richard.weinberger@gmail.com>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Subject: Re: 4.15.14 crash with iscsi target and dvd
Date: Sun, 8 Apr 2018 12:02:54 -0400	[thread overview]
Message-ID: <20180408160254.GA22869@animx.eu.org> (raw)
In-Reply-To: <1ff8d234cc565ba9701ce31899fca5faa597e050.camel@wdc.com>

Bart Van Assche wrote:
> On Sat, 2018-04-07 at 12:53 -0400, Wakko Warner wrote:
> > Bart Van Assche wrote:
> > > On Thu, 2018-04-05 at 22:06 -0400, Wakko Warner wrote:
> > > > I know now why scsi_print_command isn't doing anything.  cmd->cmnd is null.
> > > > I added a dev_printk in scsi_print_command where the 2 if statements return.
> > > > Logs:
> > > > [  29.866415] sr 3:0:0:0: cmd->cmnd is NULL
> > > 
> > > That's something that should never happen. As one can see in
> > > scsi_setup_scsi_cmnd() and scsi_setup_fs_cmnd() both functions initialize
> > > that pointer. Since I have not yet been able to reproduce myself what you
> > > reported, would it be possible for you to bisect this issue? You will need
> > > to follow something like the following procedure (see also
> > > https://git-scm.com/docs/git-bisect):
> > 
> > After doing 3 successful compiles with good/bad, I got this error and was
> > not able to compile any more kernels:
> >   CC      scripts/mod/devicetable-offsets.s
> > scripts/mod/empty.c:1:0: error: code model kernel does not support PIC mode
> >  /* empty file to figure out endianness / word size */
> >  
> > scripts/mod/devicetable-offsets.c:1:0: error: code model kernel does not support PIC mode
> >  #include <linux/kbuild.h>
> >  
> > scripts/Makefile.build:153: recipe for target 'scripts/mod/devicetable-offsets.s' failed
> > 
> > I don't think it found the bad commit.
> 
> Have you tried to modify the kernel Makefile as indicated in the following
> e-mail? This should make the kernel build:
> 
> https://lists.ubuntu.com/archives/kernel-team/2016-May/077178.html

Thanks.  That helped.

I finished with git bisect.  Here's the output:
84c8590646d5b35804bac60eb58b145839b5893e is the first bad commit
commit 84c8590646d5b35804bac60eb58b145839b5893e
Author: Ming Lei <tom.leiming@gmail.com>
Date:   Fri Nov 11 20:05:32 2016 +0800

    target: avoid accessing .bi_vcnt directly
    
    When the bio is full, bio_add_pc_page() will return zero,
    so use this information tell when the bio is full.
    
    Also replace access to .bi_vcnt for pr_debug() with bio_segments().
    
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Signed-off-by: Ming Lei <tom.leiming@gmail.com>
    Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
    Signed-off-by: Jens Axboe <axboe@fb.com>

:040000 040000 a3ebbb71c52ee4eb8c3be4d033b81179211bf704 de39a328dbd1b18519946b3ad46d9302886e0dd0 M      drivers

I did a diff between HEAD^ and HEAD and manually patched the file from
4.15.14.  It's not an exact revert.  I'm running it now and it's working.
I'll do a better test later on.  Here's the patch:

--- a/drivers/target/target_core_pscsi.c	2018-02-04 14:31:31.077316617 -0500
+++ b/drivers/target/target_core_pscsi.c	2018-04-08 11:43:49.588641374 -0400
@@ -915,7 +915,9 @@
 					bio, page, bytes, off);
 			pr_debug("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n",
 				bio_segments(bio), nr_vecs);
-			if (rc != bytes) {
+			if (rc != bytes)
+				goto fail;
+			if (bio->bi_vcnt > nr_vecs) {
 				pr_debug("PSCSI: Reached bio->bi_vcnt max:"
 					" %d i: %d bio: %p, allocating another"
 					" bio\n", bio->bi_vcnt, i, bio);

I really appreciate your time and assistance with this.

-- 
 Microsoft has beaten Volkswagen's world record.  Volkswagen only created 22
 million bugs.

  reply	other threads:[~2018-04-08 16:02 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31  1:59 4.15.14 crash with iscsi target and dvd Wakko Warner
2018-03-31 20:59 ` Wakko Warner
2018-03-31 21:08 ` Richard Weinberger
2018-03-31 22:12   ` Wakko Warner
2018-04-01  3:40     ` Bart Van Assche
2018-04-01 11:37       ` Wakko Warner
2018-04-01 15:02         ` Bart Van Assche
2018-04-01 16:24           ` Wakko Warner
2018-04-01 16:51             ` Bart Van Assche
2018-04-01 16:36         ` Wakko Warner
2018-04-01 18:27           ` Wakko Warner
2018-04-03 17:03             ` Bart Van Assche
2018-04-05  0:26               ` Wakko Warner
2018-04-06  1:46               ` Wakko Warner
2018-04-06  2:06                 ` Wakko Warner
2018-04-06  2:20                   ` Bart Van Assche
2018-04-06 23:42                     ` Wakko Warner
2018-04-07  1:03                     ` Wakko Warner
2018-04-07  2:06                       ` Bart Van Assche
2018-04-07 16:53                     ` Wakko Warner
2018-04-07 17:08                       ` Wakko Warner
2018-04-07 17:09                       ` Bart Van Assche
2018-04-08 16:02                         ` Wakko Warner [this message]
2018-04-08 16:15                           ` Wakko Warner
2018-04-09 21:30                           ` Bart Van Assche
2018-04-09 23:34                             ` Ming Lei
2018-04-09 23:43                               ` Wakko Warner
2018-04-09 23:51                                 ` Ming Lei
2018-04-11  0:45                               ` Wakko Warner
2018-04-12  0:52                                 ` Wakko Warner
2018-04-12 10:07                                 ` Ming Lei
2018-04-13  1:43                                   ` Wakko Warner
2018-04-13  1:55                                     ` Ming Lei
2018-04-14 21:34                                       ` Wakko Warner

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=20180408160254.GA22869@animx.eu.org \
    --to=wakko@animx.eu.org \
    --cc=Bart.VanAssche@wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    /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).