1. 16 Sep, 2011 1 commit
  2. 31 Aug, 2011 1 commit
  3. 09 Aug, 2011 1 commit
    • Sage Weil's avatar
      libceph: fix msgpool · 5185352c
      Sage Weil authored
      
      There were several problems here:
      
       1- we weren't tagging allocations with the pool, so they were never
          returned to the pool.
       2- msgpool_put didn't add back to the mempool, even it were called.
       3- msgpool_release didn't clear the pool pointer, so it would have looped
          had #1 not been broken.
      
      These may or may not have been responsible for #1136 or #1381 (BUG due to
      non-empty mempool on umount).  I can't seem to trigger the crash now using
      the method I was using before.
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      5185352c
  4. 26 Jul, 2011 1 commit
  5. 19 Jul, 2011 1 commit
    • Sage Weil's avatar
      ceph: fix file mode calculation · 38be7a79
      Sage Weil authored
      
      open(2) must always include one of O_RDONLY, O_WRONLY, or O_RDWR.  No need
      for any O_APPEND special case.
      
      Passing O_WRONLY|O_RDWR is undefined according to the man page, but the
      Linux VFS interprets this as O_RDWR, so we'll do the same.
      
      This fixes open(2) with flags O_RDWR|O_APPEND, which was incorrectly being
      translated to readonly.
      Reported-by: default avatarFyodor Ustinov <ufm@ufm.su>
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      38be7a79
  6. 13 Jun, 2011 1 commit
  7. 08 Jun, 2011 1 commit
  8. 24 May, 2011 2 commits
  9. 19 May, 2011 8 commits
  10. 03 May, 2011 2 commits
  11. 06 Apr, 2011 1 commit
  12. 31 Mar, 2011 1 commit
  13. 29 Mar, 2011 5 commits
  14. 26 Mar, 2011 1 commit
  15. 25 Mar, 2011 1 commit
    • Sage Weil's avatar
      ceph: flush msgr_wq during mds_client shutdown · ef550f6f
      Sage Weil authored
      
      The release method for mds connections uses a backpointer to the
      mds_client, so we need to flush the workqueue of any pending work (and
      ceph_connection references) prior to freeing the mds_client.  This fixes
      an oops easily triggered under UML by
      
       while true ; do mount ... ; umount ... ; done
      
      Also fix an outdated comment: the flush in ceph_destroy_client only flushes
      OSD connections out.  This bug is basically an artifact of the ceph ->
      ceph+libceph conversion.
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      ef550f6f
  16. 22 Mar, 2011 1 commit
  17. 21 Mar, 2011 1 commit
    • Sage Weil's avatar
      libceph: fix osd request queuing on osdmap updates · 6f6c7006
      Sage Weil authored
      
      If we send a request to osd A, and the request's pg remaps to osd B and
      then back to A in quick succession, we need to resend the request to A. The
      old code was only calling kick_requests after processing all incremental
      maps in a message, so it was very possible to not resend a request that
      needed to be resent.  This would make the osd eventually time out (at least
      with the current default of osd timeouts enabled).
      
      The correct approach is to scan requests on every map incremental.  This
      patch refactors the kick code in a few ways:
       - all requests are either on req_lru (in flight), req_unsent (ready to
         send), or req_notarget (currently map to no up osd)
       - mapping always done by map_request (previous map_osds)
       - if the mapping changes, we requeue.  requests are resent only after all
         map incrementals are processed.
       - some osd reset code is moved out of kick_requests into a separate
         function
       - the "kick this osd" functionality is moved to kick_osd_requests, as it
         is unrelated to scanning for request->pg->osd mapping changes
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      6f6c7006
  18. 15 Mar, 2011 1 commit
  19. 04 Mar, 2011 3 commits
    • Sage Weil's avatar
      libceph: fix msgr standby handling · e00de341
      Sage Weil authored
      
      The standby logic used to be pretty dependent on the work requeueing
      behavior that changed when we switched to WQ_NON_REENTRANT.  It was also
      very fragile.
      
      Restructure things so that:
       - We clear WRITE_PENDING when we set STANDBY.  This ensures we will
         requeue work when we wake up later.
       - con_work backs off if STANDBY is set.  There is nothing to do if we are
         in standby.
       - clear_standby() helper is called by both con_send() and con_keepalive(),
         the two actions that can wake us up again.  Move the connect_seq++
         logic here.
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      e00de341
    • Sage Weil's avatar
      libceph: fix msgr keepalive flag · e76661d0
      Sage Weil authored
      
      There was some broken keepalive code using a dead variable.  Shift to using
      the proper bit flag.
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      e76661d0
    • Sage Weil's avatar
      libceph: fix msgr backoff · 60bf8bf8
      Sage Weil authored
      With commit f363e45f
      
       we replaced a bunch of hacky workqueue mutual
      exclusion logic with the WQ_NON_REENTRANT flag.  One pieces of fallout is
      that the exponential backoff breaks in certain cases:
      
       * con_work attempts to connect.
       * we get an immediate failure, and the socket state change handler queues
         immediate work.
       * con_work calls con_fault, we decide to back off, but can't queue delayed
         work.
      
      In this case, we add a BACKOFF bit to make con_work reschedule delayed work
      next time it runs (which should be immediately).
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      60bf8bf8
  20. 03 Mar, 2011 2 commits
    • Sage Weil's avatar
      libceph: retry after authorization failure · 692d20f5
      Sage Weil authored
      
      If we mark the connection CLOSED we will give up trying to reconnect to
      this server instance.  That is appropriate for things like a protocol
      version mismatch that won't change until the server is restarted, at which
      point we'll get a new addr and reconnect.  An authorization failure like
      this is probably due to the server not properly rotating it's secret keys,
      however, and should be treated as transient so that the normal backoff and
      retry behavior kicks in.
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      692d20f5
    • Sage Weil's avatar
      libceph: fix handling of short returns from get_user_pages · 38815b78
      Sage Weil authored
      
      get_user_pages() can return fewer pages than we ask for.  We were returning
      a bogus pointer/error code in that case.  Instead, loop until we get all
      the pages we want or get an error we can return to the caller.
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      38815b78
  21. 25 Jan, 2011 2 commits
    • Sage Weil's avatar
      libceph: fix socket write error handling · 42961d23
      Sage Weil authored
      
      Pass errors from writing to the socket up the stack.  If we get -EAGAIN,
      return 0 from the helper to simplify the callers' checks.
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      42961d23
    • Sage Weil's avatar
      libceph: fix socket read error handling · 98bdb0aa
      Sage Weil authored
      
      If we get EAGAIN when trying to read from the socket, it is not an error.
      Return 0 from the helper in this case to simplify the error handling cases
      in the caller (indirectly, try_read).
      
      Fix try_read to pass any error to it's caller (con_work) instead of almost
      always returning 0.  This let's us respond to things like socket
      disconnects.
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      98bdb0aa
  22. 12 Jan, 2011 2 commits
    • Tejun Heo's avatar
      net/ceph: make ceph_msgr_wq non-reentrant · f363e45f
      Tejun Heo authored
      
      ceph messenger code does a rather complex dancing around multithread
      workqueue to make sure the same work item isn't executed concurrently
      on different CPUs.  This restriction can be provided by workqueue with
      WQ_NON_REENTRANT.
      
      Make ceph_msgr_wq non-reentrant workqueue with the default concurrency
      level and remove the QUEUED/BUSY logic.
      
      * This removes backoff handling in con_work() but it couldn't reliably
        block execution of con_work() to begin with - queue_con() can be
        called after the work started but before BUSY is set.  It seems that
        it was an optimization for a rather cold path and can be safely
        removed.
      
      * The number of concurrent work items is bound by the number of
        connections and connetions are independent from each other.  With
        the default concurrency level, different connections will be
        executed independently.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: Sage Weil <sage@newdream.net>
      Cc: ceph-devel@vger.kernel.org
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      f363e45f
    • Jesper Juhl's avatar
      ceph: Always free allocated memory in osdmap_decode() · b0aee351
      Jesper Juhl authored
      
      Always free memory allocated to 'pi' in
      net/ceph/osdmap.c::osdmap_decode().
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarSage Weil <sage@newdream.net>
      b0aee351