alistair23-linux/drivers/scsi
Boaz Harrosh 5d0961fd1f [SCSI] libosd: Fix blk_put_request locking again
So libosd has decided to sacrifice some code simplicity for the sake of
a clean API. One of these things is the possibility for users to call
osd_end_request, in any condition at any state. This opens up some
problems with calling blk_put_request when out-side of the completion
callback but calling __blk_put_request when detecting a from-completion
state.

The current hack was working just fine until exofs decided to operate on
all devices in parallel and wait for the sum of the requests, before
deallocating all osd-requests at once. There are two new possible cases
1. All request in a group are deallocated as part of the last request's
   async-done, request_queue is locked.
2. All request in a group where executed asynchronously, but
   de-allocation was delayed to after the async-done, in the context of
   another thread. Async execution but request_queue is not locked.

The solution I chose was to separate the deallocation of the osd_request
which has the information users need, from the deallocation of the
internal(2) requests which impose the locking problem. The internal
block-requests are freed unconditionally inside the async-done-callback,
when we know the queue is always locked. If at osd_end_request time we
still have a bock-request, then we know it did not come from within an
async-done-callback and we can call the regular blk_put_request.

The internal requests were used for carrying error information after
execution. This information is now copied to osd_request members for
later analysis by user code.

The external API and behaviour was unchanged, except now it really
supports what was previously advertised.

Reported-by: Vineet Agarwal <checkout.vineet@gmail.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Cc: Stable Tree <stable@kernel.org>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
2009-12-10 08:54:17 -06:00
..
aacraid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
aic7xxx tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
aic7xxx_old
aic94xx tree-wide: fix misspelling of "definition" in comments 2009-12-04 23:41:47 +01:00
arcmsr [SCSI] modify change_queue_depth to take in reason why it is being called 2009-12-04 12:00:41 -06:00
arm Merge branch 'master' into devel 2009-03-28 20:30:18 +00:00
be2iscsi [SCSI] be2iscsi: Adding support for various Async messages from chip 2009-12-10 08:54:13 -06:00
bfa Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
bnx2i Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
cxgb3i [SCSI] libiscsi: add warm target reset tmf support 2009-12-04 12:01:36 -06:00
device_handler [SCSI] scsi_dh_rdac: Add two new IBM devices to rdac_dev_list 2009-12-10 08:54:10 -06:00
dpt trivial: fix typo milisecond/millisecond for documentation and source comments. 2009-06-12 18:01:46 +02:00
fcoe [SCSI] fcoe, libfc: add get_lesb() to allow LLD to fill the link error status block (LESB) 2009-12-04 12:01:58 -06:00
fnic [SCSI] fnic: enable bsg pass-thru for fcping 2009-12-04 12:01:20 -06:00
ibmvscsi [SCSI] modify change_queue_depth to take in reason why it is being called 2009-12-04 12:00:41 -06:00
libfc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
libsas Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-12-09 19:42:25 -08:00
lpfc [SCSI] lpfc: fix hang on SGI ia64 platform 2009-12-10 08:54:09 -06:00
megaraid [SCSI] megaraid_sas: make driver PCI legacy I/O port free driver 2009-12-10 08:54:16 -06:00
mpt2sas [SCSI] mpt2sas: add missing initialization of scsih_cmds 2009-12-10 08:54:10 -06:00
mvsas [SCSI] mvsas: add support for Adaptec ASC-1045/1405 SAS/SATA HBA 2009-12-10 08:54:12 -06:00
osd [SCSI] libosd: Fix blk_put_request locking again 2009-12-10 08:54:17 -06:00
pcmcia pcmcia: rework the irq_req_t typedef 2009-11-28 18:03:14 +01:00
pm8001 [SCSI] pm8001: Fixes for tag alloc, error goto and code cleanup 2009-12-04 12:01:32 -06:00
qla2xxx [SCSI] scsi_lib_dma: fix bug with dma maps on nested scsi objects 2009-12-04 12:01:30 -06:00
qla4xxx trivial: fix typo "to to" in multiple files 2009-09-21 15:14:55 +02:00
sym53c8xx_2 tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
.gitignore
3w-9xxx.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
3w-9xxx.h [SCSI] 3w-9xxx: add power management support 2009-03-13 15:46:42 -05:00
3w-sas.c [SCSI] 3w-sas: Add new driver for LSI 3ware 9750 2009-12-04 12:00:51 -06:00
3w-sas.h [SCSI] 3w-sas: Add new driver for LSI 3ware 9750 2009-12-04 12:00:51 -06:00
3w-xxxx.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
3w-xxxx.h [SCSI] 3w-xxxx: scsi_dma_unmap fix 2009-05-15 12:24:59 -04:00
53c700.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
53c700.h
53c700.scr
53c700_d.h_shipped
a100u2w.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
a100u2w.h
a2091.c [SCSI] a2091: make 2 functions static 2009-04-03 10:17:31 -05:00
a2091.h [SCSI] a2091: make 2 functions static 2009-04-03 10:17:31 -05:00
a3000.c [SCSI] a3000: make 2 functions static 2009-04-03 10:17:17 -05:00
a3000.h [SCSI] a3000: make 2 functions static 2009-04-03 10:17:17 -05:00
a4000t.c scsi: a4000 - Correct driver unregistration in case of failure 2009-04-22 20:39:06 +02:00
advansys.c tree-wide: fix misspelling of "definition" in comments 2009-12-04 23:41:47 +01:00
aha152x.c
aha152x.h
aha1542.c
aha1542.h
aha1740.c scsi: remove driver_data direct access of struct device 2009-06-15 21:30:27 -07:00
aha1740.h
aic7xxx_old.c
atari_NCR5380.c Remove multiple KERN_ prefixes from printk formats 2009-07-08 10:30:03 -07:00
atari_scsi.c m68k: section mismatch fixes: Atari SCSI 2009-03-26 21:15:29 +01:00
atari_scsi.h
atp870u.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
atp870u.h
BusLogic.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
BusLogic.h
bvme6000_scsi.c scsi/m68k: Kill NCR_700_detect() warnings 2009-03-24 16:38:25 -07:00
ch.c [SCSI] ch: Check NULL for kmalloc() return 2009-08-22 17:52:22 -05:00
constants.c [SCSI] scsi: Add missing command definitions 2009-12-04 12:00:15 -06:00
dc395x.c tree-wide: fix typos "selct" + "slect" -> "select" 2009-11-09 09:40:56 +01:00
dc395x.h
dmx3191d.c tree-wide: fix misspelling of "definition" in comments 2009-12-04 23:41:47 +01:00
dpt_i2o.c dpt_i2o: Fix typo of EINVAL 2009-10-31 12:11:38 -07:00
dpti.h
dtc.c
dtc.h
eata.c block: convert to pos and nr_sectors accessors 2009-05-11 09:50:54 +02:00
eata_generic.h
eata_pio.c [SCSI] Clean up my email address and use a single standard address for everything 2008-12-29 11:24:12 -06:00
eata_pio.h
esp_scsi.c [SCSI] esp_scsi: Use DIV_ROUND_UP 2008-12-29 11:24:14 -06:00
esp_scsi.h
fd_mcs.c
fdomain.c [SCSI] Clean up my email address and use a single standard address for everything 2008-12-29 11:24:12 -06:00
fdomain.h
FlashPoint.c
g_NCR5380.c
g_NCR5380.h
g_NCR5380_mmio.c
gdth.c [SCSI] gdth: Prevent negative offsets in ioctl CVE-2009-3080 2009-11-11 12:14:21 -05:00
gdth.h
gdth_ioctl.h
gdth_proc.c [SCSI] gdth: fix overlapping snprintf users 2009-06-09 10:31:46 -05:00
gdth_proc.h
gvp11.c [SCSI] a2091, gvp11: kill warn_unused_result warnings 2009-01-02 12:16:18 -06:00
gvp11.h
hosts.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-12-09 19:42:25 -08:00
hptiop.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
hptiop.h [SCSI] hptiop: Add RR44xx adapter support 2009-10-02 09:45:22 -05:00
ibmmca.c [SCSI] Clean up my email address and use a single standard address for everything 2008-12-29 11:24:12 -06:00
imm.c
imm.h
in2000.c [SCSI] Clean up my email address and use a single standard address for everything 2008-12-29 11:24:12 -06:00
in2000.h
initio.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
initio.h [SCSI] Clean up my email address and use a single standard address for everything 2008-12-29 11:24:12 -06:00
ipr.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-12-09 19:42:25 -08:00
ipr.h [SCSI] ipr: add workaround for MSI interrupts on P7 2009-11-06 11:09:27 -06:00
ips.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
ips.h
iscsi_tcp.c [SCSI] libiscsi: add warm target reset tmf support 2009-12-04 12:01:36 -06:00
iscsi_tcp.h [SCSI] iscsi_tcp: hook iscsi_tcp into new libiscsi_tcp module 2008-12-29 11:24:22 -06:00
jazz_esp.c
Kconfig [SCSI] fnic: Add FIP support to the fnic driver 2009-12-04 12:01:19 -06:00
lasi700.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
libiscsi.c [SCSI] libiscsi: hook into ramp up/down handling 2009-12-04 12:01:39 -06:00
libiscsi_tcp.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
libsrp.c [SCSI] libsrp: fix memory leak in srp_ring_free() 2009-09-12 09:35:34 -05:00
mac53c94.c Remove multiple KERN_ prefixes from printk formats 2009-07-08 10:30:03 -07:00
mac53c94.h
mac_esp.c [SCSI] mac_esp: fix for quadras with two esp chips 2008-12-29 11:24:19 -06:00
mac_scsi.c
mac_scsi.h
Makefile [SCSI] 3w-sas: Add new driver for LSI 3ware 9750 2009-12-04 12:00:51 -06:00
megaraid.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
megaraid.h tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
mesh.c
mesh.h
mvme16x_scsi.c scsi/m68k: Kill NCR_700_detect() warnings 2009-03-24 16:38:25 -07:00
mvme147.c
mvme147.h
ncr53c8xx.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
ncr53c8xx.h
NCR53c406a.c
NCR5380.c [SCSI] Clean up my email address and use a single standard address for everything 2008-12-29 11:24:12 -06:00
NCR5380.h
NCR_D700.c [SCSI] NCR_D700: fix IRQ handler return type 2009-05-23 15:44:09 -05:00
NCR_D700.h
NCR_Q720.c
NCR_Q720.h
nsp32.c tree-wide: fix a very frequent spelling mistake 2009-11-09 09:40:54 +01:00
nsp32.h
nsp32_debug.c
nsp32_io.h
osst.c [SCSI] osst: replace scsi_execute_async with the block layer API 2009-03-12 12:58:10 -05:00
osst.h [SCSI] osst: replace scsi_execute_async with the block layer API 2009-03-12 12:58:10 -05:00
osst_detect.h
osst_options.h
pas16.c
pas16.h
pmcraid.c [SCSI] pmcraid: support SMI-S object model of storage pool 2009-12-10 08:54:12 -06:00
pmcraid.h [SCSI] pmcraid: support SMI-S object model of storage pool 2009-12-10 08:54:12 -06:00
ppa.c
ppa.h
ps3rom.c ps3rom: Use ps3_system_bus_[gs]et_drvdata() instead of direct access 2009-06-16 14:15:46 +10:00
qla1280.c [SCSI] qla1280: error recovery rewrite 2009-05-20 17:21:13 -05:00
qla1280.h [SCSI] qla1280: error recovery rewrite 2009-05-20 17:21:13 -05:00
qlogicfas.c
qlogicfas408.c [SCSI] Clean up my email address and use a single standard address for everything 2008-12-29 11:24:12 -06:00
qlogicfas408.h
qlogicpti.c [SCSI] qlogicpti: use request_firmware 2009-04-03 09:25:23 -05:00
qlogicpti.h [SCSI] qlogicpti: add missing parentheses 2009-12-04 12:01:28 -06:00
raid_class.c [SCSI] struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-02 10:22:16 -06:00
script_asm.pl
scsi.c [SCSI] add queue_depth ramp up code 2009-12-04 12:00:44 -06:00
scsi.h
scsi_debug.c [SCSI] scsi_debug: fix Thin provisioning support 2009-12-04 12:00:49 -06:00
scsi_devinfo.c [SCSI] fix func names in kernel-doc 2009-12-04 12:01:48 -06:00
scsi_error.c [SCSI] add queue_depth ramp up code 2009-12-04 12:00:44 -06:00
scsi_ioctl.c [SCSI] add scsi target reset support to scsi ioctl 2009-12-04 12:01:33 -06:00
scsi_lib.c [SCSI] Correctly handle thin provisioning write error 2009-12-10 08:54:15 -06:00
scsi_lib_dma.c [SCSI] scsi_lib_dma: fix bug with dma maps on nested scsi objects 2009-12-04 12:01:30 -06:00
scsi_logging.h
scsi_module.c
scsi_netlink.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
scsi_priv.h driver model: constify attribute groups 2009-09-15 09:50:47 -07:00
scsi_proc.c proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
scsi_sas_internal.h
scsi_scan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-12-09 19:42:25 -08:00
scsi_sysctl.c sysctl: Drop & in front of every proc_handler. 2009-11-18 08:37:40 -08:00
scsi_sysfs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2009-12-09 19:42:25 -08:00
scsi_tgt_if.c
scsi_tgt_lib.c block: cleanup rq->data_len usages 2009-05-11 09:50:55 +02:00
scsi_tgt_priv.h
scsi_transport_api.h
scsi_transport_fc.c [SCSI] fc class: fix fc_transport_init error handling 2009-12-10 08:54:11 -06:00
scsi_transport_fc_internal.h
scsi_transport_iscsi.c [SCSI] iscsi class: modify handling of replacement timeout 2009-12-04 12:01:37 -06:00
scsi_transport_sas.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
scsi_transport_spi.c scsi_transport_spi: Blacklist Ultrium-3 tape for IU transfers 2009-06-21 10:52:46 -05:00
scsi_transport_srp.c [SCSI] struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-02 10:22:16 -06:00
scsi_transport_srp_internal.h
scsi_typedefs.h
scsi_wait_scan.c driver synchronization: make scsi_wait_scan more advanced 2009-04-21 19:40:00 -07:00
scsicam.c
sd.c [SCSI] sd: WRITE SAME(16) / UNMAP support 2009-12-10 08:54:15 -06:00
sd.h [SCSI] sd: WRITE SAME(16) / UNMAP support 2009-12-10 08:54:15 -06:00
sd_dif.c [SCSI] sd: Return correct error code for DIF 2009-11-26 08:54:46 -06:00
ses.c [SCSI] ses: update enclosure data on hot add 2009-08-22 17:52:14 -05:00
sg.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6 2009-10-11 11:12:33 -07:00
sgiwd93.c [SCSI] sgiwd93: Fix compilation warning 2009-01-02 10:58:41 -06:00
sim710.c [SCSI] struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-02 10:22:16 -06:00
sni_53c710.c dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) 2009-04-07 08:31:11 -07:00
sr.c [SCSI] sr: consider the last written sector when determining media size 2009-10-02 09:45:46 -05:00
sr.h
sr_ioctl.c [SCSI] sr: report more accurate drive status after closing the tray. 2009-04-27 09:32:30 -05:00
sr_vendor.c
st.c [SCSI] st: fix mdata->page_order handling 2009-12-10 08:54:13 -06:00
st.h [SCSI] st: fix mdata->page_order handling 2009-12-10 08:54:13 -06:00
st_options.h
stex.c [SCSI] stex: update version to 4.6.0000.4 2009-10-29 13:03:27 -04:00
sun3_NCR5380.c Remove multiple KERN_ prefixes from printk formats 2009-07-08 10:30:03 -07:00
sun3_scsi.c
sun3_scsi.h
sun3_scsi_vme.c
sun3x_esp.c
sun_esp.c
sym53c416.c [SCSI] Clean up my email address and use a single standard address for everything 2008-12-29 11:24:12 -06:00
sym53c416.h
t128.c
t128.h
tmscsim.c [SCSI] tmscsim: fix indentation and braces disagreement - add braces 2008-12-29 11:24:14 -06:00
tmscsim.h
u14-34f.c block: convert to pos and nr_sectors accessors 2009-05-11 09:50:54 +02:00
ultrastor.c
ultrastor.h
vmw_pvscsi.c [SCSI] vmw_pvscsi: SCSI driver for VMware's virtual HBA. 2009-12-04 12:00:49 -06:00
vmw_pvscsi.h [SCSI] vmw_pvscsi: SCSI driver for VMware's virtual HBA. 2009-12-04 12:00:49 -06:00
wd33c93.c
wd33c93.h
wd7000.c tree-wide: fix misspelling of "definition" in comments 2009-12-04 23:41:47 +01:00
zalon.c [SCSI] zalon: fix oops on attach failure 2009-06-25 11:37:23 -05:00
zorro7xx.c