diff options
author | Xiubo Li <xiubli@redhat.com> | 2022-05-10 04:47:01 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2022-08-03 01:54:12 +0300 |
commit | 4868e537fa867f82e38e37429d61d7bb8357d79b (patch) | |
tree | badea4f6181c6755959c8a44c4b84f527da23cad /fs/ceph/mds_client.h | |
parent | 4f48d5da81ee7004a789c8aac2d0dfb2514c37f1 (diff) | |
download | linux-4868e537fa867f82e38e37429d61d7bb8357d79b.tar.xz |
ceph: wait for the first reply of inflight async unlink
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/55332
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/mds_client.h')
-rw-r--r-- | fs/ceph/mds_client.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index 4620167f58eb..d8ec2ac93da3 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h @@ -575,6 +575,7 @@ static inline int ceph_wait_on_async_create(struct inode *inode) TASK_KILLABLE); } +extern int ceph_wait_on_conflict_unlink(struct dentry *dentry); extern u64 ceph_get_deleg_ino(struct ceph_mds_session *session); extern int ceph_restore_deleg_ino(struct ceph_mds_session *session, u64 ino); #endif |