]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: mds returns -5 error when the deleted file does not exist 30767/head
authorhuanwen ren <ren.huanwen@zte.com.cn>
Mon, 16 Sep 2019 21:46:28 +0000 (05:46 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 7 Oct 2019 18:57:21 +0000 (20:57 +0200)
For files that do not exist, we should set it to -ESTALE 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
-ESTALE differently. And lead to misjudgment

Fixes:https://tracker.ceph.com/issues/41868
Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
(cherry picked from commit cfb8e61a7cd12667ce3738bd9c9a4601b98c4bf9)

src/mds/MDCache.cc

index 886b0eef1a391d42bdea70ec80969fdb7c0fbe57..adf9cbfac78101e332ea42c33383009457e6dcd2 100644 (file)
@@ -8642,7 +8642,7 @@ void MDCache::_open_ino_backtrace_fetched(inodeno_t ino, bufferlist& bl, int err
   if (err == 0) {
     if (backtrace.ancestors.empty()) {
       dout(10) << " got empty backtrace " << dendl;
-      err = -EIO;
+      err = -ESTALE;
     } else if (!info.ancestors.empty()) {
       if (info.ancestors[0] == backtrace.ancestors[0]) {
        dout(10) << " got same parents " << info.ancestors[0] << " 2 times" << dendl;