Re: 2.6.6-mm5 oops mounting ext3 or reiserfs with -o barrier

From: Kurt Garloff
Date: Sun May 23 2004 - 05:40:13 EST


Hi Jens,

On Sun, May 23, 2004 at 10:27:28AM +0200, Jens Axboe wrote:
> @@ -1729,8 +1723,29 @@ static void idedisk_setup (ide_drive_t *
>
> write_cache(drive, 1);
>
> - blk_queue_ordered(drive->queue, 1);
> - blk_queue_issue_flush_fn(drive->queue, idedisk_issue_flush);
> + /*
> + * decide if we can sanely support flushes and barriers on
> + * this drive
> + */
> + if (drive->addressing == 1) {
> + /*
> + * if capacity is over 2^28 sectors, drive must support
> + * FLUSH_CACHE_EXT
> + */
> + if (ide_id_has_flush_cache_ext(id))
> + barrier = 1;
> + else if (capacity <= (1ULL << 28))
> + barrier = 1;
> + else
> + printk("%s: drive is buggy, no support for FLUSH_CACHE_EXT with lba48\n", drive->name);

So, for drives with LBA48, you enable barriers either if report to
support it or if their capacity is _smaller_ than 2^28. If neither
is the case, it's left disabled and the kernel complains.
Is it safe to enable for
(addressing == 1 && !ide_id_has_flush_cache_ext() && capacity <= 1<<28)
?
Shouldn't we check ide_has_flush_cache() then, as for the non-
LBA48 drives?

> + } else if (ide_id_has_flush_cache(id))
> + barrier = 1;

Regards,
--
Kurt Garloff <garloff@xxxxxxx> Cologne, DE
SUSE LINUX AG / Novell, Nuernberg, DE Director SUSE Labs

Attachment: pgp00000.pgp
Description: PGP signature