aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@gmail.com>2009-05-01 14:29:53 -0400
committerBorislav Petkov <petkovbb@gmail.com>2009-05-15 00:43:45 -0400
commit10c0b3437c4dc0d14ac254bbe71e54ea5f238d97 (patch)
tree8d40e72ad1c096bcb4d4ca0475f62e9bebbec647 /drivers
parent77f6bf57ba9d2c50173536dbfdacdab27cb867ca (diff)
ide-tape: fix potential fs requests bug
ide-tape had a potential bug for fs requests when preparing the command packet: it was writing the transfer length as a number of fixed blocks. However, the block layer implies 512 byte blocks and ide-tape can have other block sizes so account for that too. ide-floppy does this calculation properly with the block size factor (floppy->bs_factor). Signed-off-by: Borislav Petkov <petkovbb@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ide/ide-tape.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index e16604562f28..fc79cf4812f3 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -586,7 +586,7 @@ static void ide_tape_create_rw_cmd(idetape_tape_t *tape,
586 struct ide_atapi_pc *pc, struct request *rq, 586 struct ide_atapi_pc *pc, struct request *rq,
587 u8 opcode) 587 u8 opcode)
588{ 588{
589 unsigned int length = blk_rq_sectors(rq); 589 unsigned int length = blk_rq_sectors(rq) / (tape->blk_size >> 9);
590 590
591 ide_init_pc(pc); 591 ide_init_pc(pc);
592 put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]); 592 put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]);