]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: collect namespace files after collecting information about "nodev" fs
authorMasatake YAMATO <yamato@redhat.com>
Wed, 23 Nov 2022 06:41:57 +0000 (15:41 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Wed, 23 Nov 2022 10:50:31 +0000 (19:50 +0900)
In my plan, lsfd will need the information of the backing device for
"nsfs" file system before collecing the information about th namespaces
associated with fds.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd.c

index a7e88aea4cacc6d1d2b10111032a92a036d644df..2e2728791b5a46aae9724e7afa506254a8f78032 100644 (file)
@@ -1279,8 +1279,6 @@ static void read_process(struct lsfd_control *ctl, struct path_cxt *pc,
            || kcmp(proc->leader->pid, proc->pid, KCMP_FS, 0, 0) != 0)
                collect_fs_files(pc, proc);
 
-       collect_namespace_files(pc, proc);
-
        if (proc->ns_mnt == 0 || !has_mnt_ns(proc->ns_mnt)) {
                FILE *mnt = ul_path_fopen(pc, "r", "mountinfo");
                if (mnt) {
@@ -1291,6 +1289,8 @@ static void read_process(struct lsfd_control *ctl, struct path_cxt *pc,
                }
        }
 
+       collect_namespace_files(pc, proc);
+
        /* If kcmp is not available,
         * there is no way to no whether threads share resources.
         * In such cases, we must pay the costs: call collect_mem_files()