From: Borislav Petkov <petkovbb@googlemail.com>
To: bzolnier@gmail.com
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 01/15] ide-tape: fix potential fs requests bug
Date: Fri, 15 May 2009 07:11:19 +0200 [thread overview]
Message-ID: <1242364293-29223-2-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1242364293-29223-1-git-send-email-petkovbb@gmail.com>
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>
---
drivers/ide/ide-tape.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index e166045..fc79cf4 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]);
--
1.6.3
WARNING: multiple messages have this Message-ID (diff)
From: Borislav Petkov <petkovbb@googlemail.com>
To: <bzolnier@gmail.com>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 01/15] ide-tape: fix potential fs requests bug
Date: Fri, 15 May 2009 07:11:19 +0200 [thread overview]
Message-ID: <1242364293-29223-2-git-send-email-petkovbb@gmail.com> (raw)
In-Reply-To: <1242364293-29223-1-git-send-email-petkovbb@gmail.com>
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>
---
drivers/ide/ide-tape.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index e166045..fc79cf4 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]);
--
1.6.3
next prev parent reply other threads:[~2009-05-15 5:11 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-15 5:11 [PATCH 0/15 v2] ide-atapi: remove pc->buf and misc cleanups Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov [this message]
2009-05-15 5:11 ` [PATCH 01/15] ide-tape: fix potential fs requests bug Borislav Petkov
2009-05-15 5:11 ` [PATCH 02/15] ide-atapi: switch to blk_rq_bytes() on do_request() path Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 03/15] ide-atapi: switch to rq->resid_len Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 04/15] ide-atapi: add a len-parameter to ide_queue_pc_tail Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 05/15] ide-atapi: add a buffer-arg " Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 06/15] ide-floppy/ide_floppy_get_flexible_disk_page: use local buffer Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 07/15] ide-floppy/ide_floppy_get_sfrp_bit: " Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 08/15] ide-floppy/ide_floppy_format_unit: " Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 09/15] ide-atapi: use local sense buffer Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 10/15] ide-floppy/ide_floppy_get_format_progress: " Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 11/15] ide-tape/ide_tape_get_bsize_from_bdesc: use local buffer Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 12/15] ide-tape: fix READ POSITION cmd handling Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 13/15] ide-atapi: remove pc->buf Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 14/15] ide-cd: use whole request_sense buffer in EH Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-15 5:11 ` [PATCH 15/15] ide: unify interrupt reason checking Borislav Petkov
2009-05-15 5:11 ` Borislav Petkov
2009-05-16 19:07 ` [PATCH 0/15 v2] ide-atapi: remove pc->buf and misc cleanups Bartlomiej Zolnierkiewicz
2009-05-16 19:23 ` Borislav Petkov
2009-05-16 19:35 ` Bartlomiej Zolnierkiewicz
2009-05-17 10:33 ` Borislav Petkov
2009-05-17 13:12 ` Bartlomiej Zolnierkiewicz
2009-05-16 22:08 ` Tejun Heo
2009-05-17 10:26 ` Borislav Petkov
2009-05-17 10:36 ` Bartlomiej Zolnierkiewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1242364293-29223-2-git-send-email-petkovbb@gmail.com \
--to=petkovbb@googlemail.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.