• Xiubo Li's avatar
    ceph: wait for the first reply of inflight async unlink · 4868e537
    Xiubo Li authored
    In async unlink case the kclient won't wait for the first reply
    from MDS and just drop all the links and unhash the dentry and then
    succeeds immediately.
    
    For any new create/link/rename,etc requests followed by using the
    same file names we must wait for the first reply of the inflight
    unlink request, or the MDS possibly will fail these following
    requests with -EEXIST if the inflight async unlink request was
    delayed for some reasons.
    
    And the worst case is that for the none async openc request it will
    successfully open the file if the CDentry hasn't been unlinked yet,
    but later the previous delayed async unlink request will remove the
    CDenty. That means the just created file is possiblly deleted later
    by accident.
    
    We need to wait for the inflight async unlink requests to finish
    when creating new files/directories by using the same file names.
    
    Link: https://tracker.ceph.com/issues/55332Signed-off-by: default avatarXiubo Li <xiubli@redhat.com>
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    4868e537
file.c 68.1 KB