ACK w/cmt: [Utopic][PATCH v2] UBUNTU: SAUCE: Revert "sd: don't use scsi_setup_blk_pc_cmnd for flush requests"

Stefan Bader stefan.bader at canonical.com
Wed Oct 1 07:19:18 UTC 2014


On 30.09.2014 21:13, Chris J Arges wrote:
> BugLink: http://bugs.launchpad.net/bugs/1375452
> 
> This reverts commit 32f7682bb0f71eaf88388e05af00cbc14edc9bd7.
> Note: this also keeps commit aac35036f7ab00b8cb2a4c99b42cffb33d98aa42.

I guess the rework of the function was just pulled in as a pre-requisite to
allow the change about timeout multiplier (which you now kept) apply cleanly.
And either we miss something that allows that rework or upstream has not found
the issue. It appears to be ok but I would hope to see the hyper-v side
verified, too. If that is easy to do...

-Stefan

> 
> Signed-off-by: Chris J Arges <chris.j.arges at canonical.com>
> 
> Conflicts:
> 	drivers/scsi/sd.c
> ---
>  drivers/scsi/sd.c | 20 +++++++-------------
>  1 file changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index bb77c0e..c0f54d2 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -830,20 +830,14 @@ static int sd_setup_write_same_cmnd(struct scsi_device *sdp, struct request *rq)
>  	return ret;
>  }
>  
> -static int sd_setup_flush_cmnd(struct scsi_cmnd *cmd)
> +static int scsi_setup_flush_cmnd(struct scsi_device *sdp, struct request *rq)
>  {
> -	struct request *rq = cmd->request;
> -
> -	/* flush requests don't perform I/O, zero the S/G table */
> -	memset(&cmd->sdb, 0, sizeof(cmd->sdb));
> -
> -	cmd->cmnd[0] = SYNCHRONIZE_CACHE;
> -	cmd->cmd_len = 10;
> -	cmd->transfersize = 0;
> -	cmd->allowed = SD_MAX_RETRIES;
> -
>  	rq->timeout = rq->q->rq_timeout * SD_FLUSH_TIMEOUT_MULTIPLIER;
> -	return BLKPREP_OK;
> +	rq->retries = SD_MAX_RETRIES;
> +	rq->cmd[0] = SYNCHRONIZE_CACHE;
> +	rq->cmd_len = 10;
> +
> +	return scsi_setup_blk_pc_cmnd(sdp, rq);
>  }
>  
>  static void sd_uninit_command(struct scsi_cmnd *SCpnt)
> @@ -883,7 +877,7 @@ static int sd_init_command(struct scsi_cmnd *SCpnt)
>  		ret = sd_setup_write_same_cmnd(sdp, rq);
>  		goto out;
>  	} else if (rq->cmd_flags & REQ_FLUSH) {
> -		ret = sd_setup_flush_cmnd(SCpnt);
> +		ret = scsi_setup_flush_cmnd(sdp, rq);
>  		goto out;
>  	}
>  	ret = scsi_setup_fs_cmnd(sdp, rq);
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20141001/8fe9b7d9/attachment.sig>


More information about the kernel-team mailing list