public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Sudhakar <ssudhakarp@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: race condition between scsi device add/remove code paths in 2.6.28
Date: Fri, 23 Jan 2009 23:06:35 -0600	[thread overview]
Message-ID: <1232773596.10682.1.camel@localhost.localdomain> (raw)
In-Reply-To: <8b62ef2d0901231608y8df423ema178ae8700173ea1@mail.gmail.com>

On Sat, 2009-01-24 at 05:38 +0530, Sudhakar wrote:
> Hi,
> 
> In our labs, we encountered a kernel crash, while stressing scsi
> device add/remove code path of 2.6.28 kernel. lsscsi output on my
> machine looks like this:
> 
> *******Start******
> 
> [root@IMIT2S005 ~]# lsscsi
> [0:0:0:0]    disk    ATA      ST3250620NS      3BKS  -
> [0:0:1:0]    disk    ATA      ST3250620NS      3BKS  -
> [0:0:2:0]    disk    ATA      ST3250620NS      3BKS  -
> [0:0:3:0]    disk    ATA      ST3250620NS      3BKS  -
> [0:1:0:0]    disk    Dell     VIRTUAL DISK     1028  /dev/sda
> [1:0:0:0]    cd/dvd  Optiarc  DVD RW AD-7190S  1.00  /dev/scd0
> [5:0:0:0]    disk    Linux    scsi_debug       0004  /dev/sdb
> 
> *******End*********
> 
> I have written script which would recursively add/remove the lone lun
> of scsi_debug device. My script looks like this:
> 
> ********Start******
> 
> [root@IMIT2S005 temp]# cat s.sh
> while [ true ]
> do
>         echo "scsi remove-single-device 5 0 0 0" > /proc/scsi/scsi
>         echo "scsi add-single-device 5 0 0 0" > /proc/scsi/scsi
> done
> [root@IMIT2S005 temp]#
> 
> ********End********
> 
> When the above script is run for approximately 10 seconds, we started
> to see the following messages and finally NULL pointer dereference.
> 
> ********Start*******
> 
> Jan 24 00:13:12 IMIT2S005 kernel: ------------[ cut here ]------------
> Jan 24 00:13:12 IMIT2S005 kernel: WARNING: at fs/sysfs/dir.c:462
> sysfs_add_one+0x33/0x39()
> Jan 24 00:13:12 IMIT2S005 kernel: sysfs: duplicate filename '5:0:0:0'
> can not be created

This is thought to be fixed by 

commit 32aeef605aa01e1fee45e052eceffb00e72ba2b0
Author: Hannes Reinecke <hare@suse.de>
Date:   Tue Jan 13 16:50:37 2009 +0100

    [SCSI] Skip deleted devices in __scsi_device_lookup_by_target()
 
Which is now upstream.

James



      parent reply	other threads:[~2009-01-24  5:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-24  0:08 race condition between scsi device add/remove code paths in 2.6.28 Sudhakar
2009-01-24  2:13 ` Douglas Gilbert
2009-01-24  5:06 ` James Bottomley [this message]

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=1232773596.10682.1.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ssudhakarp@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