[Bug 259504] fuser doesn't find processes due to wrong fsid type

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 28 Oct 2021 14:02:04 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259504

            Bug ID: 259504
           Summary: fuser doesn't find processes due to wrong fsid type
           Product: Base System
           Version: 12.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: freebsd-bugs@virtualtec.ch

fuser {file} is supposed to return all pids that have {file} open. It doesn't:

# fuser /usr/local/sbin/httpd 
/usr/local/sbin/httpd:

cause seems to be a wrong type of fsid in fuser.c. With the following change:

--- a/usr.bin/fstat/fuser.c
+++ b/usr.bin/fstat/fuser.c
@@ -92,7 +92,7 @@ struct consumer {
        STAILQ_ENTRY(consumer)  next;
 };
 struct reqfile {
-       uint32_t        fsid;
+       uint64_t        fsid;
        uint64_t        fileid;
        const char      *name;
        STAILQ_HEAD(, consumer) consumers;


fuser does again what it's supposed to do:
# fuser /usr/local/sbin/httpd 
/usr/local/sbin/httpd:   871x   870x   869x   868x   867x   832x

The bug seems to be present in releases since 12 up to at least 13-releng
(didn't check 14).

-- 
You are receiving this mail because:
You are the assignee for the bug.