linux/drivers
Stephen M. Cameron 2a8ccf3187 [SCSI] hpsa: fix bug in adjust_hpsa_scsi_table
fix bug in adjust_hpsa_scsi_table which caused devices which have
changed size, etc. to do the wrong thing.

The problem was as follows:

The driver maintains its current idea of what devices are present
in the h->dev[] array.  When it updates this array, it scans the
hardware, and produces a new list of devices, call it sd[], for
scsi devices.

Then, it compares each item in h->dev[] vs. sd[], and any items which
are not present sd it removes from h->dev[], and any items present
in sd[], but different, it modifies in h->dev[].

Then, it looks for items in sd[] which are not present in h->dev[],
and adds those items into h->dev[].  All the while, it keeps track
of what items were added and removed to/from h->dev[].

Finally, it updates the SCSI mid-layer by removing and adding
the same devices it removed and added to/from h->dev[]. (modified
devices count as a remove then add.)

originally, when a "changed" device was discovered, it was
removed then added to h->dev[].  The item was added to the *end*
of h->dev[].  And, the item was removed from sd[] as well
(nulled out).  As it processed h->dev[], these newly added items
at the end of the list were encountered, and sd[] was searched,
but those items were nulled out.  So they ended up getting removed
immediately after they were added.

The solution is to have a way to replace items in the h->dev[]
array instead of doing a remove + add.  Then the "changed" items.
are not encountered a second time, and removed.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2010-02-17 13:23:18 -06:00
..
accessibility
acpi Merge branch 'resume-sci-force-bootparam' into release 2009-12-30 18:32:32 -05:00
amba
ata libata: retry link resume if necessary 2010-01-12 14:34:14 -05:00
atm
auxdisplay
base sysdev: fix prototype for memory_sysdev_class show/store functions 2010-01-16 12:15:39 -08:00
block aoe: switch to the new bio_flush_dcache_pages() interface 2009-12-22 09:12:48 +01:00
bluetooth
cdrom
char Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2010-01-16 12:31:42 -08:00
clocksource
connector
cpufreq
cpuidle drivers/cpuidle/governors/menu.c: fix undefined reference to `__udivdi3' 2010-01-11 09:34:07 -08:00
crypto
dca
dio
dma Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2009-12-30 13:46:29 -08:00
edac edac: i5000_edac critical fix panic out of bounds 2010-01-16 12:15:38 -08:00
eisa
firewire firewire, ieee1394: update Kconfig help 2009-12-29 19:58:17 +01:00
firmware
gpio gpio: adp5588-gpio: new driver for ADP5588 GPIO expanders 2010-01-11 09:34:07 -08:00
gpu Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel 2010-01-16 10:44:38 -08:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2010-01-13 16:10:13 -08:00
hwmon Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2010-01-11 09:45:55 -08:00
i2c i2c: Do not use device name after device_unregister 2010-01-16 20:43:13 +01:00
ide
idle
ieee1394 firewire, ieee1394: update Kconfig help 2009-12-29 19:58:17 +01:00
ieee802154
infiniband Merge branches 'misc' and 'mlx4' into for-next 2010-01-06 13:16:47 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2010-01-15 14:51:57 -08:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-01-12 20:53:29 -08:00
leds
lguest lguest: fix bug in setting guest GDT entry 2010-01-04 12:33:33 -08:00
macintosh
mca
md md: allow a resync that is waiting for other resync to complete, to be aborted. 2009-12-30 15:25:23 +11:00
media firewire: fix use of multiple AV/C devices, allow multiple FCP listeners 2009-12-29 19:58:16 +01:00
memstick
message [SCSI] mptfusion: Bump version 03.04.14 2010-01-18 10:48:13 -06:00
mfd twl4030-irq.c: fix compiler warning due to raw-spinlock conversion 2009-12-31 17:26:05 -08:00
misc Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-12-17 16:38:48 -08:00
mmc mmc: allow for MMC v4.4 2010-01-11 09:34:06 -08:00
mtd Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus 2009-12-17 16:38:06 -08:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-01-14 08:36:15 -08:00
nubus
of
oprofile
parisc
parport
pci PCIe AER: prevent AER injection if hardware masks error reporting 2010-01-04 15:52:49 -08:00
pcmcia Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2009-12-30 13:13:24 -08:00
platform hp-wmi: remove double free caused by merge conflict 2010-01-01 14:04:25 -05:00
pnp
power pmu_battery: Fix battery full reporting 2009-12-18 03:51:29 +03:00
pps
ps3
rapidio
regulator
rtc rtc_cmos: convert shutdown to new pnp_driver->shutdown 2010-01-11 09:34:07 -08:00
s390 [SCSI] zfcp: Set hardware timeout as requested by BSG request. 2010-01-17 12:40:13 -06:00
sbus bbc_envctrl: Clean up properly if kthread_run() fails. 2010-01-04 15:31:10 -08:00
scsi [SCSI] hpsa: fix bug in adjust_hpsa_scsi_table 2010-02-17 13:23:18 -06:00
serial serial/8250_pnp: add a new Fujitsu Wacom Tablet PC device 2010-01-16 12:15:37 -08:00
sfi
sh
sn
spi
ssb
staging Staging/vt66*: kconfig, depends on WLAN 2009-12-23 11:27:50 -08:00
tc
telephony
thermal
uio
usb USB: Fix a bug on appledisplay.c regarding signedness 2009-12-23 11:34:20 -08:00
uwb
video revert "drivers/video/s3c-fb.c: fix clock setting for Samsung SoC Framebuffer" 2010-01-16 12:15:40 -08:00
virtio virtio: fix section mismatch warnings 2010-01-16 12:15:39 -08:00
vlynq
w1
watchdog [WATCHDOG] use resource_size() 2009-12-23 19:53:04 +00:00
xen xen: fix hang on suspend. 2010-01-13 10:01:35 +00:00
zorro
Kconfig firewire, ieee1394: update Kconfig help 2009-12-29 19:58:17 +01:00
Makefile