linux-stable/drivers/target
Andy Grover f56574a2b5 target/user: Recalculate pad size inside is_ring_space_avail()
If more than one thread is waiting for command ring space that includes
a PAD, then if the first one finishes (inserts a PAD and a CMD at the
start of the cmd ring) then the second one will incorrectly think it still
needs to insert a PAD (i.e. cmdr_space_needed is now wrong.) This will
lead to it asking for more space than it actually needs, and then inserting
a PAD somewhere else than at the end -- not what we want.

This patch moves the pad calculation inside is_ring_space_available() so
in the above scenario the second thread would then ask for space not
including a PAD. The patch also inserts a PAD op based upon an up-to-date
cmd_head, instead of the potentially stale value.

Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2014-10-03 11:16:12 -07:00
..
iscsi iscsi-target: use strlcpy in iscsit_collect_login_stats 2014-09-17 13:54:38 -07:00
loopback tcm_loop: Fixup tag handling 2014-10-03 11:16:12 -07:00
sbp target: Pass in transport supported PI at session initialization 2014-04-07 01:48:54 -07:00
tcm_fc tcm_fc: Replace rcu_assign_pointer() with RCU_INIT_POINTER() 2014-09-15 14:27:33 -07:00
Kconfig target: Add a user-passthrough backstore 2014-10-03 11:15:20 -07:00
Makefile target: Add a user-passthrough backstore 2014-10-03 11:15:20 -07:00
target_core_alua.c target: encapsulate smp_mb__after_atomic() 2014-10-01 14:39:06 -07:00
target_core_alua.h target_core_alua: Referrals configfs integration 2014-01-09 21:48:35 -08:00
target_core_configfs.c target: Fix possible memory leak in aptpl_metadata parsing 2014-09-17 14:16:54 -07:00
target_core_device.c target: encapsulate smp_mb__after_atomic() 2014-10-01 14:39:06 -07:00
target_core_fabric_configfs.c target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun 2014-10-01 14:38:48 -07:00
target_core_fabric_lib.c target: fix pr_out length in iscsi_parse_pr_out_transport_id 2014-09-17 15:17:35 -07:00
target_core_file.c target: correctly handle match_int errors in FILEIO + PSCSI 2014-09-17 15:20:57 -07:00
target_core_file.h Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2014-01-31 15:31:23 -08:00
target_core_hba.c target: Update copyright ownership/year information to 2013 2013-09-10 20:23:36 -07:00
target_core_iblock.c arch: Mass conversion of smp_mb__*() 2014-04-18 14:20:48 +02:00
target_core_iblock.h target: kill struct se_subsystem_dev 2012-11-06 20:55:43 -08:00
target_core_internal.h target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun 2014-10-01 14:38:48 -07:00
target_core_pr.c target: encapsulate smp_mb__after_atomic() 2014-10-01 14:39:06 -07:00
target_core_pr.h drivers: target: Move prototype declaration of function to header file target_core_pr.h 2014-01-09 21:48:36 -08:00
target_core_pscsi.c target: correctly handle match_int errors in FILEIO + PSCSI 2014-09-17 15:20:57 -07:00
target_core_pscsi.h target: kill struct se_subsystem_dev 2012-11-06 20:55:43 -08:00
target_core_rd.c target/rd: T10-Dif: RAM disk is allocating more space than required. 2014-04-07 01:48:53 -07:00
target_core_rd.h target/rd: Add support for protection SGL setup + release 2014-01-19 02:22:05 +00:00
target_core_sbc.c target: Remove unneeded check in sbc_parse_cdb 2014-10-02 21:35:53 -07:00
target_core_spc.c target: Report correct response length for some commands 2014-06-11 12:15:30 -07:00
target_core_stat.c target: Convert se_device statistics to atomic_long_t 2013-11-13 18:34:55 -08:00
target_core_tmr.c target: simplify core_tmr_abort_task 2014-10-01 14:39:10 -07:00
target_core_tpg.c target: Remove core_tpg_release_virtual_lun0 function 2014-10-01 14:38:57 -07:00
target_core_transport.c target: Add a user-passthrough backstore 2014-10-03 11:15:20 -07:00
target_core_ua.c target: encapsulate smp_mb__after_atomic() 2014-10-01 14:39:06 -07:00
target_core_ua.h target: target_core_ua_h: Add #define of include guard 2014-09-15 14:27:43 -07:00
target_core_user.c target/user: Recalculate pad size inside is_ring_space_avail() 2014-10-03 11:16:12 -07:00
target_core_xcopy.c target: cleanup some boolean tests 2014-06-06 14:21:01 -07:00
target_core_xcopy.h target: Add support for EXTENDED_COPY copy offload emulation 2013-09-10 16:48:43 -07:00