• Yan, Zheng's avatar
    ceph: fix race of queuing delayed caps · 0f439c74
    Yan, Zheng authored
    When called with CHECK_CAPS_AUTHONLY flag, ceph_check_caps() only
    processes auth caps. In that case, it's unsafe to remove inode
    from mdsc->cap_delay_list, because there can be delayed non-auth
    caps.
    
    Besides, ceph_check_caps() may lock/unlock i_ceph_lock several
    times, when multiple threads call ceph_check_caps() at the same
    time. It's possible that one thread calls __cap_delay_requeue(),
    another thread calls __cap_delay_cancel(). __cap_delay_cancel()
    should be called at very beginning of ceph_check_caps(), so that
    it does not race with __cap_delay_requeue().
    Signed-off-by: default avatar"Yan, Zheng" <zyan@redhat.com>
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    0f439c74
caps.c 108 KB