Friday, September 10, 2010

Why dmesg is showing write through when the disk connected to Adaptec AAC-RAID is set to write back as per Adaptec Storage Manager?

dmesg command is showing following output.

Vendor: Adaptec Model: Data Rev: V1.0
Type: Direct-Access ANSI SCSI revision: 02
sdb : very big device. try to use READ CAPACITY(16).
SCSI device sdb: 9762222080 512-byte hdwr sectors (4998258 MB)
sdb: Write Protect is off
sdb: Mode Sense: 06 00 10 00
SCSI device sdb: drive cache: write through w/ FUA
sdb : very big device. try to use READ CAPACITY(16).
SCSI device sdb: 9762222080 512-byte hdwr sectors (4998258 MB)
sdb: Write Protect is off
sdb: Mode Sense: 06 00 10 00
SCSI device sdb: drive cache: write through w/ FUA
sdb: sdb1
sd 0:0:1:0: Attached scsi removable disk sdb

This is expected behavior.

What the aacraid driver reports is independent of the firmware settings configured by the storage manager. Instead, the write back configuration the aacraid driver reports is controlled the variable aac_cache (which can be set by a module parameter named cache).

From drivers/scsi/aacraid/aachba.c:

static int aac_cache = 2; /* WCE=0 to avoid performance problems */

...

module_param_named(cache, aac_cache, int, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n"
"\tbit 0 - Disable FUA in WRITE SCSI commands\n"
"\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n"
"\tbit 2 - Disable only if Battery is protecting Cache");


With the default value of 2, aacraid always reports disks as being in write through mode.