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>
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;