Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

IB/srp: Make writing the add_target sysfs attr interruptible

Avoid that shutdown of srp_daemon is delayed if add_target_mutex is
held by another process.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>

authored by

Bart Van Assche and committed by
Doug Ledford
4fa354c9 290081b4

+4 -1
+4 -1
drivers/infiniband/ulp/srp/ib_srp.c
··· 3299 3299 */ 3300 3300 scsi_host_get(target->scsi_host); 3301 3301 3302 - mutex_lock(&host->add_target_mutex); 3302 + ret = mutex_lock_interruptible(&host->add_target_mutex); 3303 + if (ret < 0) 3304 + goto put; 3303 3305 3304 3306 ret = srp_parse_options(buf, target); 3305 3307 if (ret) ··· 3457 3455 out: 3458 3456 mutex_unlock(&host->add_target_mutex); 3459 3457 3458 + put: 3460 3459 scsi_host_put(target->scsi_host); 3461 3460 if (ret < 0) 3462 3461 scsi_host_put(target->scsi_host);