From nobody Sat Apr 27 14:58:45 2024 X-Original-To: dev-commits-src-branches@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 4VRXm54q4Kz5JH6P; Sat, 27 Apr 2024 14:58:45 +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 4VRXm549mdz42r3; Sat, 27 Apr 2024 14:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714229925; 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=S636cxuU6kHwVnLea9gLtWWOa3DdcK/NwxPDSNATvKg=; b=yea+Tqd5OkgW/dYqRI7BWSEkHKmDyISXCFx8n2C18ogeoGJ8oOfL3J3jplYloFvJ3zjP75 yrmp0MiQXvntrOEk9X5Ar/BZ3UqDxNjDTcwxjzhLAEYr1RsMJi5ZPg2nmMWUfwVYr/vlI9 CMczthvmIlwBjYyK9d9MxgDNDuzCZX7IwNV3Wk1oVfni7TdGSI0NHFdmbTJh9xbn4G2nSl NOGK80yjCwsbt6Hz1t6fqKTOSZqiqQP451lHb++pO0O4f53YKkDsElTpr27u1LD4V5/I8y SCmSEANDFqFJOvrnB2VAmhIZITn6PUKdyqUuSCYnY/BiKBd0eJJkyXfikg6lPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714229925; a=rsa-sha256; cv=none; b=Pb+/i2+sCUhRsdsUP2jtc0oy+dGUBICytV1V+mDVYsTrTbFAgIue9c1ri4DNfGnPq6g2fN dkguXRJZeG1K+92W98LUOylv2rVT1cczv3e5oWz/W0Pu+1blIvzqIFQR2eu6Ob6tBPxEgH w3Lc0lTSVRwS2MY5zma8FFxbrhZNsabwjtxzdUhN6/HeOhREDTITKE1h/f4P1p+lUpqhsU WaJm69wz4WJH6eml+l28fcnjA0IC9ZXZY7179I4IYU7doiSdD357bG/+nCUBVe7NRI56wI rf2+aOGaaT+zmpDryAZE49knH3HXtNaOBZ6V32bnSG1ukJ4GsqXY2exHrsKJbA== 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=1714229925; 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=S636cxuU6kHwVnLea9gLtWWOa3DdcK/NwxPDSNATvKg=; b=gl1JNW6Dt2oxefWUq1UOLyVRc/MAX4hZqKigVzZx1/BMx8SStpmDs/b4FU3pxYXVIiGvap MN9zLqfTNsEbcof01AShi/aiLHOb3/GVI1OURjmp4+Z4IlJQtRDZkCTlbJRcJqCb7lUtYM GnqnpZoje7QdAZypL+H8z96NmxN9yxt/T9EeyWC2PJnqKqmHDOcO4ESMm7/k4fscOu0J0+ 7VUaPJdi3ly2jHFzqNzNUR9BRhdG9lJKEKevJoudIIwrSL00fIuuEkJUN2o0xD+F/MmL1p AjCVsNJRX87b2J36FICaqJBURO3UWvCS0wCoLW4crHUbG5Y8m6bIAdmhWduF+w== 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 4VRXm53gMGzX4w; Sat, 27 Apr 2024 14:58:45 +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 43REwjkX032478; Sat, 27 Apr 2024 14:58:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43REwjHI032475; Sat, 27 Apr 2024 14:58:45 GMT (envelope-from git) Date: Sat, 27 Apr 2024 14:58:45 GMT Message-Id: <202404271458.43REwjHI032475@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: 1d06b45463bf - stable/13 - Fix MNT_IGNORE for devfs, fdescfs and nullfs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: 1d06b45463bf404b5010f2370cb39b68a32da323 Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=1d06b45463bf404b5010f2370cb39b68a32da323 commit 1d06b45463bf404b5010f2370cb39b68a32da323 Author: Doug Rabson AuthorDate: 2023-08-26 09:32:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-04-27 14:58:39 +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 77ead04b1616..271f5bf249fc 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -337,7 +337,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;