]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
target: Avoid dropping AllRegistrants reservation during unregister
authorNicholas Bellinger <nab@linux-iscsi.org>
Mon, 15 Dec 2014 19:50:26 +0000 (11:50 -0800)
committerJiri Slaby <jslaby@suse.cz>
Thu, 9 Apr 2015 11:14:22 +0000 (13:14 +0200)
commit24987ee3a7ed7d8c853b8c2f10d2c37253558c13
tree1844f4153616e8dc56ecba8fecb250f935c953fa
parentfcc609e5de6667b5239a62f5b6dac055281c90e6
target: Avoid dropping AllRegistrants reservation during unregister

commit 6c3c9baa0debeb4bcc52a78c4463a0a97518de10 upstream.

This patch fixes an issue with AllRegistrants reservations where
an unregister operation by the I_T nexus reservation holder would
incorrectly drop the reservation, instead of waiting until the
last active I_T nexus is unregistered as per SPC-4.

This includes updating __core_scsi3_complete_pro_release() to reset
dev->dev_pr_res_holder with another pr_reg for this special case,
as well as a new 'unreg' parameter to determine when the release
is occuring from an implicit unregister, vs. explicit RELEASE.

It also adds special handling in core_scsi3_free_pr_reg_from_nacl()
to release the left-over pr_res_holder, now that pr_reg is deleted
from pr_reg_list within __core_scsi3_complete_pro_release().

Reported-by: Ilias Tsitsimpis <i.tsitsimpis@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/target/target_core_pr.c