From nobody Mon Apr 22 13:48:38 2024 X-Original-To: dev-commits-src-all@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 4VNRRW151Pz5H82W; Mon, 22 Apr 2024 13:48:39 +0000 (UTC) (envelope-from git@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 4VNRRW0XrQz4g9H; Mon, 22 Apr 2024 13:48:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713793719; 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=IyV0KWFrRCNS8lP20wZ8ob4+ueGAH8L0mkbjs/4JMBA=; b=w5Dwo/Kyv+X70ZiXlHp2CRb8HAc/Izoox+zvDcUJkFK4Yb32Z/tp2xbsXXPTYpGLWNRdBf MFMy8Et1MFwAK2A2buMolbsR2j29RcmZQM7mnoeVnvOG8GFm4nzwd+jMIdnfUPMUPD4XlI huG4JNHTgbtKBySA+hLVdj7jhA31C1hbgqbjI7jnoFbjUJD2LARprbBJJF4z37m3dM/K1W zcLXrT9lKTAZFqTsZzFw7AtNA13KcQiEtx9Ml+tD2MwmWM5G0zP5CEEoPItnxDyMTO7SSj x7F0JF7eONLqSshg6EjHLlUueOvuplI2JO/K60A94lfmTyfWuQL1eTT78PZQ3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713793719; a=rsa-sha256; cv=none; b=yHchQXS+i2aZpRqjKz2aDhVt1u/P+4DrH/GEeuX1Ynhi3rmIs9NcRMHtT8aaZDjkINMdl1 kw5N/xrl3qiR2aL9tYvgyLhd7u8C9Xyp5m1srM9j+GNpo0Jhuv7RhqcbMyLkkeImyR0qTF uagnnOjPrrE4JUNPLFV/1PT0G73C7desK9hhyPep/M0CpkLen6nPM4FLRMMSGJyKE4tpMk ZKI0dmonD7CZ5jh67WhfNkM5iS+aaWg0/P1Z9A1K3gOSgKsVCmcvk4e1ps3NuvblZ3DNTg TCWb2xSMhNRCPy33SbeIq4MlNHiaNg8Cfj8/EsPm4wW1/OW14c706oU6Clp9hA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713793719; 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=IyV0KWFrRCNS8lP20wZ8ob4+ueGAH8L0mkbjs/4JMBA=; b=twRhwobZc/AlMyWku1aw/6b9Z8EFq9Tw78RHcsOZNHZv7MDMMXgdyolh0cpVrPO+qB6tFD CTR7cmIcWaHUbkfB99q8rO+HQRKucPcbBg6FQupsBiUo7D3TPdVZcD75IqyMtipYgjeC9W VlY9KTTKAVTb+V6WUwyc9Fjw06RuQ1d1j2bbX+dGcRAHGk8ioOsIanopTcSJCyJgeGM8sp x3yr+qFaAf11VWHJVgKJjmq00qNFzN0aodWcU7EFqKNANnafA+NzGSNWDnxo5jy4mqYV8u 8B/dbXjODAo+Z4h4ZQcQvCTAy+rqKT7THcn+/9mVruKBP8E023tZQqIGbA6fIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 4VNRRV6y6dzqZZ; Mon, 22 Apr 2024 13:48:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43MDmcrT021952; Mon, 22 Apr 2024 13:48:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43MDmcnk021949; Mon, 22 Apr 2024 13:48:38 GMT (envelope-from git) Date: Mon, 22 Apr 2024 13:48:38 GMT Message-Id: <202404221348.43MDmcnk021949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a1e55af8d123 - stable/14 - Fix MNT_IGNORE for devfs, fdescfs and nullfs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a1e55af8d12398ae43725ff6987b2fdbb2044fd2 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a1e55af8d12398ae43725ff6987b2fdbb2044fd2 commit a1e55af8d12398ae43725ff6987b2fdbb2044fd2 Author: Doug Rabson AuthorDate: 2023-08-26 09:32:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-22 13:48:15 +0000 Fix MNT_IGNORE for devfs, fdescfs and nullfs The MNT_IGNORE flag can be used to mark certain filesystem mounts so that utilities such as df(1) and mount(8) can filter out those mounts by default. This can be used, for instance, to reduce the noise from running container workloads inside jails which often have at least three and sometimes as many as ten mounts per container. The flag is supplied by the nmount(2) system call and is recorded so that it can be reported by statfs(2). Unfortunately several filesystems override the default behaviour and mask out the flag, defeating its purpose. This change preserves the MNT_IGNORE flag for those filesystems so that it can be reported correctly. MFC after: 1 week (cherry picked from commit b5c4616582cebdcf4dee909a3c2f5b113c4ae59e) --- sys/fs/devfs/devfs_vfsops.c | 2 +- sys/fs/fdescfs/fdesc_vfsops.c | 2 +- sys/fs/nullfs/null_vfsops.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/fs/devfs/devfs_vfsops.c b/sys/fs/devfs/devfs_vfsops.c index a81a63ebf27a..dbc29fbe4d78 100644 --- a/sys/fs/devfs/devfs_vfsops.c +++ b/sys/fs/devfs/devfs_vfsops.c @@ -224,7 +224,7 @@ static int devfs_statfs(struct mount *mp, struct statfs *sbp) { - sbp->f_flags = 0; + sbp->f_flags = mp->mnt_flag & MNT_IGNORE; sbp->f_bsize = DEV_BSIZE; sbp->f_iosize = DEV_BSIZE; sbp->f_blocks = 2; /* 1K to keep df happy */ diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index 309134798374..30924580dece 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -219,7 +219,7 @@ fdesc_statfs(struct mount *mp, struct statfs *sbp) freefd += (lim - fdp->fd_nfiles); FILEDESC_SUNLOCK(fdp); - sbp->f_flags = 0; + sbp->f_flags = mp->mnt_flag & MNT_IGNORE; sbp->f_bsize = DEV_BSIZE; sbp->f_iosize = DEV_BSIZE; sbp->f_blocks = 2; /* 1K to keep df happy */ diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 262a6793b285..5114fa0b50ae 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -372,7 +372,7 @@ nullfs_statfs(struct mount *mp, struct statfs *sbp) /* now copy across the "interesting" information and fake the rest */ sbp->f_type = mstat->f_type; sbp->f_flags = (sbp->f_flags & (MNT_RDONLY | MNT_NOEXEC | MNT_NOSUID | - MNT_UNION | MNT_NOSYMFOLLOW | MNT_AUTOMOUNTED)) | + MNT_UNION | MNT_NOSYMFOLLOW | MNT_AUTOMOUNTED | MNT_IGNORE)) | (mstat->f_flags & ~(MNT_ROOTFS | MNT_AUTOMOUNTED)); sbp->f_bsize = mstat->f_bsize; sbp->f_iosize = mstat->f_iosize;