Re: [PATCH 02/15] ide-tape: remove back-to-back REQUEST_SENSE detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, Borislav.

Borislav Petkov wrote:
> sorry for I wasn't that clear. We need the drive->pc ptr valid in order to
> retry a packet command couple lines below in the ->do_request callback:
> 
>         /* Retry a failed packet command */
>         if (drive->failed_pc && drive->pc->c[0] == REQUEST_SENSE) {
>                 pc = drive->failed_pc;
>                 goto out;
>         }

No, that's checking whether the _previous_ command was REQUEST_SENSE
which is guaranteed to be set if drive->failed_pc is not NULL.
drive->pc is set to the current command at the start of
ide_tape_issue_pc().

> @@ -753,6 +753,9 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
>  	struct ide_cmd cmd;
>  	u8 stat;
>  
> +	if (rq->cmd_type == REQ_TYPE_SPECIAL)
> +		drive->pc = pc = (struct ide_atapi_pc *) rq->buffer;
> +
>  	debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %lu,"
>  			" current_nr_sectors: %u\n",
>  			(unsigned long long)rq->sector, rq->nr_sectors,
> @@ -769,7 +772,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
>  	}
>  
>  	/* Retry a failed packet command */
> -	if (drive->failed_pc && drive->pc->c[0] == REQUEST_SENSE) {
> +	if (drive->failed_pc && pc->c[0] == REQUEST_SENSE) {
>  		pc = drive->failed_pc;

So, if you do this, the retry after REQUEST_SENSE logic will never
trigger.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux