Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 131172
b: refs/heads/master
c: 0d020aa
h: refs/heads/master
v: v3
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Feb 9, 2009
1 parent b1de68c commit 035260f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b40c0057a7935bcf63a38a924094c7e61d4731f
refs/heads/master: 0d020aae0a154cffce680a7775c74788fa0bea92
36 changes: 3 additions & 33 deletions trunk/drivers/usb/storage/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,32 +558,10 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb)

if (srb->result == SAM_STAT_GOOD && scsi_get_resid(srb) == 0) {

/* The command succeeded. If the capacity is odd
* (i.e., if the sector number is even) then the
* "always-even" heuristic would be wrong for this
* device. Issue a WARN() so that the kerneloops.org
* project will be notified and we will then know to
* mark the device with a CAPACITY_OK flag. Hopefully
* this will occur for only a few devices.
*
* Use the sign of us->last_sector_hacks to tell whether
* the warning has already been issued; we don't need
* more than one warning per device.
/* The command succeeded. We know this device doesn't
* have the last-sector bug, so stop checking it.
*/
if (!(sector & 1) && us->use_last_sector_hacks > 0) {
unsigned vid = le16_to_cpu(
us->pusb_dev->descriptor.idVendor);
unsigned pid = le16_to_cpu(
us->pusb_dev->descriptor.idProduct);
unsigned rev = le16_to_cpu(
us->pusb_dev->descriptor.bcdDevice);

WARN(1, "%s: Successful last sector success at %u, "
"device %04x:%04x:%04x\n",
sdkp->disk->disk_name, sector,
vid, pid, rev);
us->use_last_sector_hacks = -1;
}
us->use_last_sector_hacks = 0;

} else {
/* The command failed. Allow up to 3 retries in case this
Expand All @@ -599,14 +577,6 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb)
srb->result = SAM_STAT_CHECK_CONDITION;
memcpy(srb->sense_buffer, record_not_found,
sizeof(record_not_found));

/* In theory we might want to issue a WARN() here if the
* capacity is even, since it could indicate the device
* has the READ CAPACITY bug _and_ the real capacity is
* odd. But it could also indicate that the device
* simply can't access its last sector, a failure mode
* which is surprisingly common. So no warning.
*/
}

done:
Expand Down

0 comments on commit 035260f

Please sign in to comment.