Commit 0da13c8c authored by Pete Zaitcev's avatar Pete Zaitcev Committed by Greg Kroah-Hartman

ub: Ignore bad residue

I hoped to continue to ignore this problem or use libusual, but these
days it's simpler to work around than to deal with it. Let's attempt to
use bad residue devices and hope that upper level integrity checks catch
any problems (e.g. please use sha1sum on your backups).
Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 82fe26ba
...@@ -319,6 +319,7 @@ struct ub_dev { ...@@ -319,6 +319,7 @@ struct ub_dev {
int openc; /* protected by ub_lock! */ int openc; /* protected by ub_lock! */
/* kref is too implicit for our taste */ /* kref is too implicit for our taste */
int reset; /* Reset is running */ int reset; /* Reset is running */
int bad_resid;
unsigned int tagcnt; unsigned int tagcnt;
char name[12]; char name[12];
struct usb_device *dev; struct usb_device *dev;
...@@ -1265,14 +1266,19 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd) ...@@ -1265,14 +1266,19 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
return; return;
} }
len = le32_to_cpu(bcs->Residue); if (!sc->bad_resid) {
if (len != cmd->len - cmd->act_len) { 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 * Only start ignoring if this cmd ended well.
* counts disagree with our counts. */
*/ if (cmd->len == cmd->act_len) {
goto Bad_End; printk(KERN_NOTICE "%s: "
"bad residual %d of %d, ignoring\n",
sc->name, len, cmd->len);
sc->bad_resid = 1;
}
}
} }
switch (bcs->Status) { switch (bcs->Status) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment