• Duncan Sands's avatar
    [PATCH] USB usbfs: take a reference to the usb device · 8e082a0d
    Duncan Sands authored
    Hi Greg, this is the first of a series of patches that replace the
    per-file semaphore ps->devsem with the per-device semaphore
    ps->dev->serialize.  The role of devsem was to protect against
    device disconnection.  This can be done equally well using
    ps->dev->serialize.  On the other hand, ps->dev->serialize
    protects against configuration and other changes, and has
    already been introduced into usbfs in several places.  Using
    just one semaphore simplifies the code and removes some
    remaining race conditions.  It should also fix the oopses some
    people have been seeing.  In this first patch, a reference is
    taken to the usb device as long as the usbfs file is open.  That
    way we can use ps->dev->serialize for as long as ps exists.
    
     devio.c |   27 ++++++++++++++++-----------
     inode.c |    3 ---
     2 files changed, 16 insertions(+), 14 deletions(-)
    8e082a0d
inode.c 18 KB