Whamcloud - gitweb
e2fsck: no parent lookup in disconnected dir
authorAndreas Dilger <adilger@whamcloud.com>
Mon, 13 Dec 2021 06:35:30 +0000 (23:35 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 3 May 2022 03:40:10 +0000 (23:40 -0400)
commit6b0e3bd7bd2f2db3c3993c5d91379ad55e60b51e
treea7baa29733aa15ea204127e5c676f281ecb11886
parentc1bd25333e8986b081b82a8eb8c9173a0c7480af
e2fsck: no parent lookup in disconnected dir

Don't call into ext2fs_get_pathname() to do a name lookup for a
disconnected directory, since the directory block traversal in
pass1 has already scanned all of the leaf blocks and never finds
the entry, always printing "???".  If the name entry had been
found earlier, the directory would not be disconnected in pass3.

Instead, lookup ".." and print the parent name in the prompt, and
then do not search for the current directory name at all.  This
avoids a useless full directory scan for each disconnected entry,
which can potentially be slow if the parent directory is large.

Separate the recursively looped directory case to a new error code,
since it is a different problem that should use its own descriptive
text, and a proper pathname can be shown in this case.

Lustre-bug-Id: https://jira.whamcloud.com/browse/LU-15330
Change-Id: If17a92689f24f365ca1fbe5c837e7d5f383ebbe5
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 files changed:
e2fsck/pass3.c
e2fsck/problem.c
e2fsck/problem.h
tests/f_bad_encryption/expect.1
tests/f_badroot/expect.1
tests/f_encrypted_lpf/expect.1
tests/f_expand/expect.1.gz
tests/f_lpf2/expect.1
tests/f_noroot/expect.1
tests/f_orphan_dotdot_ft/expect.1
tests/f_rebuild_csum_rootdir/expect.1
tests/f_recnect_bad/expect.1
tests/f_resize_inode_meta_bg/expect.1