Hannes,
> struct scsi_changer needs refcounting as the device might be removed
> while the fd is still open.
Applied to 4.14/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
struct scsi_changer needs refcounting as the device
might be removed while the fd is still open.
Signed-off-by: Hannes Reinecke
---
drivers/scsi/ch.c | 22 +++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
On Thu, Apr 10, 2014 at 04:12:57PM +0200, Hannes Reinecke wrote:
On 04/10/2014 01:51 PM, Christoph Hellwig wrote:
static int
ch_release(struct inode *inode, struct file *file)
{
scsi_changer *ch = file-private_data;
scsi_device_put(ch-device);
+ ch-device = NULL;
static int
ch_release(struct inode *inode, struct file *file)
{
scsi_changer *ch = file-private_data;
scsi_device_put(ch-device);
+ ch-device = NULL;
file-private_data = NULL;
+ kref_put(ch-ref, ch_destroy);
Any reason you need to put the scsi_device here
On 04/10/2014 01:51 PM, Christoph Hellwig wrote:
static int
ch_release(struct inode *inode, struct file *file)
{
scsi_changer *ch = file-private_data;
scsi_device_put(ch-device);
+ch-device = NULL;
file-private_data = NULL;
+kref_put(ch-ref, ch_destroy);
Any
The 'scsi_changer' structure needs refcounting, as the device
might be removed while the fd is still open.
Signed-off-by: Hannes Reinecke h...@suse.de
---
drivers/scsi/ch.c | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
6 matches
Mail list logo