Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 158807 Details for
Bug 244097
SCSI: set error value when failing commands in prep_fn
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
handle retry and fix leak
fix-scsi-prep-leak-and-retry2.patch (text/plain), 3.17 KB, created by
Mike Christie
on 2007-07-09 21:42:30 UTC
(
hide
)
Description:
handle retry and fix leak
Filename:
MIME Type:
Creator:
Mike Christie
Created:
2007-07-09 21:42:30 UTC
Size:
3.17 KB
patch
obsolete
>--- linux-2.6.9/drivers/scsi/scsi_lib.c 2007-07-09 11:54:06.000000000 -0500 >+++ linux-2.6.9.work/drivers/scsi/scsi_lib.c 2007-07-09 12:12:54.000000000 -0500 >@@ -62,6 +62,27 @@ struct scsi_host_sg_pool scsi_sg_pools[] > }; > #undef SP > >+/* >+ * Function: scsi_unprep_request() >+ * >+ * Purpose: Remove all preparation done for a request, including its >+ * associated scsi_cmnd, so that it can be requeued. >+ * >+ * Arguments: req - request to unprepare >+ * >+ * Lock status: Assumed that no locks are held upon entry. >+ * >+ * Returns: Nothing. >+ */ >+static void scsi_unprep_request(struct request *req) >+{ >+ struct scsi_cmnd *cmd = req->special; >+ >+ req->flags &= ~REQ_DONTPREP; >+ req->special = NULL; >+ >+ scsi_put_command(cmd); >+} > > /* > * Function: scsi_insert_special_req() >@@ -977,7 +998,7 @@ static int scsi_init_io(struct scsi_cmnd > */ > sgpnt = scsi_alloc_sgtable(cmd, GFP_ATOMIC); > if (unlikely(!sgpnt)) { >- req->flags |= REQ_SPECIAL; >+ scsi_unprep_request(req); > return BLKPREP_DEFER; > } > >@@ -1042,7 +1063,7 @@ static int scsi_prep_fn(struct request_q > if (unlikely(!scsi_device_online(sdev))) { > printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to offline device\n", > sdev->host->host_no, sdev->id, sdev->lun); >- return BLKPREP_KILL; >+ goto kill; > } > if (unlikely(sdev->sdev_state != SDEV_RUNNING)) { > /* OK, we're not in a running state don't prep >@@ -1052,7 +1073,7 @@ static int scsi_prep_fn(struct request_q > * at all allowed down */ > printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to dead device\n", > sdev->host->host_no, sdev->id, sdev->lun); >- return BLKPREP_KILL; >+ goto kill; > } > /* OK, we only allow special commands (i.e. not > * user initiated ones */ >@@ -1084,11 +1105,11 @@ static int scsi_prep_fn(struct request_q > if(unlikely(specials_only)) { > if(specials_only == SDEV_QUIESCE || > specials_only == SDEV_BLOCK) >- return BLKPREP_DEFER; >+ goto defer; > > printk(KERN_ERR "scsi%d (%d:%d): rejecting I/O to device being removed\n", > sdev->host->host_no, sdev->id, sdev->lun); >- return BLKPREP_KILL; >+ goto kill; > } > > >@@ -1106,7 +1127,7 @@ static int scsi_prep_fn(struct request_q > cmd->tag = req->tag; > } else { > blk_dump_rq_flags(req, "SCSI bad req"); >- return BLKPREP_KILL; >+ goto kill; > } > > /* note the overloading of req->special. When the tag >@@ -1144,8 +1165,13 @@ static int scsi_prep_fn(struct request_q > * required). > */ > ret = scsi_init_io(cmd); >- if (ret) /* BLKPREP_KILL return also releases the command */ >- return ret; >+ /* if not successful scsi_init_io will release the scsi_cmnd */ >+ switch(ret) { >+ case BLKPREP_KILL: >+ goto kill; >+ case BLKPREP_DEFER: >+ goto defer; >+ } > > /* > * Initialize the actual SCSI command for this request. >@@ -1154,7 +1180,7 @@ static int scsi_prep_fn(struct request_q > if (unlikely(!drv->init_command(cmd))) { > scsi_release_buffers(cmd); > scsi_put_command(cmd); >- return BLKPREP_KILL; >+ goto kill; > } > } > >@@ -1171,6 +1197,9 @@ static int scsi_prep_fn(struct request_q > if (sdev->device_busy == 0) > blk_plug_device(q); > return BLKPREP_DEFER; >+ kill: >+ req->errors = DID_NO_CONNECT << 16; >+ return BLKPREP_KILL; > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244097
: 158807