From owner-freebsd-bugs@freebsd.org Tue Jan 2 23:15:19 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F4DAEBE82D for ; Tue, 2 Jan 2018 23:15:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A8CF78312 for ; Tue, 2 Jan 2018 23:15:19 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w02NFJFg082412 for ; Tue, 2 Jan 2018 23:15:19 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w02NFJaM082411 for freebsd-bugs@FreeBSD.org; Tue, 2 Jan 2018 23:15:19 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 224851] Bug in getmntinfo(3) / getfsstat(2) ? Date: Tue, 02 Jan 2018 23:15:19 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jamie@catflap.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jan 2018 23:15:19 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D224851 Bug ID: 224851 Summary: Bug in getmntinfo(3) / getfsstat(2) ? Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: freebsd-bugs@FreeBSD.org Reporter: jamie@catflap.org Created attachment 189351 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D189351&action= =3Dedit test file to demonstrate the problem There appears to be a bug in the system call related to getmntinfo(3) / getfsstat(2), when if the "automount" flag is set on "nullfs" mounts, it is= not returned on a getfsstat "WAIT" call. The non-refreshed, non-blocking "MNT_NOWAIT" produces the correct result. I first noticed this when debugging why my nullfs autofs partitions weren't being automatically unmounted. (FreeBSD current and release) If this is actually intended behaviour, please reassign this as something t= hat needs to be worked around in the autofs code (I think this is similar in th= is regard to #195161 ) The somewhat hacked attached snippet from automount.c in the example below demonstrates this - When called with no parameters, it performs a MNT_WAIT request, otherwise a MNT_NOWAIT request is performed. The results are: | 14:24 [2] (1) "autofs" root@thompson# df | Filesystem 1K-blocks Used Avail Capacity Mounted on | /dev/ada1p2 5061628 707264 3949436 15% / | devfs 1 1 0 100% /dev | /dev/ada1p4 5061628 535004 4121696 11% /var | /dev/ada1p5 978973296 21689416 878966020 2% /usr | | 14:24 [2] (2) "autofs" root@thompson# mount | /dev/ada1p2 on / (ufs, local) | devfs on /dev (devfs, local, multilabel) | /dev/ada1p4 on /var (ufs, local, soft-updates) | /dev/ada1p5 on /usr (ufs, local, soft-updates) | | 14:25 [2] (3) "autofs" root@thompson# mkdir /tmp/automounted /tmp/manual | | 14:25 [2] (4) "autofs" root@thompson# mount -t nullfs -o ro /usr/src /tmp/manual | | 14:25 [2] (5) "autofs" root@thompson# mount -t nullfs -o ro,automounted /usr/src /tmp/automounted/ | | 14:26 [2] (6) "autofs" root@thompson# df | Filesystem 1K-blocks Used Avail Capacity Mounted on | /dev/ada1p2 5061628 707264 3949436 15% / | devfs 1 1 0 100% /dev | /dev/ada1p4 5061628 535004 4121696 11% /var | /dev/ada1p5 978973296 21689420 878966016 2% /usr | /usr/src 978973296 21689420 878966016 2% /tmp/manual | /usr/src 978973296 21689420 878966016 2% /tmp/automount= ed | | 14:26 [2] (7) "autofs" root@thompson# mount | /dev/ada1p2 on / (ufs, local) | devfs on /dev (devfs, local, multilabel) | /dev/ada1p4 on /var (ufs, local, soft-updates) | /dev/ada1p5 on /usr (ufs, local, soft-updates) | /usr/src on /tmp/manual (nullfs, local, read-only) | /usr/src on /tmp/automounted (nullfs, local, read-only, automounted) | | 14:26 [2] (8) "autofs" root@thompson# ./a.out | skipping /, not automounted | skipping /dev, not automounted | skipping /var, not automounted | skipping /usr, not automounted | skipping /tmp/manual, not automounted | skipping /tmp/automounted, not automounted | | 14:26 [2] (9) "autofs" root@thompson# ./a.out x | skipping /, not automounted | skipping /dev, not automounted | skipping /var, not automounted | skipping /usr, not automounted | skipping /tmp/manual, not automounted | /tmp/automounted IS automounted!!!!!!!!! --=20 You are receiving this mail because: You are the assignee for the bug.=