[LU-13687] interop: "lfs find" prints spurious "No such file or directory" error messages Created: 17/Jun/20  Updated: 09/Dec/20  Resolved: 13/Aug/20

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.14.0, Lustre 2.12.4
Fix Version/s: Lustre 2.14.0, Lustre 2.12.6

Type: Bug Priority: Minor
Reporter: Andreas Dilger Assignee: Andreas Dilger
Resolution: Fixed Votes: 0
Labels: None
Environment:

v2_13_54-44-gf3fef81


Issue Links:
Related
is related to LU-11656 "lfs getstripe" on directory does not... Resolved
Rank (Obsolete): 9223372036854775807

 Description   

When running "lfs find" it prints a spurious error message for each directory that it processes, and then appears to take the last argument "0" as the directory name when printing the summary error message:

# lfs find /myth/tmp -size +100K --ost 0
lfs find: warning: /myth/tmp does not exist: No such file or directory (2)  
lfs find: warning: /myth/tmp/mythtv does not exist: No such file or directory (2)
lfs find: warning: /myth/tmp/testdir does not exist: No such file or directory (2)
/myth/tmp/pflfile2
/myth/tmp/40T
:
:
error: find failed for 0.

Reversing the order of the arguments prints the final error message correctly:

# lfs find -size +100K --ost 0 /myth/tmp
lfs find: warning: /myth/tmp does not exist: No such file or directory (2)  
lfs find: warning: /myth/tmp/mythtv does not exist: No such file or directory (2)
lfs find: warning: /myth/tmp/testdir does not exist: No such file or directory (2)
/myth/tmp/pflfile2
/myth/tmp/40T
:
:
error: find failed for /myth/tmp.

I suspect the "No such file or directory (2)" message may be incorrectly a result of getxattr() or IOC_MDC_GETFILEINFO on the file returning -ENOENT and that being printed rather than ignored?



 Comments   
Comment by Andreas Dilger [ 27/Jun/20 ]

It may be that this is only happening when running a newer client (2.12.4+, 2.13.53+) against an older server. The error is being printed from get_lmd_info_fd():

1863            if (dir_fd >= 0) {
1875                    ret = ioctl(dir_fd, LL_IOC_MDC_GETINFO_V2, lmdbuf);
1927            if (ret && type == GET_LMD_INFO) {
1928                    if (errno == ENOTTY) {
1948                    } else if (errno == ENOENT) {
1949                            ret = -errno;
1950                            llapi_error(LLAPI_MSG_WARN, ret,
1951                                        "warning: %s does not exist", path);

It seems that this is related to patch https://review.whamcloud.com/36609 "LU-11656 llite: fetch default layout for a directory", since the error is returned from code added in that patch:

ll_dir_get_default_layout()) md_getattr failed on inode [0x200000007:0x1:0x0]: rc -2
ll_dir_get_default_layout()) Process leaving via out rc= -2 
ll_dir_getstripe_default()) Process leaving rc= -2
ll_dir_ioctl()) Process leaving via out_req rc= -2

The FID [[0x200000007:0x1:0x0] is FID_SEQ_ROOT, so it is trying to get the default filesystem layout:

int ll_dir_getstripe_default(struct inode *inode, void **plmm, int *plmm_size,
                             struct ptlrpc_request **request,
                             struct ptlrpc_request **root_request,
                             u64 valid)
{
        rc = ll_dir_get_default_layout(inode, (void **)&lmm, &lmm_size,
                                       &req, valid, 0);
        if (rc == -ENODATA && !fid_is_root(ll_inode2fid(inode)) &&
            !(valid & (OBD_MD_MEA|OBD_MD_DEFAULT_MEA)) && root_request != NULL)
                rc = ll_dir_get_default_layout(inode, (void **)&lmm, &lmm_size,
                                               &root_req, valid,
                                               GET_DEFAULT_LAYOUT_ROOT);
Comment by Gerrit Updater [ 27/Jun/20 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/39200
Subject: LU-13687 llite: return -ENODATA if no default layout
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: d6564d6ea6cd250954d1c21ab6149584608536f8

Comment by Gerrit Updater [ 13/Aug/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/39200/
Subject: LU-13687 llite: return -ENODATA if no default layout
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 7fb17eb7b7e6035931987ae1e9589639114d210e

Comment by Mahmoud Hanafi [ 30/Oct/20 ]

We are get error on lustre2.12.4. Can we get a backport of the patch.

Comment by Gerrit Updater [ 30/Oct/20 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/40499
Subject: LU-13687 llite: return -ENODATA if no default layout
Project: fs/lustre-release
Branch: b2_12
Current Patch Set: 1
Commit: 44bc69bd443eb24802572668ca84f831491f0337

Comment by Gerrit Updater [ 07/Nov/20 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/40499/
Subject: LU-13687 llite: return -ENODATA if no default layout
Project: fs/lustre-release
Branch: b2_12
Current Patch Set:
Commit: 41dfe594d2a0b93fe8c54fed049526b60332515a

Generated at Sat Feb 10 03:03:21 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.