]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: rdlock_path_xlock_dentry supports returning auth target inode
authorZhansong Gao <zhsgao@hotmail.com>
Tue, 10 Jan 2023 13:40:12 +0000 (21:40 +0800)
committerVenky Shankar <vshankar@redhat.com>
Sat, 20 May 2023 10:51:53 +0000 (16:21 +0530)
commit13d64875337b66c02d2a3bb7b989741804b41000
tree7ea7b69f9417fa409f1c953b78e89dfc7f54807b
parent2b9cbc3dd71da500ae760e3fb916662831948edc
mds: rdlock_path_xlock_dentry supports returning auth target inode

`Server::handle_client_openc` will call `Server::handle_client_open`
if the target inode exists. `Server::handle_client_open requires`
the target inode to be auth if client sets `O_WRONLY` or `O_TRUNC`,
but `Server::rdlock_path_xlock_dentry` can not ensure that. The assertion
that the target inode is auth in `Server::handle_client_open` may fail
and it will crash mds. So add a parameter to to support returning
auth target inode if it exists and forward the request if necessary.
The tail dentry may not be auth anymore when an auth target inode
is provided as required by the caller, because we can't require
both of them to be auth in one mds.
This bug will only be triggered in kernel client, because ceph-fuse
client will try to lookup the target before sending a create request
to mds and it can send an open request instead if the target exists.
But kernel client will send the create request to mds without lookup
first because `atomic open` is supported to improve performance.

Fixes: https://tracker.ceph.com/issues/58411
Signed-off-by: Zhansong Gao <zhsgao@hotmail.com>
(cherry picked from commit cf5fdcd6e2d22f35b670d3c13ae8b7c9b9d2616d)
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/Server.cc
src/mds/Server.h