Re: [bug] ata subsystem related crash with latest -git

Jeff Garzik
2007-10-18T09:02:18Z

Jens Axboe wrote:
> index 4df8311..b858183 100644
> --- a/drivers/ata/sata_mv.c
> +++ b/drivers/ata/sata_mv.c
> @@ -1139,6 +1139,7 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
> struct mv_port_priv *pp = qc->ap->private_data;
> struct scatterlist *sg;
> struct mv_sg *mv_sg;
> + int end_marked = 0;
>
> mv_sg = pp->sg_tbl;
> ata_for_each_sg(sg, qc) {
> @@ -1159,13 +1160,15 @@ static void mv_fill_sg(struct ata_queued_cmd *qc)
> sg_len -= len;
> addr += len;
>
> - if (!sg_len && ata_sg_is_last(sg, qc))
> + if (!sg_len && ata_sg_is_last(sg, qc)) {
> mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL);
> + end_marked++;
> + }
>
> mv_sg++;
> }
> -
> }
> + BUG_ON(end_marked != 1);

Your BUG_ON() does indeed trip, here.

Its surprising that other folks don't explode, considering that
mv_fill_sg() intentionally mirrors the logic in ata_fill_sg().

Jeff