diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2009-01-13 12:38:36 +0300 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-01-13 18:34:59 +0300 |
commit | a0f79f7ad3e52b908786462cf5446ebe20fe14fa (patch) | |
tree | f2a62710f5ed0c42f56e3efa6667821ec216ce8e | |
parent | 37a76bd4f1b716949fc38a6842e89f0ccb8384d0 (diff) | |
download | linux-a0f79f7ad3e52b908786462cf5446ebe20fe14fa.tar.xz |
ata: fix wrong WARN_ON_ONCE
This patch fixes a wrong WARN_ON that was triggered by 32bit PIO support:
WARNING: at drivers/ata/libata-sff.c:1017 ata_sff_hsm_move+0x45e/0x750()
__atapi_pio_bytes simply doesnt know enough to decide if there is a bug.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | drivers/ata/libata-sff.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 0eae9b453556..5a4aad123c42 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c @@ -1013,9 +1013,12 @@ next_sg: qc->cursg_ofs = 0; } - /* consumed can be larger than count only for the last transfer */ - WARN_ON_ONCE(qc->cursg && count != consumed); - + /* + * There used to be a WARN_ON_ONCE(qc->cursg && count != consumed); + * Unfortunately __atapi_pio_bytes doesn't know enough to do the WARN + * check correctly as it doesn't know if it is the last request being + * made. Somebody should implement a proper sanity check. + */ if (bytes) goto next_sg; return 0; |