[SCSI] fix up scsi_eh_lock_door()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, June 12, 2009 - 11:03 am

Gitweb:     http://git.kernel.org/linus/91bc31fb3bae4e55832c7c39d4f9c193285e6ab2
Commit:     91bc31fb3bae4e55832c7c39d4f9c193285e6ab2
Parent:     477e608c03eb2f561a23994bee38a32a9fd3357d
Author:     James Bottomley <James.Bottomley@HansenPartnership.com>
AuthorDate: Sun May 17 09:30:48 2009 -0500
Committer:  James Bottomley <James.Bottomley@HansenPartnership.com>
CommitDate: Mon Jun 8 12:47:40 2009 -0500

    [SCSI] fix up scsi_eh_lock_door()
    
    The Documentation is incorrect (we removed some functions referred to), and
    none of the bug warnings now apply.  Additionally remove the spurious check on
    the return from blk_get_request() which can't fail if __GFP_WAIT is passed in.
    
    Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 drivers/scsi/scsi_error.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index a95d2ba..a168935 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1451,28 +1451,21 @@ static void eh_lock_door_done(struct request *req, int uptodate)
  * @sdev:	SCSI device to prevent medium removal
  *
  * Locking:
- * 	We must be called from process context; scsi_allocate_request()
- * 	may sleep.
+ * 	We must be called from process context.
  *
  * Notes:
  * 	We queue up an asynchronous "ALLOW MEDIUM REMOVAL" request on the
  * 	head of the devices request queue, and continue.
- *
- * Bugs:
- * 	scsi_allocate_request() may sleep waiting for existing requests to
- * 	be processed.  However, since we haven't kicked off any request
- * 	processing for this host, this may deadlock.
- *
- *	If scsi_allocate_request() fails for what ever reason, we
- *	completely forget to lock the door.
  */
 static void scsi_eh_lock_door(struct scsi_device *sdev)
 {
 	struct request *req;
 
+	/*
+	 * blk_get_request with GFP_KERNEL (__GFP_WAIT) sleeps until a
+	 * request becomes available
+	 */
 	req = blk_get_request(sdev->request_queue, READ, GFP_KERNEL);
-	if (!req)
-		return;
 
 	req->cmd[0] = ALLOW_MEDIUM_REMOVAL;
 	req->cmd[1] = 0;
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[SCSI] fix up scsi_eh_lock_door(), Linux Kernel Mailing ..., (Fri Jun 12, 11:03 am)