From b224ce37cf983a967a3b22ee2b7444c9c426e74b Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Fri, 2 Jan 2026 21:53:20 +0100 Subject: [PATCH] Stop identify_bind_mounts from classifying non-path devices Previously, identify_bind_mounts falsely classified `n` out of `n + 1` tmpfs mounts as bind mounts to the same thing. --- pydf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pydf b/pydf index 549f993..f14c33b 100755 --- a/pydf +++ b/pydf @@ -368,11 +368,13 @@ def niceprint_fs(fs): def identify_bind_mounts(mountpoints): by_dev = {} for mp, (device, typ, opts) in mountpoints.items(): + if not '/' in device: # e.g. pseudo device "tmpfs" + continue if device not in by_dev or mp.count('/') < by_dev[device].count('/'): by_dev[device] = mp r = {} for mp, (device, typ, opts) in mountpoints.items(): - if mp != by_dev[device] and 'bind' not in opts: + if mp != by_dev.get(device, mp) and 'bind' not in opts: opts = ['bind'] + opts r[mp] = (device, typ, opts) return r