1. 22 3月, 2012 18 次提交
  2. 03 2月, 2012 2 次提交
    • A
      rbd: fix safety of rbd_put_client() · d23a4b3f
      Alex Elder 提交于
      The rbd_client structure uses a kref to arrange for cleaning up and
      freeing an instance when its last reference is dropped.  The cleanup
      routine is rbd_client_release(), and one of the things it does is
      delete the rbd_client from rbd_client_list.  It acquires node_lock
      to do so, but the way it is done is still not safe.
      
      The problem is that when attempting to reuse an existing rbd_client,
      the structure found might already be in the process of getting
      destroyed and cleaned up.
      
      Here's the scenario, with "CLIENT" representing an existing
      rbd_client that's involved in the race:
      
       Thread on CPU A                | Thread on CPU B
       ---------------                | ---------------
       rbd_put_client(CLIENT)         | rbd_get_client()
         kref_put()                   |   (acquires node_lock)
           kref->refcount becomes 0   |   __rbd_client_find() returns CLIENT
           calls rbd_client_release() |   kref_get(&CLIENT->kref);
                                      |   (releases node_lock)
             (acquires node_lock)     |
             deletes CLIENT from list | ...and starts using CLIENT...
             (releases node_lock)     |
             and frees CLIENT         | <-- but CLIENT gets freed here
      
      Fix this by having rbd_put_client() acquire node_lock.  The result
      could still be improved, but at least it avoids this problem.
      Signed-off-by: NAlex Elder <elder@dreamhost.com>
      Signed-off-by: NSage Weil <sage@newdream.net>
      d23a4b3f
    • A
      rbd: fix a memory leak in rbd_get_client() · 97bb59a0
      Alex Elder 提交于
      If an existing rbd client is found to be suitable for use in
      rbd_get_client(), the rbd_options structure is not being
      freed as it should.  Fix that.
      Signed-off-by: NAlex Elder <elder@dreamhost.com>
      Signed-off-by: NSage Weil <sage@newdream.net>
      97bb59a0
  3. 13 1月, 2012 1 次提交
  4. 08 12月, 2011 2 次提交
  5. 26 10月, 2011 1 次提交
  6. 15 9月, 2011 1 次提交
  7. 27 7月, 2011 2 次提交
  8. 25 5月, 2011 3 次提交
  9. 20 5月, 2011 1 次提交
  10. 14 5月, 2011 1 次提交
    • Y
      rbd: fix split bio handling · 1fec7093
      Yehuda Sadeh 提交于
      The rbd driver currently splits bios when they span an object boundary.
      However, the blk_end_request expects the completions to roll up the results
      in block device order, and the split rbd/ceph ops can complete in any
      order.  This patch adds a struct rbd_req_coll to track completion of split
      requests and ensures that the results are passed back up to the block layer
      in order.
      
      This fixes errors where the file system gets completion of a read operation
      that spans an object boundary before the data has actually arrived.  The
      bug is easily reproduced with iozone with a working set larger than
      available RAM.
      Reported-by: NFyodor Ustinov <ufm@ufm.su>
      Signed-off-by: NYehuda Sadeh <yehuda@hq.newdream.net>
      Signed-off-by: NSage Weil <sage@newdream.net>
      1fec7093
  11. 13 5月, 2011 1 次提交
  12. 04 5月, 2011 1 次提交
  13. 23 3月, 2011 1 次提交
  14. 13 1月, 2011 1 次提交
  15. 02 12月, 2010 1 次提交
  16. 21 10月, 2010 3 次提交