[PATCH] libata: fix WARN_ON() condition in *_fill_sg()
authorTejun Heo <htejun@gmail.com>
Mon, 20 Feb 2006 14:48:37 +0000 (23:48 +0900)
committerJeff Garzik <jgarzik@pobox.com>
Mon, 20 Feb 2006 21:48:17 +0000 (16:48 -0500)
For ATAPI commands, padding can reduce qc->n_elem by one and thus to
zero making assert(qc->n_elem > 0)'s in ata_fill_sg() and qs_fill_sg()
fail for legal commands.  This patch fixes the assert()'s to take
qc->pad_len into account.

Although the condition check seems a bit excessive, as this part of
code isn't still stable yet, I think it's worth to keep those.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>

No differences found