1. 30 3月, 2020 2 次提交
    • J
      ceph: perform asynchronous unlink if we have sufficient caps · 2ccb4546
      Jeff Layton 提交于
      The MDS is getting a new lock-caching facility that will allow it
      to cache the necessary locks to allow asynchronous directory operations.
      Since the CEPH_CAP_FILE_* caps are currently unused on directories,
      we can repurpose those bits for this purpose.
      
      When performing an unlink, if we have Fx on the parent directory,
      and CEPH_CAP_DIR_UNLINK (aka Fr), and we know that the dentry being
      removed is the primary link, then then we can fire off an unlink
      request immediately and don't need to wait on reply before returning.
      
      In that situation, just fix up the dcache and link count and return
      immediately after issuing the call to the MDS. This does mean that we
      need to hold an extra reference to the inode being unlinked, and extra
      references to the caps to avoid races. Those references are put and
      error handling is done in the r_callback routine.
      
      If the operation ends up failing, then set a writeback error on the
      directory inode, and the inode itself that can be fetched later by
      an fsync on the dir.
      
      The behavior of dir caps is slightly different from caps on normal
      files. Because these are just considered an optimization, if the
      session is reconnected, we will not automatically reclaim them. They
      are instead considered lost until we do another synchronous op in the
      parent directory.
      
      Async dirops are enabled via the "nowsync" mount option, which is
      patterned after the xfs "wsync" mount option. For now, the default
      is "wsync", but eventually we may flip that.
      Signed-off-by: NJeff Layton <jlayton@kernel.org>
      Reviewed-by: N"Yan, Zheng" <zyan@redhat.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      2ccb4546
    • J
      ceph: move to a dedicated slabcache for mds requests · 058daab7
      Jeff Layton 提交于
      On my machine (x86_64) this struct is 952 bytes, which gets rounded up
      to 1024 by kmalloc. Move this to a dedicated slabcache, so we can
      allocate them without the extra 72 bytes of overhead per.
      Signed-off-by: NJeff Layton <jlayton@kernel.org>
      Reviewed-by: NIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      058daab7
  2. 12 2月, 2020 2 次提交
    • X
      ceph: noacl mount option is effectively ignored · 3b20bc2f
      Xiubo Li 提交于
      For the old mount API, the module parameters parseing function will
      be called in ceph_mount() and also just after the default posix acl
      flag set, so we can control to enable/disable it via the mount option.
      
      But for the new mount API, it will call the module parameters
      parseing function before ceph_get_tree(), so the posix acl will always
      be enabled.
      
      Fixes: 82995cc6 ("libceph, rbd, ceph: convert to use the new mount API")
      Signed-off-by: NXiubo Li <xiubli@redhat.com>
      Reviewed-by: NIlya Dryomov <idryomov@gmail.com>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      3b20bc2f
    • I
      ceph: canonicalize server path in place · b27a939e
      Ilya Dryomov 提交于
      syzbot reported that 4fbc0c71 ("ceph: remove the extra slashes in
      the server path") had caused a regression where an allocation could be
      done under a spinlock -- compare_mount_options() is called by sget_fc()
      with sb_lock held.
      
      We don't really need the supplied server path, so canonicalize it
      in place and compare it directly.  To make this work, the leading
      slash is kept around and the logic in ceph_real_mount() to skip it
      is restored.  CEPH_MSG_CLIENT_SESSION now reports the same (i.e.
      canonicalized) path, with the leading slash of course.
      
      Fixes: 4fbc0c71 ("ceph: remove the extra slashes in the server path")
      Reported-by: syzbot+98704a51af8e3d9425a9@syzkaller.appspotmail.com
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      Reviewed-by: NJeff Layton <jlayton@kernel.org>
      b27a939e
  3. 08 2月, 2020 6 次提交
  4. 07 2月, 2020 2 次提交
  5. 27 1月, 2020 3 次提交
    • L
      ceph: use copy-from2 op in copy_file_range · 78beb0ff
      Luis Henriques 提交于
      Instead of using the copy-from operation, switch copy_file_range to the
      new copy-from2 operation, which allows to send the truncate_seq and
      truncate_size parameters.
      
      If an OSD does not support the copy-from2 operation it will return
      -EOPNOTSUPP.  In that case, the kernel client will stop trying to do
      remote object copies for this fs client and will always use the generic
      VFS copy_file_range.
      Signed-off-by: NLuis Henriques <lhenriques@suse.com>
      Reviewed-by: NJeff Layton <jlayton@kernel.org>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      78beb0ff
    • X
      ceph: remove the extra slashes in the server path · 4fbc0c71
      Xiubo Li 提交于
      It's possible to pass the mount helper a server path that has more
      than one contiguous slash character. For example:
      
        $ mount -t ceph 192.168.195.165:40176:/// /mnt/cephfs/
      
      In the MDS server side the extra slashes of the server path will be
      treated as snap dir, and then we can get the following debug logs:
      
        ceph:  mount opening path //
        ceph:  open_root_inode opening '//'
        ceph:  fill_trace 0000000059b8a3bc is_dentry 0 is_target 1
        ceph:  alloc_inode 00000000dc4ca00b
        ceph:  get_inode created new inode 00000000dc4ca00b 1.ffffffffffffffff ino 1
        ceph:  get_inode on 1=1.ffffffffffffffff got 00000000dc4ca00b
      
      And then when creating any new file or directory under the mount
      point, we can hit the following BUG_ON in ceph_fill_trace():
      
        BUG_ON(ceph_snap(dir) != dvino.snap);
      
      Have the client ignore the extra slashes in the server path when
      mounting. This will also canonicalize the path, so that identical mounts
      can be consilidated.
      
      1) "//mydir1///mydir//"
      2) "/mydir1/mydir"
      3) "/mydir1/mydir/"
      
      Regardless of the internal treatment of these paths, the kernel still
      stores the original string including the leading '/' for presentation
      to userland.
      
      URL: https://tracker.ceph.com/issues/42771Signed-off-by: NXiubo Li <xiubli@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@kernel.org>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      4fbc0c71
    • X
      ceph: check availability of mds cluster on mount after wait timeout · 97820058
      Xiubo Li 提交于
      If all the MDS daemons are down for some reason, then the first mount
      attempt will fail with EIO after the mount request times out.  A mount
      attempt will also fail with EIO if all of the MDS's are laggy.
      
      This patch changes the code to return -EHOSTUNREACH in these situations
      and adds a pr_info error message to help the admin determine the cause.
      
      URL: https://tracker.ceph.com/issues/4386Signed-off-by: NXiubo Li <xiubli@redhat.com>
      Reviewed-by: NJeff Layton <jlayton@kernel.org>
      Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
      97820058
  6. 10 12月, 2019 1 次提交
  7. 28 11月, 2019 1 次提交
  8. 08 11月, 2019 1 次提交
  9. 16 9月, 2019 4 次提交
  10. 30 8月, 2019 1 次提交
  11. 08 7月, 2019 4 次提交
  12. 03 7月, 2019 1 次提交
  13. 06 6月, 2019 1 次提交
  14. 21 5月, 2019 1 次提交
  15. 08 5月, 2019 1 次提交
  16. 02 5月, 2019 1 次提交
  17. 06 3月, 2019 2 次提交
  18. 08 1月, 2019 1 次提交
  19. 12 12月, 2018 1 次提交
  20. 22 10月, 2018 1 次提交
  21. 06 9月, 2018 1 次提交
  22. 03 8月, 2018 2 次提交