Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=10e485221edd2799dc495e4cde98fe74aeb292b1
Commit:     10e485221edd2799dc495e4cde98fe74aeb292b1
Parent:     9454c46a89c13fe82a28c91706b86f612fd19462
Author:     Pete Zaitcev <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 10 20:09:58 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 19 17:46:03 2007 -0700

    USB: usblp: "Big cleanup" breaks O_NONBLOCK
    
    I found the first regresson in the rewritten ("all dynamic" and "no races")
    driver. If application uses O_NONBLOCK, I return -EAGAIN despite the URB
    being submitted successfuly. This causes the application to resubmit the
    same data erroneously.
    
    The fix is to pretend that the transfer has succeeded even if URB was
    merely queued. It is the same behaviour as with the old version.
    
    Signed-off-by: Pete Zaitcev <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/class/usblp.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 9a14789..80ec103 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -741,10 +741,11 @@ static ssize_t usblp_write(struct file *file, const char 
__user *buffer, size_t
                 */
                rv = usblp_wwait(usblp, !!(file->f_flags&O_NONBLOCK));
                if (rv < 0) {
-                       /*
-                        * If interrupted, we simply leave the URB to dangle,
-                        * so the ->release will call usb_kill_urb().
-                        */
+                       if (rv == -EAGAIN) {
+                               /* Presume that it's going to complete well. */
+                               writecount += transfer_length;
+                       }
+                       /* Leave URB dangling, to be cleaned on close. */
                        goto collect_error;
                }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to