Project

General

Profile

Actions

Bug #41868

closed

mds: mds returns -5 error when the deleted file does not exist

Added by huanwen ren over 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
huanwen ren
Category:
-
Target version:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
nautilus,mimic
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
fs
Component(FS):
Client, Ganesha FSAL, MDS
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

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

2019-09-16_200643.png (8.46 KB) 2019-09-16_200643.png huanwen ren, 09/16/2019 12:07 PM

Related issues 2 (0 open2 closed)

Copied to CephFS - Backport #42147: nautilus: mds: mds returns -5 error when the deleted file does not existResolvedNathan CutlerActions
Copied to CephFS - Backport #42148: mimic: mds: mds returns -5 error when the deleted file does not existResolvedNathan CutlerActions
Actions #1

Updated by huanwen ren over 4 years ago

  • Component(FS) Client, Ganesha FSAL added
Actions #2

Updated by huanwen ren over 4 years ago

Actions #3

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
Actions #4

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.

Actions #5

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

Actions #6

Updated by Patrick Donnelly over 4 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #7

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
Actions #8

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
Actions #9

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".

Actions

Also available in: Atom PDF