SCSI/SD: clearer output of disk cache state
PATCH 1/1 SCSI/SD: clearer output of disk cache state
--- drivers/scsi/sd.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-)
This patch is 8 months old.
Luben
drivers/scsi/sd.c +7 -10
@@ -1354,11 +1354,6 @@ sd_read_cache_type(struct scsi_disk *sdk res =sd_do_mode_sense (sdp, dbd, modepage, buffer, len, &data, &sshdr);if (scsi_status_is_good (res)) { -const char *types[] = { -"write through" ,"none" ,"write back" , -"write back, no read (daft)" - }; -int ct =0 ;int offset = data.header_length + data.block_descriptor_length;if (offset >=SD_BUF_SIZE -2 ) {
@@ -1387,11 +1382,13 @@ sd_read_cache_type(struct scsi_disk *sdk sdkp->DPOFUA =0 ; } - ct = sdkp->RCD +2 *sdkp->WCE; - -printk (KERN_NOTICE "SCSI device %s: drive cache: %s%s\n" , - diskname, types[ct], - sdkp->DPOFUA ?" w/ FUA" :"" ); +printk (KERN_NOTICE "SCSI device %s: " +"write cache: %s, read cache: %s, %s\n" , + diskname, + sdkp->WCE ?"enabled" :"disabled" , + sdkp->RCD ?"disabled" :"enabled" , + sdkp->DPOFUA ?"supports DPO and FUA" + :"doesn't support DPO or FUA" );return ; }
Signature · 1 line
1.4.3.3.g8478
drivers/scsi/sd.c sd_read_cache_type(struct scsi_disk *sdk · line 1391
Quoted 12 lines
drivers/scsi/sd.c +7
-5- ct = sdkp->RCD +2 *sdkp->WCE; - -printk (KERN_NOTICE "SCSI device %s: drive cache: %s%s\n" , - diskname, types[ct], - sdkp->DPOFUA ?" w/ FUA" :"" ); +printk (KERN_NOTICE "SCSI device %s: " +"write cache: %s, read cache: %s, %s\n" , + diskname, + sdkp->WCE ?"enabled" :"disabled" , + sdkp->RCD ?"disabled" :"enabled" , + sdkp->DPOFUA ?"supports DPO and FUA" + :"doesn't support DPO or FUA" );
Looks good to me.
Quoted 6 lines · Luben Tuikov
Signed-off-by Luben Tuikov <[email protected]>--- drivers/scsi/sd.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-)This patch is 8 months old.
Um:
patching file drivers/scsi/sd.c
Hunk #1 FAILED at 1354.
Hunk #2 FAILED at 1382.
2 out of 2 hunks FAILED -- saving rejects to file drivers/scsi/sd.c.rej
I think the code you're trying to change has altered a bit in the latest kernels.
James
Quoted 10 lines · --- James Bottomley
Quoted 6 lines · Luben Tuikov
Signed-off-by Luben Tuikov <[email protected]>--- drivers/scsi/sd.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-)This patch is 8 months old.
Um:
Quoted 7 lines
patching file
drivers/scsi/sd.c
Hunk #1 FAILED at 1354.
Hunk #2 FAILED at 1382.
2 out of 2 hunks FAILED -- saving rejects to filedrivers/scsi/sd.c.rejI think the code you're trying to change has altered a bit in the latest kernels.
Re-based:
---
drivers/scsi/sd.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)
drivers/scsi/sd.c +7 -6
@@ -1467,7 +1467,6 @@ sd_read_cache_type(struct scsi_disk *sdk res =sd_do_mode_sense (sdp, dbd, modepage, buffer, len, &data, &sshdr);if (scsi_status_is_good (res)) { -int ct =0 ;int offset = data.header_length + data.block_descriptor_length;if (offset >=SD_BUF_SIZE -2 ) {
@@ -1496,11 +1495,13 @@ sd_read_cache_type(struct scsi_disk *sdk sdkp->DPOFUA =0 ; } - ct = sdkp->RCD +2 *sdkp->WCE; - -printk (KERN_NOTICE "SCSI device %s: drive cache: %s%s\n" , - diskname, sd_cache_types[ct], - sdkp->DPOFUA ?" w/ FUA" :"" ); +printk (KERN_NOTICE "SCSI device %s: " +"write cache: %s, read cache: %s, %s\n" , + diskname, + sdkp->WCE ?"enabled" :"disabled" , + sdkp->RCD ?"disabled" :"enabled" , + sdkp->DPOFUA ?"supports DPO and FUA" + :"doesn't support DPO or FUA" );return ; }
Quoted 15 lines · Luben Tuikov
Quoted 14 lines · --- James Bottomley
Quoted 6 lines · Luben Tuikov
Signed-off-by Luben Tuikov <[email protected]>--- drivers/scsi/sd.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-)This patch is 8 months old.
Um:
patching file
drivers/scsi/sd.c
Hunk #1 FAILED at 1354.
Hunk #2 FAILED at 1382.
2 out of 2 hunks FAILED -- saving rejects to filedrivers/scsi/sd.c.rej
Quoted 6 lines
Quoted 2 lines
I think the code you're trying to change has altered a bit in the latest kernels.
Re-based:
Signed-off-by Luben Tuikov <[email protected]>
ACK
Quoted 1 line · Luben Tuikov
Re-based:
Thanks,
If you want to go the whole hog on this one, we probably also need WCE and RCD files (taking 1 or 0) for the scsi_disk class and a date in the feature removal file for dumping the cache_type file.
James
Quoted 47 lines · Luben Tuikov
Quoted 9 lines · --- James Bottomley
Quoted 6 lines · Luben Tuikov
Signed-off-by Luben Tuikov <[email protected]>--- drivers/scsi/sd.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-)This patch is 8 months old.
Um:
Quoted 7 lines
patching file
drivers/scsi/sd.c
Hunk #1 FAILED at 1354.
Hunk #2 FAILED at 1382.
2 out of 2 hunks FAILED -- saving rejects to filedrivers/scsi/sd.c.rejI think the code you're trying to change has altered a bit in the latest kernels.
Re-based:
Signed-off-by Luben Tuikov <[email protected]>---
drivers/scsi/sd.c | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-)drivers/scsi/sd.c +0
-6@@ -1467,7 +1467,6 @@ sd_read_cache_type(struct scsi_disk *sdk res =sd_do_mode_sense (sdp, dbd, modepage, buffer, len, &data, &sshdr);if (scsi_status_is_good (res)) { -int ct =0 ;int offset = data.header_length + data.block_descriptor_length;if (offset >=SD_BUF_SIZE -2 ) {@@ -1496,11 +1495,13 @@ sd_read_cache_type(struct scsi_disk *sdk sdkp->DPOFUA =0 ; } - ct = sdkp->RCD +2 *sdkp->WCE; - -printk (KERN_NOTICE "SCSI device %s: drive cache: %s%s\n" , - diskname, sd_cache_types[ct], - sdkp->DPOFUA ?" w/ FUA" :"" );
drivers/scsi/sd.c sd_read_cache_type(struct scsi_disk *sdk · line 1507
Quoted 10 lines
drivers/scsi/sd.c +7
-0+printk (KERN_NOTICE "SCSI device %s: " +"write cache: %s, read cache: %s, %s\n" , + diskname, + sdkp->WCE ?"enabled" :"disabled" , + sdkp->RCD ?"disabled" :"enabled" , + sdkp->DPOFUA ?"supports DPO and FUA" + :"doesn't support DPO or FUA" );return ; }
The definition of the DPOFUA flag (in the block descriptor returned by MODE SENSE for direct access devices) is a bit fuzzy in practice. When I queried the t10 reflector a member from a disk company said it should be interpreted as ... we support DPO and/or FUA.
I also noticed that one disk manufacturer's unit attention mode page had a bit to disable FUA (force unit access). So you can set the FUA bit (in a READ or WRITE), we will ignore it! The associated note says that it improves performance :-)
Doug Gilbert
Quoted 3 lines · Luben Tuikov
Re-based:
Signed-off-by Luben Tuikov <[email protected]>
It still won't apply ... this time it looks like a mailer tab->space conversion problem.
James
Quoted 7 lines · --- James Bottomley
Quoted 3 lines · Luben Tuikov
Re-based:
Signed-off-by Luben Tuikov <[email protected]>It still won't apply ... this time it looks like a mailer
tab->spaceconversion problem.
Attached.
Luben
drivers/scsi/sd.c +7 -6
@@ -1467,7 +1467,6 @@ sd_read_cache_type(struct scsi_disk *sdk res =sd_do_mode_sense (sdp, dbd, modepage, buffer, len, &data, &sshdr);if (scsi_status_is_good (res)) { -int ct =0 ;int offset = data.header_length + data.block_descriptor_length;if (offset >=SD_BUF_SIZE -2 ) {
@@ -1496,11 +1495,13 @@ sd_read_cache_type(struct scsi_disk *sdk sdkp->DPOFUA =0 ; } - ct = sdkp->RCD +2 *sdkp->WCE; - -printk (KERN_NOTICE "SCSI device %s: drive cache: %s%s\n" , - diskname, sd_cache_types[ct], - sdkp->DPOFUA ?" w/ FUA" :"" ); +printk (KERN_NOTICE "SCSI device %s: " +"write cache: %s, read cache: %s, %s\n" , + diskname, + sdkp->WCE ?"enabled" :"disabled" , + sdkp->RCD ?"disabled" :"enabled" , + sdkp->DPOFUA ?"supports DPO and FUA" + :"doesn't support DPO or FUA" );return ; }