Skip to content
  • Pete Zaitcev's avatar
    ub: remove BUG() after __blk_end_request and fix the condition causing it · ef45cb62
    Pete Zaitcev authored
    
    
    When __blk_end_request returns nonzero, it means that the request was
    not completely processed and some BIOs are still attached. Since we
    have dequeued it by that time, it means leaking requests and hanging
    processes, which is why BUG() was in there. In ub this happens if
    a packet request ends normally, but with residue (e.g. when scsi_id
    issues INQUIRY).
    
    The fix is to make sure that arguments passed to __blk_end_request
    are correct: the full request length and not just transferred length.
    The transferred length is indicated to applications by adjusting
    rq->data_len with old, unchanged code outside of this patch.
    
    Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
    Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
    Cc: Greg KH <greg@kroah.com>
    Cc: Boaz Harrosh <bharrosh@panasas.com>
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    ef45cb62