[PATCH] drivers/scsi/st.c: decrement in_use under the lock in st_open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, this patch changes the err_out case in st_open to decrement STp->in_use under the st_dev_arr_lock.

I'm just basing this on looking at the code (I didn't run into an actual problem here), but it seems like the right thing to do; st_open and release hold the lock when adjusting in_use in other places.

This is against kernel 2.6.12-rc2.

Nate Dailey
Stratus Technologies


Signed-off-by: Nate Dailey <nate.dailey@xxxxxxxxxxx>


--- linux-2.6.12-rc2/drivers/scsi/st.c.orig	2005-04-20 11:28:39.000000000 -0400
+++ linux-2.6.12-rc2/drivers/scsi/st.c	2005-04-20 11:30:08.000000000 -0400
@@ -1115,7 +1115,9 @@ static int st_open(struct inode *inode, 
 
  err_out:
 	normalize_buffer(STp->buffer);
+	write_lock(&st_dev_arr_lock);
 	STp->in_use = 0;
+	write_unlock(&st_dev_arr_lock);
 	scsi_device_put(STp->device);
 	return retval;
 

-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux