]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
rbd: add a warning in bio_chain_clone_range()
authorAlex Elder <elder@dreamhost.com>
Thu, 1 Nov 2012 15:17:15 +0000 (10:17 -0500)
committerAlex Elder <elder@inktank.com>
Mon, 19 Nov 2012 23:37:48 +0000 (17:37 -0600)
commit61b06b242eb65a672561ea180b5a5497badeabfe
tree15bbd525106fba5dda4264434e3eb10a1c77a555
parent325c64551fa8cd22cf58bfe2d5ca590ae37c306c
rbd: add a warning in bio_chain_clone_range()

Add a warning in bio_chain_clone_range() to help a user determine
what exactly might have led to a failure.  There is only one; please
say something if you disagree with the following reasoning.

There are three places this can return abnormally:
    - Initially, if there is nothing to clone.  It turns out that
      right now this cannot happen anyway.  The test is in place
      because the code below it doesn't work if those conditions
      don't hold.  As such they could be assertions but since I can
      return a null to indicate an error I just do that instead.
      I have not added a warning here because it won't happen.
    - While processing bio's, if none remain but there are supposed
      to be more bytes to clone.  Here I have added a warning.
    - If bio_clone_range() returns a null pointer.  That function
      will have already produced a warning (at least the first
      time, via WARN_ON_ONCE()) to distinguish the cause of the
      error.  The only exception is memory exhaustion, and I'd
      rather not pepper the code with warnings in all those spots.
      So no warning is added in that place.

Signed-off-by: Alex Elder <elder@inktank.com>
drivers/block/rbd.c