From nobody Sun Aug 13 05:45:12 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RNmhS4XWPz4q1lx for ; Sun, 13 Aug 2023 05:45:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RNmhS2YyKz3gsF for ; Sun, 13 Aug 2023 05:45:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691905512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rC7fbijHVsx56AV9ACp4lqM7y77VTOJ7vJjusGVdfaU=; b=R//n3kkoUniR6qzVkoGQHggVKZvOJbp1dFKOVYMwYWDepOp8G+fCYiFVGFWBKVA2z+MCkm 27LjPFNlROqMW7jslztOfsIYlTjTwlWPOZOzY1BZHEjGDFAuWfQOAsxawx/1PRfY8iRIL4 D8qGxuCNRhNOKBlII20dwrqXsMk9qsPISZ6jwpFanbbvQX4pZ4/lxB4rsTxZLmqR0MVb3j PhuYmg48BPJ8JhUTtsAVq+PbXA984JGIcMfSADfpK4w63h6eMsY5XJZZIhwl1T8Wm/8L5P qY0a2l27IKW+abcjGMbEltBqW26OcKkwLChBdbzstULnJ54Op1VHm3YZ9IjpRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691905512; a=rsa-sha256; cv=none; b=T4kx0lPDED7RPTZ79PHWa4QQNddyopYza1evLa7eDogxvEj8AASVjD822L2t85DV8NKoBR 69aXvdqiB91HjQgixjLD838LgeyJ77MjiRE82F+ZUoIIO3VhOsbf5Pr/7SQrf50fZKrirs t/gdRy4NSHAIj9XIc42o71Tq6E1+GoR5Cl+WLxCs2IlVyQZagLA+UuEszcCFyr2XgYmdIC T+aUB3qHEKlSOV1CFuxCZlIrHCDrXqxdBn158UdandJER0R6vzqo4XI6o4K3TSUoiVbluE M0Y5Xa80Z9OgHhyuuCzHSGorFCDKUic3pBU2mkwOwWmbn31BiXSCYKdZjES1Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RNmhS1g0LzqTQ for ; Sun, 13 Aug 2023 05:45:12 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 37D5jCMc059858 for ; Sun, 13 Aug 2023 05:45:12 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 37D5jCnY059857 for bugs@FreeBSD.org; Sun, 13 Aug 2023 05:45:12 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: bugs@FreeBSD.org Subject: [Bug 273094] getfsstat can return unexpectedly stale statfs data. Date: Sun, 13 Aug 2023 05:45:12 +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 Only Me X-Bugzilla-Who: peterj@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: 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 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 List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D273094 Bug ID: 273094 Summary: getfsstat can return unexpectedly stale statfs data. Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: peterj@FreeBSD.org getfsstat(2) states: >Normally mode should be specified as MNT_WAIT. If mode is set to >MNT_NOWAIT, getfsstat() will return the information it has available >without requesting an update from each file system. Having looked at getfsstat(..., MNT_NOWAIT) output over time, as well as rummaging around in the FreeBSD kernel sources, it seems that the cached da= ta is basically never updated under normal operations. This means that, unless something else (like df) invokes getfsstat(2) with MNT_WAIT or statfs(2), t= he reported data using MNT_NOWAIT will reflect the information from when the filesystem was created or mounted. This was a surprise to me: I would have expected that the information was updated fairly regularly - e.g. on TXG flushes for ZFS and on superblock flushes for UFS. IMO, this is a POLA violation and it presents a problem for monitoring tools that are tracking filesystem usage in order to alert on low free space or similar: * Specifying MNT_WAIT could result in the getfsstat(2) call blocking indefinitely if (e.g.) a NFS server isn't responding. * Specifying MNT_NOWAIT returns data that is stale to the extent of being meaningless. This behaviour has led to (e.g.) https://github.com/prometheus/node_exporter/issues/1498 --=20 You are receiving this mail because: You are the assignee for the bug.=