Project

General

Profile

Bug #23211

client: prevent fallback to remount when dentry_invalidate_cb is true but root->dir is NULL

Added by Zhi Zhang over 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
Start date:
03/05/2018
Due date:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
luminous,jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Client
Labels (FS):
Pull request ID:

Description

Recently we found our ceph-fuse clients got hang occasionally when ceph-fuse used "mount -o remount" process to invalidate kernel dcache and it would get stuck almost every time. All our env is using Linux kernel version 3.10.x, so ceph-fuse should use dentry_invalidate_cb to invalidate kernel dcache, but if root->dir is null, it will still fall into remount_cb case.

(gdb) p root
$3 = (Inode *) 0x7fb7b5657e00
(gdb) p *(Inode *)0x7fb7b5657e00
$4 = {client = 0x7fb7b575c000, ino = {val = 1}, snapid = {val = 18446744073709551614}, faked_ino = 0, rdev = 0, ctime = {tv = {tv_sec = 1517810435, tv_nsec = 418762601}}, 
  mode = 16877, uid = 0, gid = 0, nlink = 1, dir_layout = {dl_dir_hash = 2 '\002', dl_unused1 = 0 '\000', dl_unused2 = 0, dl_unused3 = 0}, layout = {
    stripe_unit = 4194304, stripe_count = 1, object_size = 4194304, pool_id = 1, pool_ns = ""}, size = 0, truncate_seq = 1, truncate_size = 18446744073709551615, mtime = {
    tv = {tv_sec = 1517810435, tv_nsec = 401207568}}, atime = {tv = {tv_sec = 0, tv_nsec = 0}}, time_warp_seq = 0, max_size = 0, dirstat = {<scatter_info_t> = {
      version = 0}, mtime = {tv = {tv_sec = 0, tv_nsec = 0}}, nfiles = 4, nsubdirs = 13}, rstat = {<scatter_info_t> = {version = 0}, rctime = {tv = {tv_sec = 1517810567, 
        tv_nsec = 698122374}}, rbytes = 29935056771994, rfiles = 2197887, rsubdirs = 1473, rsnaprealms = 0}, version = 7284193, xattr_version = 1, inline_version = 1, 
  inline_data = {_buffers = empty std::list, _len = 0, _memcopy_count = 0, append_buffer = {_raw = 0x0, _off = 0, _len = 0}, 
    last_p = {<ceph::buffer::list::iterator_impl<false>> = {<std::iterator<std::forward_iterator_tag, char, long, char*, char&>> = {<No data fields>}, 
        bl = 0x7fb7b5657f08, ls = 0x7fb7b5657f08, off = 0, p = {_raw = , _off = 0, _len = 0}, p_off = 0}, <No data fields>}, static CLAIM_DEFAULT = 0, 
    static CLAIM_ALLOW_NONSHAREABLE = 1}, flags = 0, quota = {max_bytes = 0, max_files = 0}, dir = 0x0, dirfragtree = {
    _splits = {<compact_map_base<frag_t, int, std::map<frag_t, int, std::less<frag_t>, std::allocator<std::pair<frag_t const, int> > > >> = {
        map = 0x0}, <No data fields>}}, dir_contacts = std::set with 0 elements, dir_release_count = 60, dir_ordered_count = 71520, dir_hashed = false, 
  dir_replicated = false, caps = std::map with 1 elements = {[0] = 0x7fb7b5608c60}, auth_cap = 0x7fb7b5608c60, cap_dirtier_uid = -1, cap_dirtier_gid = -1, dirty_caps = 0, 
  flushing_caps = 0, flushing_cap_tids = std::map with 0 elements, shared_gen = 80711, cache_gen = 0, snap_caps = 0, snap_cap_refs = 0, hold_caps_until = {tv = {
      tv_sec = 0, tv_nsec = 0}}, cap_item = {_item = 0x7fb7b5657e00, _prev = 0x0, _next = 0x0, _list = 0x7fb7b575caa0}, flushing_cap_item = {_item = 0x7fb7b5657e00, 
    _prev = 0x0, _next = 0x0, _list = 0x0}, snaprealm = 0x7fb7b564e0d0, snaprealm_item = {_item = 0x7fb7b5657e00, _prev = 0x0, _next = 0x0, _list = 0x7fb7b564e188}, 
  snapdir_parent = {px = 0x0}, cap_snaps = std::map with 0 elements, open_by_mode = std::map with 0 elements, cap_refs = std::map with 0 elements, oset = {
    parent = 0x7fb7b5657e00, ino = {val = 1}, truncate_seq = 0, truncate_size = 0, poolid = 1, objects = {_front = 0x0, _back = 0x0, _size = 0}, dirty_or_tx = 0, 
    return_enoent = false}, reported_size = 0, wanted_max_size = 0, requested_max_size = 0, _ref = 516, ll_ref = 631913, dn_set = std::set with 0 elements, symlink = "", 
  xattrs = std::map with 0 elements, fragmap = std::map with 1 elements = {[{_enc = 0}] = 0}, waitfor_caps = empty std::list, waitfor_commit = empty std::list, 
  fcntl_locks = 0x0, flock_locks = 0x0, unsafe_ops = {_front = 0x0, _back = 0x0, _size = 0}, async_err = 0, cache_read_timestamp = {tv = {tv_sec = 0, tv_nsec = 0}}, 
  deleted_inode = false}

I think we should use either dentry_invalidate_cb or remount_cb to invalidate kernel dcache when Linux kernel version is under 3.18.


Related issues

Copied to fs - Backport #23355: luminous: client: prevent fallback to remount when dentry_invalidate_cb is true but root->dir is NULL Resolved
Copied to fs - Backport #23356: jewel: client: prevent fallback to remount when dentry_invalidate_cb is true but root->dir is NULL Resolved

History

#2 Updated by Patrick Donnelly over 1 year ago

  • Subject changed from client: use either dentry_invalidate_cb or remount_cb to invalidate kernel dcache to client: prevent fallback to remount when dentry_invalidate_cb is true but root->dir is NULL
  • Category set to Correctness/Safety
  • Status changed from New to Need Review
  • Backport set to luminous,jewel
  • Release set to jewel
  • Release set to luminous
  • Component(FS) Client added

#3 Updated by Patrick Donnelly over 1 year ago

  • Status changed from Need Review to Pending Backport
  • Assignee set to Zhi Zhang
  • Target version set to v13.0.0

#4 Updated by Nathan Cutler over 1 year ago

  • Copied to Backport #23355: luminous: client: prevent fallback to remount when dentry_invalidate_cb is true but root->dir is NULL added

#5 Updated by Nathan Cutler over 1 year ago

  • Copied to Backport #23356: jewel: client: prevent fallback to remount when dentry_invalidate_cb is true but root->dir is NULL added

#6 Updated by Nathan Cutler about 1 year ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF