Skip to contentSkip to conversation

check capacity in ide_task_init_flush()

PATCH Chuck Ebbert 1 participant 1 message Mar 4, 2005 libata

lore
Share & tools
lore
#0 lore raw

drivers/ide/ide-io.c 2005-02-23 20:58:16 +01:00 line 65

Quoted 9 lines · Bartlomiej Zolnierkiewicz
drivers/ide/ide-io.c 2005-02-23 20:58:16 +01:00 +2 -1
@@ -61,7 +61,8 @@
 
      memset(task, 0, sizeof(*task));
 
-     if (ide_id_has_flush_cache_ext(drive->id)) {
+     if (ide_id_has_flush_cache_ext(drive->id) &&
+         (drive->capacity64 >= (1UL << 28))) {
                               ^^

------------------------------>||

drivers/ide/ide-io.c 2005-02-23 20:58:16 +01:00 line 68

Quoted 3 lines
drivers/ide/ide-io.c 2005-02-23 20:58:16 +01:00 +0 -0
              tf->command = WIN_FLUSH_CACHE_EXT;
              tf->flags |= ATA_TFLAG_LBA48;
      } else

Shouldn't that be ">" ???

Either that or this code from ide-disk is wrong:

        /* limit drive capacity to 137GB if LBA48 cannot be used */
        if (drive->addressing == 0 && drive->capacity64 > 1ULL << 28) {
                printk(KERN_WARNING "%s: cannot use LBA48 - full capacity "
                       "%llu sectors (%llu MB)\n",
                       drive->name, (unsigned long long)drive->capacity64,
                       sectors_to_MB(drive->capacity64));
                drive->capacity64 = 1ULL << 28;
        }

--
Chuck