1. 22 1月, 2016 16 次提交
    • I
      libceph: remove outdated comment · 7e01726a
      Ilya Dryomov 提交于
      MClientMount{,Ack} are long gone.  The receipt of bare monmap doesn't
      actually indicate a mount success as we are yet to authenticate at that
      point in time.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      7e01726a
    • I
      libceph: kill off ceph_x_ticket_handler::validity · f6cdb292
      Ilya Dryomov 提交于
      With it gone, no need to preserve ceph_timespec in process_one_ticket()
      either.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: NSage Weil <sage@redhat.com>
      f6cdb292
    • I
      libceph: invalidate AUTH in addition to a service ticket · 187d131d
      Ilya Dryomov 提交于
      If we fault due to authentication, we invalidate the service ticket we
      have and request a new one - the idea being that if a service rejected
      our authorizer, it must have expired, despite mon_client's attempts at
      periodic renewal.  (The other possibility is that our ticket is too new
      and the service hasn't gotten it yet, in which case invalidating isn't
      necessary but doesn't hurt.)
      
      Invalidating just the service ticket is not enough, though.  If we
      assume a failure on mon_client's part to renew a service ticket, we
      have to assume the same for the AUTH ticket.  If our AUTH ticket is
      bad, we won't get any service tickets no matter how hard we try, so
      invalidate AUTH ticket along with the service ticket.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: NSage Weil <sage@redhat.com>
      187d131d
    • I
      libceph: fix authorizer invalidation, take 2 · 6abe097d
      Ilya Dryomov 提交于
      Back in 2013, commit 4b8e8b5d ("libceph: fix authorizer
      invalidation") tried to fix authorizer invalidation issues by clearing
      validity field.  However, nothing ever consults this field, so it
      doesn't force us to request any new secrets in any way and therefore we
      never get out of the exponential backoff mode:
      
          [  129.973812] libceph: osd2 192.168.122.1:6810 connect authorization failure
          [  130.706785] libceph: osd2 192.168.122.1:6810 connect authorization failure
          [  131.710088] libceph: osd2 192.168.122.1:6810 connect authorization failure
          [  133.708321] libceph: osd2 192.168.122.1:6810 connect authorization failure
          [  137.706598] libceph: osd2 192.168.122.1:6810 connect authorization failure
          ...
      
      AFAICT this was the case at the time 4b8e8b5d was merged, too.
      
      Using timespec solely as a bool isn't nice, so introduce a new have_key
      flag, specifically for this purpose.
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: NSage Weil <sage@redhat.com>
      6abe097d
    • I
      libceph: clear messenger auth_retry flag if we fault · f6330cc1
      Ilya Dryomov 提交于
      Commit 20e55c4c ("libceph: clear messenger auth_retry flag when we
      authenticate") got us only half way there.  We clear the flag if the
      second attempt succeeds, but it also needs to be cleared if that
      attempt fails, to allow for the exponential backoff to kick in.
      Otherwise, if ->should_authenticate() thinks our keys are valid, we
      will busy loop, incrementing auth_retry to no avail:
      
          process_connect ffff880079a63830 got BADAUTHORIZER attempt 1
          process_connect ffff880079a63830 got BADAUTHORIZER attempt 2
          process_connect ffff880079a63830 got BADAUTHORIZER attempt 3
          process_connect ffff880079a63830 got BADAUTHORIZER attempt 4
          process_connect ffff880079a63830 got BADAUTHORIZER attempt 5
          ...
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: NSage Weil <sage@redhat.com>
      f6330cc1
    • I
      libceph: fix ceph_msg_revoke() · 67645d76
      Ilya Dryomov 提交于
      There are a number of problems with revoking a "was sending" message:
      
      (1) We never make any attempt to revoke data - only kvecs contibute to
      con->out_skip.  However, once the header (envelope) is written to the
      socket, our peer learns data_len and sets itself to expect at least
      data_len bytes to follow front or front+middle.  If ceph_msg_revoke()
      is called while the messenger is sending message's data portion,
      anything we send after that call is counted by the OSD towards the now
      revoked message's data portion.  The effects vary, the most common one
      is the eventual hang - higher layers get stuck waiting for the reply to
      the message that was sent out after ceph_msg_revoke() returned and
      treated by the OSD as a bunch of data bytes.  This is what Matt ran
      into.
      
      (2) Flat out zeroing con->out_kvec_bytes worth of bytes to handle kvecs
      is wrong.  If ceph_msg_revoke() is called before the tag is sent out or
      while the messenger is sending the header, we will get a connection
      reset, either due to a bad tag (0 is not a valid tag) or a bad header
      CRC, which kind of defeats the purpose of revoke.  Currently the kernel
      client refuses to work with header CRCs disabled, but that will likely
      change in the future, making this even worse.
      
      (3) con->out_skip is not reset on connection reset, leading to one or
      more spurious connection resets if we happen to get a real one between
      con->out_skip is set in ceph_msg_revoke() and before it's cleared in
      write_partial_skip().
      
      Fixing (1) and (3) is trivial.  The idea behind fixing (2) is to never
      zero the tag or the header, i.e. send out tag+header regardless of when
      ceph_msg_revoke() is called.  That way the header is always correct, no
      unnecessary resets are induced and revoke stands ready for disabled
      CRCs.  Since ceph_msg_revoke() rips out con->out_msg, introduce a new
      "message out temp" and copy the header into it before sending.
      
      Cc: stable@vger.kernel.org # 4.0+
      Reported-by: NMatt Conner <matt.conner@keepertech.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Tested-by: NMatt Conner <matt.conner@keepertech.com>
      Reviewed-by: NSage Weil <sage@redhat.com>
      67645d76
    • G
      libceph: use list_for_each_entry_safe · 10bcee14
      Geliang Tang 提交于
      Use list_for_each_entry_safe() instead of list_for_each_safe() to
      simplify the code.
      Signed-off-by: NGeliang Tang <geliangtang@163.com>
      [idryomov@gmail.com: nuke call to list_splice_init() as well]
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      10bcee14
    • Y
      ceph: use i_size_{read,write} to get/set i_size · 99c88e69
      Yan, Zheng 提交于
      Cap message from MDS can update i_size. In that case, we don't
      hold i_mutex. So it's unsafe to directly access inode->i_size
      while holding i_mutex.
      Signed-off-by: NYan, Zheng <zyan@redhat.com>
      99c88e69
    • Y
      ceph: re-send AIO write request when getting -EOLDSNAP error · 5be0389d
      Yan, Zheng 提交于
      When receiving -EOLDSNAP from OSD, we need to re-send corresponding
      write request. Due to locking issue, we can send new request inside
      another OSD request's complete callback. So we use worker to re-send
      request for AIO write.
      Signed-off-by: NYan, Zheng <zyan@redhat.com>
      5be0389d
    • Y
      ceph: Asynchronous IO support · c8fe9b17
      Yan, Zheng 提交于
      The basic idea of AIO support is simple, just call kiocb::ki_complete()
      in OSD request's complete callback. But there are several special cases.
      
      when IO span multiple objects, we need to wait until all OSD requests
      are complete, then call kiocb::ki_complete(). Error handling in this case
      is tricky too. For simplify, AIO both span multiple objects and extends
      i_size are not allowed.
      
      Another special case is check EOF for reading (other client can write to
      the file and extend i_size concurrently). For simplify, the direct-IO/AIO
      code path does do the check, fallback to normal syn read instead.
      Signed-off-by: NYan, Zheng <zyan@redhat.com>
      c8fe9b17
    • M
      ceph: Avoid to propagate the invalid page point · 458c4703
      Minfei Huang 提交于
      The variant pagep will still get the invalid page point, although ceph
      fails in function ceph_update_writeable_page.
      
      To fix this issue, Assigne the page to pagep until there is no failure
      in function ceph_update_writeable_page.
      Signed-off-by: NMinfei Huang <mnfhuang@gmail.com>
      Signed-off-by: NYan, Zheng <zyan@redhat.com>
      458c4703
    • Y
      ceph: fix double page_unlock() in page_mkwrite() · f9cac5ac
      Yan, Zheng 提交于
      ceph_update_writeable_page() unlocks the page on errors, so
      page_mkwrite() should not unlock the page again.
      Signed-off-by: NYan, Zheng <zyan@redhat.com>
      f9cac5ac
    • M
      rbd: delete an unnecessary check before rbd_dev_destroy() · 1761b229
      Markus Elfring 提交于
      The rbd_dev_destroy() function tests whether its argument is NULL
      and then returns immediately. Thus the test around the call is not needed.
      
      This issue was detected by using the Coccinelle software.
      Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      1761b229
    • G
      libceph: use list_next_entry instead of list_entry_next · 17ddc49b
      Geliang Tang 提交于
      list_next_entry has been defined in list.h, so I replace list_entry_next
      with it.
      Signed-off-by: NGeliang Tang <geliangtang@163.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      17ddc49b
    • Y
      ceph: ceph_frag_contains_value can be boolean · 79a3ed2e
      Yaowei Bai 提交于
      This patch makes ceph_frag_contains_value return bool to improve
      readability due to this particular function only using either one or
      zero as its return value.
      
      No functional change.
      Signed-off-by: NYaowei Bai <baiyaowei@cmss.chinamobile.com>
      Signed-off-by: NYan, Zheng <zyan@redhat.com>
      79a3ed2e
    • Y
      ceph: remove unused functions in ceph_frag.h · eade1fe7
      Yaowei Bai 提交于
      These functions were introduced in commit 3d14c5d2 ("ceph: factor
      out libceph from Ceph file system"). Howover, there's no user of
      these functions since then, so remove them for simplicity.
      Signed-off-by: NYaowei Bai <baiyaowei@cmss.chinamobile.com>
      Signed-off-by: NYan, Zheng <zyan@redhat.com>
      eade1fe7
  2. 11 1月, 2016 1 次提交
  3. 10 1月, 2016 2 次提交
  4. 09 1月, 2016 14 次提交
  5. 08 1月, 2016 7 次提交