#60 fuser doesn't use enough digits for pid

Sysadmin (14)
John Hughes

# fuser -m /dev/dsp
/dev/dsp: 1 65635c 65969 66070 66316
66391 66422 66613 66627 66677 66681 66685m 66751c
66752c 66753c 66754c 66755c 66756c 66766 66837c 66838c
66839c 66840c 66841c 70510 70511

Also I doubt that process 65635 is using /dev/dsp as
it's home directory.

(Found this by running Thunderbird from an Xterm - the
script tries to find out if it can use the sound
hardware directly by using fuser).


  • Kishore Sampathkumar

    • labels: --> Sysadmin
    • assigned_to: nobody --> kishoreks
  • Kishore Sampathkumar

    Logged In: YES

    See attached text file that contains the problem analysis
    along with the details of fix, and the tests done to confirm
    that the fix works.

  • Kishore Sampathkumar

    fuser problem analysis, fix along with test done

  • Kishore Sampathkumar

    Logged In: YES

    Brian pointed out to me (I had requested him to review my
    fix) that the currently allowed Maximum node number (or node
    ID) for OpenSSI is 125.

    Correspondingly, the PIDs can be upto 7 digits wide since the
    maximum number of PIDs possible are 8192000 (125 * 65536).
    With an additional letter used to denote the "type" of access,
    each individual entry displayed by fuser for an OpenSSI
    system needs to aligned to a width of 8 characters.

    Fixed accordingly, and tested successfully, with one of the
    new nodes added configured with Node number 125, whose
    output is given below (the below commands were issued on
    the init node):

    <root> # cluster -v
    1: UP
    125: UP

    <root> # mount
    /dev/1/sda1 on / type ext3 (rw)
    none on /proc type proc (rw)
    usbdevfs on /proc/bus/usb type usbdevfs (rw)
    devfs on /dev type devfs (rw)
    linuxcoe:/var/opt/LinuxCOE on /mnt type nfs
    usbdevfs on /proc/bus/usb type usbdevfs (rw)

    <root> # fuser -m /dev/sda1
    /dev/sda1: 1r 1c 1e 65632r 65632e
    66083 66083r 66083c 66083e 66087r 66087c
    66087e 66114r 66114c 66114e 66145r 66145c
    66145e 66387 66387r 66387c 66387e 66406 66406r
    66406c 66406e 66438 66438r 66438c 66438e
    67162r 67162c 67162e 72512r 72512c 72512e
    75127r 75127c 75127e 82730r 82730c 82730e
    83251 83251r 83251c 83251e 83337r 83337c
    83337e 83368r 83368c 83368e 83377 83377r 83377e
    8192097r 8192097e 8192371 8192371r 8192371c 8192371e
    8192375r 8192375c 8192375e 8192399r 8192399c 8192399e
    8192427r 8192427c 8192427e 8192488r 8192488c 8192488e
    8192524r 8192524c 8192524e

    The patch corresponding to this fix is given below:

    ===== BEGIN: Patch for fuser.c =====
    --- fuser.c.orig 2004-08-30 12:40:18.000000000 +0530
    +++ fuser.c 2004-08-30 12:40:15.000000000 +0530
    @@ -685,15 +685,15 @@
    if (item->type != it_proc)
    if (item->u.proc.ref_set & REF_FILE)
    - printf ("%6d", item->u.proc.pid);
    + printf ("%8d", item->u.proc.pid);
    if (item->u.proc.ref_set & REF_ROOT)
    - printf ("%6dr", item->u.proc.pid);
    + printf ("%8dr", item->u.proc.pid);
    if (item->u.proc.ref_set & REF_CWD)
    - printf ("%6dc", item->u.proc.pid);
    + printf ("%8dc", item->u.proc.pid);
    if (item->u.proc.ref_set & REF_EXE)
    - printf ("%6de", item->u.proc.pid);
    + printf ("%8de", item->u.proc.pid);
    else if (item->u.proc.ref_set & REF_MMAP)
    - printf ("%6dm", item->u.proc.pid);
    + printf ("%8dm", item->u.proc.pid);
    if ((file->flags & FLAG_UID) && item->u.proc.uid !=
    @@ -752,7 +752,7 @@
    switch (item->type)
    case it_proc:
    - printf ("%6d %c%c%c%c%c ", item-
    + printf ("%8d %c%c%c%c%c ", item-
    item->u.proc.ref_set & REF_FILE ? 'f' : '.',
    item->u.proc.ref_set &
    REF_ROOT ? 'r' : '.',
    item->u.proc.ref_set &
    REF_CWD ? 'c' : '.',
    ===== END: Patch for fuser.c =====

    As per what I wrote in the previous comment, this means we
    will now also have OpenSSI version of "psmisc" RPM. I'm in the
    process of building one, and including it properly as part of
    OpenSSI build and distribution.

  • Kishore Sampathkumar

    Logged In: YES

    The fuser fix has been checked-in.

    fuser has been enhanced for OpenSSI. This is now part of
    OpenSSI "psmisc" distribution. "psmisc" has now been
    imported into OpenSSI CVS ("psmisc" package was not part of
    OpenSSI before), and gets built as part of OpenSSI build.

    Closing this bug.

  • Kishore Sampathkumar

    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks