mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
iowarrior: use interruptible lock in iowarrior_write()
The function itself, if it has to wait to perform IO, use interruptible sleep. Hence the sleep needed to avoid the write code path racing with itself should also use interruptible sleep. Signed-off-by: Oliver Neukum <oneukum@suse.com> Link: https://patch.msgid.link/20260312094619.1590556-2-oneukum@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
56dd29088c
commit
bcbdfc7fad
|
|
@ -362,13 +362,16 @@ static ssize_t iowarrior_write(struct file *file,
|
|||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct iowarrior *dev;
|
||||
int retval = 0;
|
||||
int retval;
|
||||
char *buf = NULL; /* for IOW24 and IOW56 we need a buffer */
|
||||
struct urb *int_out_urb = NULL;
|
||||
|
||||
dev = file->private_data;
|
||||
|
||||
mutex_lock(&dev->mutex);
|
||||
retval = mutex_lock_interruptible(&dev->mutex);
|
||||
if (retval < 0)
|
||||
return -EINTR;
|
||||
|
||||
/* verify that the device wasn't unplugged */
|
||||
if (!dev->present) {
|
||||
retval = -ENODEV;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user