uas: fix GFP_NOIO under spinlock
Quote Dan: The patche36e64930c
: "uas: Use GFP_NOIO rather then GFP_ATOMIC where possible" from Nov 7, 2013, leads to the following static checker warning: drivers/usb/storage/uas.c:806 uas_eh_task_mgmt() error: scheduling with locks held: 'spin_lock:lock' Some other allocations under spinlock are not caught. The fix essentially revertse36e64930c
Signed-off-by: Oliver Neukum <oliver@neukum.org> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f7a8719560
commit
e7eda93293
@@ -137,7 +137,7 @@ static void uas_do_work(struct work_struct *work)
|
|||||||
if (!(cmdinfo->state & IS_IN_WORK_LIST))
|
if (!(cmdinfo->state & IS_IN_WORK_LIST))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
err = uas_submit_urbs(cmnd, cmnd->device->hostdata, GFP_NOIO);
|
err = uas_submit_urbs(cmnd, cmnd->device->hostdata, GFP_ATOMIC);
|
||||||
if (!err)
|
if (!err)
|
||||||
cmdinfo->state &= ~IS_IN_WORK_LIST;
|
cmdinfo->state &= ~IS_IN_WORK_LIST;
|
||||||
else
|
else
|
||||||
@@ -803,7 +803,7 @@ static int uas_eh_task_mgmt(struct scsi_cmnd *cmnd,
|
|||||||
|
|
||||||
devinfo->running_task = 1;
|
devinfo->running_task = 1;
|
||||||
memset(&devinfo->response, 0, sizeof(devinfo->response));
|
memset(&devinfo->response, 0, sizeof(devinfo->response));
|
||||||
sense_urb = uas_submit_sense_urb(cmnd, GFP_NOIO,
|
sense_urb = uas_submit_sense_urb(cmnd, GFP_ATOMIC,
|
||||||
devinfo->use_streams ? tag : 0);
|
devinfo->use_streams ? tag : 0);
|
||||||
if (!sense_urb) {
|
if (!sense_urb) {
|
||||||
shost_printk(KERN_INFO, shost,
|
shost_printk(KERN_INFO, shost,
|
||||||
@@ -813,7 +813,7 @@ static int uas_eh_task_mgmt(struct scsi_cmnd *cmnd,
|
|||||||
spin_unlock_irqrestore(&devinfo->lock, flags);
|
spin_unlock_irqrestore(&devinfo->lock, flags);
|
||||||
return FAILED;
|
return FAILED;
|
||||||
}
|
}
|
||||||
if (uas_submit_task_urb(cmnd, GFP_NOIO, function, tag)) {
|
if (uas_submit_task_urb(cmnd, GFP_ATOMIC, function, tag)) {
|
||||||
shost_printk(KERN_INFO, shost,
|
shost_printk(KERN_INFO, shost,
|
||||||
"%s: %s: submit task mgmt urb failed\n",
|
"%s: %s: submit task mgmt urb failed\n",
|
||||||
__func__, fname);
|
__func__, fname);
|
||||||
|
Reference in New Issue
Block a user