summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPete Zaitcev <zaitcev@redhat.com>2008-04-19 14:42:49 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-02 10:25:52 -0700
commit0da13c8c3dfb1ab6c56f2a70fadfddd57e0d7c42 (patch)
treec2ec2a7d4e1ef7fd1441131ed0fc9f2cec5553f0
parent82fe26ba7a21d9bcc77e6142c941683eede32940 (diff)
downloadblackbird-op-linux-0da13c8c3dfb1ab6c56f2a70fadfddd57e0d7c42.tar.gz
blackbird-op-linux-0da13c8c3dfb1ab6c56f2a70fadfddd57e0d7c42.zip
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: Pete Zaitcev <zaitcev@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/block/ub.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/block/ub.c b/drivers/block/ub.c
index 5c6a6e89d2fb..e2c3ebd8db22 100644
--- a/drivers/block/ub.c
+++ b/drivers/block/ub.c
@@ -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;
@@ -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) {
OpenPOWER on IntegriCloud