Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95784
b: refs/heads/master
c: 0da13c8
h: refs/heads/master
v: v3
  • Loading branch information
Pete Zaitcev authored and Greg Kroah-Hartman committed May 2, 2008
1 parent 96464ce commit 5f9d594
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 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: 82fe26ba7a21d9bcc77e6142c941683eede32940
refs/heads/master: 0da13c8c3dfb1ab6c56f2a70fadfddd57e0d7c42
22 changes: 14 additions & 8 deletions trunk/drivers/block/ub.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ struct ub_dev {
int openc; /* protected by ub_lock! */
/* kref is too implicit for our taste */
int reset; /* Reset is running */
int bad_resid;
unsigned int tagcnt;
char name[12];
struct usb_device *dev;
Expand Down Expand Up @@ -1265,14 +1266,19 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
return;
}

len = le32_to_cpu(bcs->Residue);
if (len != cmd->len - cmd->act_len) {
/*
* It is all right to transfer less, the caller has
* to check. But it's not all right if the device
* counts disagree with our counts.
*/
goto Bad_End;
if (!sc->bad_resid) {
len = le32_to_cpu(bcs->Residue);
if (len != cmd->len - cmd->act_len) {
/*
* Only start ignoring if this cmd ended well.
*/
if (cmd->len == cmd->act_len) {
printk(KERN_NOTICE "%s: "
"bad residual %d of %d, ignoring\n",
sc->name, len, cmd->len);
sc->bad_resid = 1;
}
}
}

switch (bcs->Status) {
Expand Down

0 comments on commit 5f9d594

Please sign in to comment.