Bug #41868
closedmds: mds returns -5 error when the deleted file does not exist
0%
Description
There are 2 nfs-ganehsa ends:
1.The A side uses readdir to get all the file information in a directory,
and uses ceph_ll_lookup_inode to find the mds.
2.In addition, the B side just deletes the "aaa" file in this directory.
3.At this time, the A end will go to the MDS through ceph_ll_lookup_inode
to find the ino of the "aaa" file that has been deleted, resulting in a bug of -5.
The call chain looks like this:
(1) NFS:
ceph_ll_lookup_inode --->
(2) Client:
Client::ll_lookup_inode ---> Client::_lookup_ino--->
message: CEPH_MDS_OP_LOOKUPINO
(3) MDS:
Server::handle_client_lookup_ino --->
MDCache::open_ino--->
MDCache::do_open_ino--->
C_IO_MDC_OpenInoBacktraceFetched--->
MDCache::_open_ino_backtrace_fetched--->
"if (backtrace.ancestors.empty()) return -EIO"
Fixup:
For files that do not exist, we should set it to -ENOENT instead of -EIO, because this error code will be returned to the NFS client and transparently passed to the application layer. The application layer may handle -EIO and -ENOENT differently. And lead to misjudgment
Files