Hi On 2017-08-16, Linus Torvalds wrote: > On Wed, Aug 16, 2017 at 4:51 PM, Eric W. Biederman > wrote: [...] > Maybe this attached patch is better anyway. It's smaller, because it > keeps more closely to the old code, and just adds a mntput() in all > the exit cases, and depends on the "path_get()" to have incremented > the mnt refcount one extra time. > > Can you find something in this one? > > ENTIRELY UNTESTED! This patch[1] as part of 4.13-rc6 (up to, at least, v4.13-rc6-45-g6470812e2226) introduces a regression for me when using pbuilder 0.228.7[2] (a helper to build Debian packages in a chroot and to create and update its chroots) when trying to umount /dev/ptmx (inside the chroot) on Debian/ unstable (full log and pbuilder configuration file[3] attached). [...] Setting up build-essential (12.3) ... Processing triggers for libc-bin (2.24-15) ... I: unmounting dev/ptmx filesystem W: Could not unmount dev/ptmx: umount: /var/cache/pbuilder/build/1340/dev/ptmx: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).) W: Retrying to unmount dev/ptmx in 5s umount: /var/cache/pbuilder/build/1340/dev/ptmx: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).) Could not unmount dev/ptmx, some programs might still be using files in /proc (klogd?). Please check and kill these processes manually so that I can unmount dev/ptmx. Last umount error was: umount: /var/cache/pbuilder/build/1340/dev/ptmx: target is busy (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1).) [...] lsof isn't revealing (but this might point towards gvfs 1.30.4-1+b1 involvement), fuser -k doesn't release the ressource. Kernel v4.13-rc5 and before (at least 4.11.x and 4.12.x) are not affected, but this problem is reliably reproducible on three different x86_64 systems running Debian/ unstable when the host is running a kernel >=4.6.13-rc6. Unfortunately I haven't really found an easier/ smaller way to reproduce this issue yet, but creating a new build chroot[4] always triggers this problem, updating an existing build chroot[5] (which also mounts and umounts /dev/ptmx) triggers most of the time, but not reliably - building a package (e.g. the kernel, also mounting and umounting /dev/ptmx) also triggered this issue at least once (but I didn't try this more often). My git bisection log is this: $ git bisect log git bisect start # good: [ef954844c7ace62f773f4f23e28d2d915adc419f] Linux 4.13-rc5 git bisect good ef954844c7ace62f773f4f23e28d2d915adc419f # bad: [14ccee78fc82f5512908f4424f541549a5705b89] Linux 4.13-rc6 git bisect bad 14ccee78fc82f5512908f4424f541549a5705b89 # bad: [cb247857f3dae0bdb843362c35027a0066b963a4] Merge tag 'sound-4.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound git bisect bad cb247857f3dae0bdb843362c35027a0066b963a4 # good: [88a5c690b66110ad255380d8f629c629cf6ca559] bpf: fix bpf_trace_printk on 32 bit archs git bisect good 88a5c690b66110ad255380d8f629c629cf6ca559 # bad: [3bc6c906eacec34f0d8dcfd3c7e4513edf152297] Merge branch 'parisc-4.13-5' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux git bisect bad 3bc6c906eacec34f0d8dcfd3c7e4513edf152297 # good: [40c6d1b9e2fc4251ca19fa69398f6fa34e813e27] Merge tag 'linux-kselftest-4.13-rc6-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest git bisect good 40c6d1b9e2fc4251ca19fa69398f6fa34e813e27 # good: [ac9a40905a610fb02086a37b11ff4bf046825a88] Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi git bisect good ac9a40905a610fb02086a37b11ff4bf046825a88 # bad: [99f781b1bfc199ec8eb86d4e015920faf79d5d57] Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs git bisect bad 99f781b1bfc199ec8eb86d4e015920faf79d5d57 # good: [41e327b586762833e48b3703d53312ac32f05f24] quota: correct space limit check git bisect good 41e327b586762833e48b3703d53312ac32f05f24 Reverting just c8c03f1858331e85d397bacccd34ef409aae993c from v4.13-rc6-65-g2acf097f16ab reliably fixes the problem for me. Regards Stefan Lippers-Hollmann [1] commit c8c03f1858331e85d397bacccd34ef409aae993c (HEAD) Author: Linus Torvalds Date: Wed Aug 16 17:08:07 2017 -0700 Subject: pty: fix the cached path of the pty slave file descriptor in the master [2] https://packages.qa.debian.org/p/pbuilder.html https://pbuilder.alioth.debian.org/ https://anonscm.debian.org/git/pbuilder/pbuilder.git mounting/ umounting /dev/ptmx happens in https://anonscm.debian.org/git/pbuilder/pbuilder.git/tree/pbuilder-modules [3] the configuration file as attached relies on BUILDUSERNAME="pbuilder" and BUILDUSERID="$(getent passwd $BUILDUSERNAME | cut -d\: -f3)", commenting those out should be possible, my full BUILDUSER* setup is: # addgroup --system pbuilder # adduser --system --disabled-password --ingroup pbuilder --gecos "pbuilder buildd user" --home /var/run/pbuilder pbuilder # chown pbuilder:pbuilder /var/cache/pbuilder/deps /var/cache/pbuilder/build-result # chmod 2775 /var/cache/pbuilder/deps /var/cache/pbuilder/build-result [4] sudo /usr/sbin/pbuilder create --configfile pbuilderrc.debian.sid.amd64 [5] sudo /usr/sbin/pbuilder update --configfile pbuilderrc.debian.sid.amd64