Filelight: filter out duplicate paths
ClosedPublic

Authored by alnikiforov on Feb 27 2020, 3:36 PM.

Details

Summary

Sometimes, one mount path may be encountered multiple times
in /proc/self/mounts file.
For example, when systemd automounting is used.
In such cases Filelight would display such mount paths multiple times
in main window.
Or when multiple filesystems are mounted over same path.
In such cases use information only about last mounted filesystem
since only it is available at the moment.

Also ignore 'autofs' filesystems.

Test Plan

Issue reproduces when systemd automounting is used.

  1. Setup automounted nfs mount like this in /etc/fstab:
server_address:/remote_path /local_mountpoint nfs ro,nolock,x-systemd.automount 0 0
  1. force systemd to re-read fstab or reboot.

systemctl daemon-reload and systemctl restart remote-fs.target should be enough

  1. Following command should return at least 2:

$ grep /local_mountpoint /proc/self/mounts | wc -l

First entry is autofs from systemd and second entry is actual nfs mount.

  1. Run Filelight
  2. Filelight should display only one /local_mountpoint entry.

It is also possible to reproduce issue by mounting different filesystems over same mount path:

  1. Mount at least 2 different filesystems over same mount path.
  2. Only one filesystem is actually available to user, the one which was mounted last.
  3. Filelight displays mounted path at least 2 times, possibly using different names if such names are available.

Diff Detail

Repository
R352 Filelight
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alnikiforov created this revision.Feb 27 2020, 3:36 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptFeb 27 2020, 3:36 PM
alnikiforov requested review of this revision.Feb 27 2020, 3:36 PM
alnikiforov edited the summary of this revision. (Show Details)
alnikiforov edited the test plan for this revision. (Show Details)

Updated change to obtain information only about last device mounted over specific mount path. At least filesystem may be different in such case.

Also ignore 'autofs' filesystem since it's a virtual filesystem.

This revision is now accepted and ready to land.Mar 7 2020, 12:28 PM

lgtm.

Could you please push this change when it'd be convenient for you? I don't have permissions. Thanks.

This revision was automatically updated to reflect the committed changes.
dakon added a subscriber: dakon.Mar 10 2020, 6:21 PM

Could you please push this change when it'd be convenient for you? I don't have permissions. Thanks.

You should fix that ;)

dakon removed a subscriber: dakon.Mar 10 2020, 6:21 PM