diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 16:02:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 16:02:03 -0400 |
commit | f8aea20018aefa51bf818914c9c1ef9006353dbb (patch) | |
tree | 36c5ab25fc6808ae635ae69e3f301b11ef52d72f /drivers/scsi/sd.c | |
parent | c3c9897c63ebb0b93b7f78724e38d6ee1da04041 (diff) | |
parent | 520a2c2741747062e75f91cd0faddb564fbc64d2 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (21 commits)
[SCSI] sd: fix computation of the full size of the device
[SCSI] lib: string_get_size(): don't hang on zero; no decimals on exact
[SCSI] sun3x_esp: Convert && to ||
[SCSI] sd: remove command-size switching code
[SCSI] 3w-9xxx: remove unnecessary local_irq_save/restore for scsi sg copy API
[SCSI] 3w-xxxx: remove unnecessary local_irq_save/restore for scsi sg copy API
[SCSI] fix netlink kernel-doc
[SCSI] sd: Fix handling of NO_SENSE check condition
[SCSI] export busy state via q->lld_busy_fn()
[SCSI] refactor sdev/starget/shost busy checking
[SCSI] mptfusion: Increase scsi-timeouts, similariy to the LSI 4.x driver.
[SCSI] aic7xxx: Take the LED out of diagnostic mode on PM resume
[SCSI] aic79xx: user visible misuse wrong SI units (not disk size!)
[SCSI] ipr: use memory_read_from_buffer()
[SCSI] aic79xx: fix shadowed variables
[SCSI] aic79xx: fix shadowed variables, add statics
[SCSI] aic7xxx: update *_shipped files
[SCSI] aic7xxx: update .reg files
[SCSI] aic7xxx: introduce "dont_generate_debug_code" keyword in aicasm parser
[SCSI] scsi_dh: Initialize path state to be passive when path is not owned
...
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 43f34c73df12..c9e1242eaf25 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1049,7 +1049,6 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
1049 | good_bytes = sd_completed_bytes(SCpnt); | 1049 | good_bytes = sd_completed_bytes(SCpnt); |
1050 | break; | 1050 | break; |
1051 | case RECOVERED_ERROR: | 1051 | case RECOVERED_ERROR: |
1052 | case NO_SENSE: | ||
1053 | /* Inform the user, but make sure that it's not treated | 1052 | /* Inform the user, but make sure that it's not treated |
1054 | * as a hard error. | 1053 | * as a hard error. |
1055 | */ | 1054 | */ |
@@ -1058,6 +1057,15 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
1058 | memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | 1057 | memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); |
1059 | good_bytes = scsi_bufflen(SCpnt); | 1058 | good_bytes = scsi_bufflen(SCpnt); |
1060 | break; | 1059 | break; |
1060 | case NO_SENSE: | ||
1061 | /* This indicates a false check condition, so ignore it. An | ||
1062 | * unknown amount of data was transferred so treat it as an | ||
1063 | * error. | ||
1064 | */ | ||
1065 | scsi_print_sense("sd", SCpnt); | ||
1066 | SCpnt->result = 0; | ||
1067 | memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); | ||
1068 | break; | ||
1061 | case ABORTED_COMMAND: | 1069 | case ABORTED_COMMAND: |
1062 | if (sshdr.asc == 0x10) { /* DIF: Disk detected corruption */ | 1070 | if (sshdr.asc == 0x10) { /* DIF: Disk detected corruption */ |
1063 | scsi_print_result(SCpnt); | 1071 | scsi_print_result(SCpnt); |
@@ -1071,15 +1079,6 @@ static int sd_done(struct scsi_cmnd *SCpnt) | |||
1071 | scsi_print_sense("sd", SCpnt); | 1079 | scsi_print_sense("sd", SCpnt); |
1072 | good_bytes = sd_completed_bytes(SCpnt); | 1080 | good_bytes = sd_completed_bytes(SCpnt); |
1073 | } | 1081 | } |
1074 | if (!scsi_device_protection(SCpnt->device) && | ||
1075 | SCpnt->device->use_10_for_rw && | ||
1076 | (SCpnt->cmnd[0] == READ_10 || | ||
1077 | SCpnt->cmnd[0] == WRITE_10)) | ||
1078 | SCpnt->device->use_10_for_rw = 0; | ||
1079 | if (SCpnt->device->use_10_for_ms && | ||
1080 | (SCpnt->cmnd[0] == MODE_SENSE_10 || | ||
1081 | SCpnt->cmnd[0] == MODE_SELECT_10)) | ||
1082 | SCpnt->device->use_10_for_ms = 0; | ||
1083 | break; | 1082 | break; |
1084 | default: | 1083 | default: |
1085 | break; | 1084 | break; |
@@ -1432,7 +1431,7 @@ got_data: | |||
1432 | 1431 | ||
1433 | { | 1432 | { |
1434 | char cap_str_2[10], cap_str_10[10]; | 1433 | char cap_str_2[10], cap_str_10[10]; |
1435 | u64 sz = sdkp->capacity << ffz(~sector_size); | 1434 | u64 sz = (u64)sdkp->capacity << ilog2(sector_size); |
1436 | 1435 | ||
1437 | string_get_size(sz, STRING_UNITS_2, cap_str_2, | 1436 | string_get_size(sz, STRING_UNITS_2, cap_str_2, |
1438 | sizeof(cap_str_2)); | 1437 | sizeof(cap_str_2)); |