1. 02 5月, 2013 5 次提交
  2. 12 2月, 2013 2 次提交
    • E
      ceph: Convert kuids and kgids before printing them. · bd2bae6a
      Eric W. Biederman 提交于
      Before printing kuid and kgids values convert them into
      the initial user namespace.
      
      Cc: Sage Weil <sage@inktank.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      bd2bae6a
    • E
      ceph: Translate between uid and gids in cap messages and kuids and kgids · 05cb11c1
      Eric W. Biederman 提交于
      - Make the uid and gid arguments of send_cap_msg() used to compose
        ceph_mds_caps messages of type kuid_t and kgid_t.
      
      - Pass inode->i_uid and inode->i_gid in __send_cap to send_cap_msg()
        through variables of type kuid_t and kgid_t.
      
      - Modify struct ceph_cap_snap to store uids and gids in types kuid_t
        and kgid_t.  This allows capturing inode->i_uid and inode->i_gid in
        ceph_queue_cap_snap() without loss and pssing them to
        __ceph_flush_snaps() where they are removed from struct
        ceph_cap_snap and passed to send_cap_msg().
      
      - In handle_cap_grant translate uid and gids in the initial user
        namespace stored in struct ceph_mds_cap into kuids and kgids
        before setting inode->i_uid and inode->i_gid.
      
      Cc: Sage Weil <sage@inktank.com>
      Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
      05cb11c1
  3. 18 1月, 2013 4 次提交
  4. 13 12月, 2012 3 次提交
  5. 04 11月, 2012 1 次提交
  6. 02 10月, 2012 1 次提交
  7. 03 2月, 2012 1 次提交
    • A
      ceph: create a new session lock to avoid lock inversion · d8fb02ab
      Alex Elder 提交于
      Lockdep was reporting a possible circular lock dependency in
      dentry_lease_is_valid().  That function needs to sample the
      session's s_cap_gen and and s_cap_ttl fields coherently, but needs
      to do so while holding a dentry lock.  The s_cap_lock field was
      being used to protect the two fields, but that can't be taken while
      holding a lock on a dentry within the session.
      
      In most cases, the s_cap_gen and s_cap_ttl fields only get operated
      on separately.  But in three cases they need to be updated together.
      Implement a new lock to protect the spots updating both fields
      atomically is required.
      Signed-off-by: NAlex Elder <elder@dreamhost.com>
      Reviewed-by: NSage Weil <sage@newdream.net>
      d8fb02ab
  8. 04 1月, 2012 1 次提交
  9. 08 12月, 2011 1 次提交
    • S
      ceph: use i_ceph_lock instead of i_lock · be655596
      Sage Weil 提交于
      We have been using i_lock to protect all kinds of data structures in the
      ceph_inode_info struct, including lists of inodes that we need to iterate
      over while avoiding races with inode destruction.  That requires grabbing
      a reference to the inode with the list lock protected, but igrab() now
      takes i_lock to check the inode flags.
      
      Changing the list lock ordering would be a painful process.
      
      However, using a ceph-specific i_ceph_lock in the ceph inode instead of
      i_lock is a simple mechanical change and avoids the ordering constraints
      imposed by igrab().
      Reported-by: NAmon Ott <a.ott@m-privacy.de>
      Signed-off-by: NSage Weil <sage@newdream.net>
      be655596
  10. 06 11月, 2011 1 次提交
  11. 02 11月, 2011 1 次提交
  12. 26 10月, 2011 1 次提交
  13. 21 7月, 2011 1 次提交
    • J
      fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers · 02c24a82
      Josef Bacik 提交于
      Btrfs needs to be able to control how filemap_write_and_wait_range() is called
      in fsync to make it less of a painful operation, so push down taking i_mutex and
      the calling of filemap_write_and_wait() down into the ->fsync() handlers.  Some
      file systems can drop taking the i_mutex altogether it seems, like ext3 and
      ocfs2.  For correctness sake I just pushed everything down in all cases to make
      sure that we keep the current behavior the same for everybody, and then each
      individual fs maintainer can make up their mind about what to do from there.
      Thanks,
      Acked-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NJosef Bacik <josef@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      02c24a82
  14. 08 6月, 2011 1 次提交
  15. 25 5月, 2011 1 次提交
    • S
      ceph: fix cap flush race reentrancy · db354052
      Sage Weil 提交于
      In e9964c10 we change cap flushing to do a delicate dance because some
      inodes on the cap_dirty list could be in a migrating state (got EXPORT but
      not IMPORT) in which we couldn't actually flush and move from
      dirty->flushing, breaking the while (!empty) { process first } loop
      structure.  It worked for a single sync thread, but was not reentrant and
      triggered infinite loops when multiple syncers came along.
      
      Instead, move inodes with dirty to a separate cap_dirty_migrating list
      when in the limbo export-but-no-import state, allowing us to go back to
      the simple loop structure (which was reentrant).  This is cleaner and more
      robust.
      
      Audited the cap_dirty users and this looks fine:
      list_empty(&ci->i_dirty_item) is still a reliable indicator of whether we
      have dirty caps (which list we're on is irrelevant) and list_del_init()
      calls still do the right thing.
      Signed-off-by: NSage Weil <sage@newdream.net>
      db354052
  16. 20 5月, 2011 1 次提交
  17. 12 5月, 2011 1 次提交
  18. 05 5月, 2011 1 次提交
  19. 04 5月, 2011 1 次提交
  20. 31 3月, 2011 1 次提交
  21. 20 1月, 2011 3 次提交
  22. 08 11月, 2010 2 次提交
    • S
      ceph: fix rdcache_gen usage and invalidate · cd045cb4
      Sage Weil 提交于
      We used to use rdcache_gen to indicate whether we "might" have cached
      pages.  Now we just look at the mapping to determine that.  However, some
      old behavior remains from that transition.
      
      First, rdcache_gen == 0 no longer means we have no pages.  That can happen
      at any time (presumably when we carry FILE_CACHE).  We should not reset it
      to zero, and we should not check that it is zero.
      
      That means that the only purpose for rdcache_revoking is to resolve races
      between new issues of FILE_CACHE and an async invalidate.  If they are
      equal, we should invalidate.  On success, we decrement rdcache_revoking,
      so that it is no longer equal to rdcache_gen.  Similarly, if we success
      in doing a sync invalidate, set revoking = gen - 1.  (This is a small
      optimization to avoid doing unnecessary invalidate work and does not
      affect correctness.)
      Signed-off-by: NSage Weil <sage@newdream.net>
      cd045cb4
    • S
      ceph: re-request max_size if cap auth changes · feb4cc9b
      Sage Weil 提交于
      If the auth cap migrates to another MDS, clear requested_max_size so that
      we resend any pending max_size increase requests.  This fixes potential
      hangs on writes that extend a file and race with an cap migration between
      MDSs.
      Signed-off-by: NSage Weil <sage@newdream.net>
      feb4cc9b
  23. 28 10月, 2010 1 次提交
    • S
      Revert "ceph: update issue_seq on cap grant" · 2f56f56a
      Sage Weil 提交于
      This reverts commit d91f2438.
      
      The intent of issue_seq is to distinguish between mds->client messages that
      (re)create the cap and those that do not, which means we should _only_ be
      updating that value in the create paths.  By updating it in handle_cap_grant,
      we reset it to zero, which then breaks release.
      
      The larger question is what workload/problem made me think it should be
      updated here...
      Signed-off-by: NSage Weil <sage@newdream.net>
      2f56f56a
  24. 21 10月, 2010 3 次提交
    • S
      ceph: use mapping->nrpages to determine if mapping is empty · 18a38193
      Sage Weil 提交于
      This is simpler and faster.
      Signed-off-by: NSage Weil <sage@newdream.net>
      18a38193
    • S
      ceph: only invalidate on check_caps if we actually have pages · 93afd449
      Sage Weil 提交于
      The i_rdcache_gen value only implies we MAY have cached pages; actually
      check the mapping to see if it's worth bothering with an invalidate.
      Signed-off-by: NSage Weil <sage@newdream.net>
      93afd449
    • Y
      ceph: factor out libceph from Ceph file system · 3d14c5d2
      Yehuda Sadeh 提交于
      This factors out protocol and low-level storage parts of ceph into a
      separate libceph module living in net/ceph and include/linux/ceph.  This
      is mostly a matter of moving files around.  However, a few key pieces
      of the interface change as well:
      
       - ceph_client becomes ceph_fs_client and ceph_client, where the latter
         captures the mon and osd clients, and the fs_client gets the mds client
         and file system specific pieces.
       - Mount option parsing and debugfs setup is correspondingly broken into
         two pieces.
       - The mon client gets a generic handler callback for otherwise unknown
         messages (mds map, in this case).
       - The basic supported/required feature bits can be expanded (and are by
         ceph_fs_client).
      
      No functional change, aside from some subtle error handling cases that got
      cleaned up in the refactoring process.
      Signed-off-by: NSage Weil <sage@newdream.net>
      3d14c5d2
  25. 07 10月, 2010 1 次提交
    • S
      ceph: update issue_seq on cap grant · d91f2438
      Sage Weil 提交于
      We need to update the issue_seq on any grant operation, be it via an MDS
      reply or a separate grant message.  The update in the grant path was
      missing.  This broke cap release for inodes in which the MDS sent an
      explicit grant message that was not soon after followed by a successful
      MDS reply on the same inode.
      
      Also fix the signedness on seq locals.
      Signed-off-by: NSage Weil <sage@newdream.net>
      d91f2438