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]

 



Hi,

On Sat, Apr 18, 2009 at 06:12:07AM +0900, Tejun Heo wrote:
> Hello,
> 
> Borislav Petkov wrote:
> > Honestly, I don't know. The code predates even the initial git
> > commit of the kernel so I guess nobody knows?
> 
> Heh.. maybe Mark does.
> 
> > And yeah, such a check looks a bit too much so I won't have any
> > problem with removing it. Nevertheless, we need the small fix above
> > in the ->do_request callback for all other packet commands since
> > ide-tape uses currently ide_queue_pc_tail() for sending those. I
> > know, I know, it is ugly and we're working on it :).
> 
> Can you explain a bit more about the bug?  I'm not really following.

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;
        }

Generally, throughout the request path of a command through the driver,
drive->pc points to it, that's why we need that assignment. As I said
before, this'll be fixed rather sooner than later so consider it a
temporary hack :). Something like the following, for example, should
suffice for now IMHO.

--
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index cb942a9..40e6de7 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -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;
 		goto out;
 	}

-- 
Regards/Gruss,
    Boris.
--
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