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
Updated by huanwen ren over 4 years ago
- Component(FS) Client, Ganesha FSAL added
Updated by huanwen ren over 4 years ago
- File 2019-09-16_200643.png 2019-09-16_200643.png added
Updated by Patrick Donnelly over 4 years ago
- Status changed from New to Fix Under Review
- Assignee set to huanwen ren
- Target version set to v15.0.0
- Start date deleted (
09/16/2019) - Source set to Community (dev)
- Backport set to nautilus,mimic
- Pull request ID set to 30403
Updated by Jeff Layton over 4 years ago
I agree that EIO makes no sense here, but since you're looking up files by inode number, -ESTALE would probably make more sense than -ENOENT.
Updated by huanwen ren over 4 years ago
Jeff Layton wrote:
I agree that EIO makes no sense here, but since you're looking up files by inode number, -ESTALE would probably make more sense than -ENOENT.
thank you
“-ESTALE” is more appropriate
Updated by Patrick Donnelly over 4 years ago
- Status changed from Fix Under Review to Pending Backport
Updated by Nathan Cutler over 4 years ago
- Copied to Backport #42147: nautilus: mds: mds returns -5 error when the deleted file does not exist added
Updated by Nathan Cutler over 4 years ago
- Copied to Backport #42148: mimic: mds: mds returns -5 error when the deleted file does not exist added
Updated by Nathan Cutler about 4 years ago
- Status changed from Pending Backport to Resolved
While running with --resolve-parent, the script "backport-create-issue" noticed that all backports of this issue are in status "Resolved" or "Rejected".