summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@gmail.com>2009-05-01 22:29:53 +0400
committerBorislav Petkov <petkovbb@gmail.com>2009-05-15 08:43:45 +0400
commit10c0b3437c4dc0d14ac254bbe71e54ea5f238d97 (patch)
tree8d40e72ad1c096bcb4d4ca0475f62e9bebbec647 /drivers/ide/ide-tape.c
parent77f6bf57ba9d2c50173536dbfdacdab27cb867ca (diff)
downloadlinux-10c0b3437c4dc0d14ac254bbe71e54ea5f238d97.tar.xz
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/ide/ide-tape.c')
-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,
struct ide_atapi_pc *pc, struct request *rq,
u8 opcode)
{
- unsigned int length = blk_rq_sectors(rq);
+ unsigned int length = blk_rq_sectors(rq) / (tape->blk_size >> 9);
ide_init_pc(pc);
put_unaligned(cpu_to_be32(length), (unsigned int *) &pc->c[1]);