Re: [PATCH] ch: add refcounting

2017-08-16 Thread Martin K. Petersen
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

[PATCH] ch: add refcounting

2017-08-15 Thread Hannes Reinecke
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

Re: [PATCH] ch: add refcounting

2014-04-25 Thread Christoph Hellwig
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;

Re: [PATCH] ch: add refcounting

2014-04-10 Thread Christoph Hellwig
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

Re: [PATCH] ch: add refcounting

2014-04-10 Thread Hannes Reinecke
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

[PATCH] ch: add refcounting

2014-04-08 Thread Hannes Reinecke
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