Whamcloud - gitweb
LU-11545 debugfs: mask off dir_data flags for ncheck 74/33574/2
authorLi Dongyang <dongyangli@ddn.com>
Mon, 5 Nov 2018 05:48:56 +0000 (16:48 +1100)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 9 Nov 2018 07:05:44 +0000 (07:05 +0000)
Leaving dir_data flags on filetype will confuse "ncheck -c".
This also adds man page and help message for the "-D" option
of ls.

Change-Id: I5bbaf1b6845eaa6c2b6d97818c174f56b669f27d
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/33574
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
debugfs/debugfs.8.in
debugfs/ls.c
debugfs/ncheck.c

index 393c000..3497060 100644 (file)
@@ -549,7 +549,7 @@ option causes logdump to display old (checkpointed) journal entries.
 This can be used to try to track down journal problems even after the
 journal has been replayed.
 .TP
-.BI ls " [-l] [-c] [-d] [-p] [-r] filespec"
+.BI ls " [-l] [-c] [-d] [-p] [-r] [-D] filespec"
 Print a listing of the files in the directory
 .IR filespec .
 The
@@ -569,6 +569,11 @@ non-printing characters at the end of filenames.
 The
 .I \-r
 flag will force the printing of the filename, even if it is encrypted.
+The
+.I \-D
+flag will print the extra data found inside each entry when the
+.I \-l
+flag is used.
 .TP
 .BI list_deleted_inodes " [limit]"
 List deleted inodes, optionally limited to those deleted within
index 1b549b4..2b631f8 100644 (file)
@@ -270,7 +270,7 @@ void do_list_dir(int argc, char *argv[])
 
        if (argc > optind+1) {
        print_usage:
-               com_err(0, 0, "Usage: ls [-c] [-d] [-l] [-p] [-r] file");
+               com_err(0, 0, "Usage: ls [-c] [-d] [-l] [-p] [-r] [-D] file");
                return;
        }
 
index dc4ab56..5936d5d 100644 (file)
@@ -51,6 +51,9 @@ static int ncheck_proc(struct ext2_dir_entry *dirent,
        iw->position++;
        if (iw->position <= 2)
                return 0;
+       if (current_fs->super->s_feature_incompat &
+                       EXT4_FEATURE_INCOMPAT_DIRDATA)
+               filetype &= EXT2_FT_MASK;
        for (i=0; i < iw->num_inodes; i++) {
                if (iw->iarray[i] == dirent->inode) {
                        if (!iw->parent && !iw->get_pathname_failed) {