]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: mds returns -5 error when the deleted file does not exist 30403/head
authorhuanwen ren <ren.huanwen@zte.com.cn>
Mon, 16 Sep 2019 21:46:28 +0000 (05:46 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Tue, 17 Sep 2019 10:46:36 +0000 (18:46 +0800)
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>
src/mds/MDCache.cc

index 4e5fabd38b1a9185840ffb09298e6629da6ca610..dc414570a86f07bcd32350e902e36e0473ef5aa8 100644 (file)
@@ -8629,7 +8629,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;