From nobody Sat Aug 26 14:31:00 2023 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 4RXzl86c8sz4qZcb; Sat, 26 Aug 2023 14:31:00 +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 4RXzl85qYyz3KlJ; Sat, 26 Aug 2023 14:31:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693060260; 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=i18bFLBjYEOfCgKGLzpP1vSSTZJBSPQD2kMYYApG3Z4=; b=In4kzi69HY7aRL+RLVbms6mAD/uj/8uSds/Uxu/44KNZ6qI2HqdrMhqCRIGUzkOHtdgEnC fyZsqwg60OUxQ+7mEzFSYhqp0dncEjw2qZsVanAvDy59U9rCOBLiTaoMjBgVJn28qgUbqr 166GhSxJs5sNCpABc8IvR1ee0Wk4FdfItP8WenmjM0i0nwI5EThB5TfuUP5KRuo5Q3LlzM 8q0Fvs3ust0bDBEd9GPIlbZsn3MlOOnFX0Ob+b67LNc5AE800QniuIKLGMlLxHp8GV2gDG Yg4kGjksS2l0APmHtUy8VVh8FpZ6atstxfHq+chBOeWRITE4+pIFiRaTgARB7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693060260; 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=i18bFLBjYEOfCgKGLzpP1vSSTZJBSPQD2kMYYApG3Z4=; b=EFrhXwC1g81tn6IdHI0a4W8Xg1a1EROGvuYFpVQvuA7KV+WY06MEJhqR9y5C/u5d8xPo4T NaTB97tKXOI1QPjzVr9WrluLOKaGgfzeK/KA69ympuq/ZNu7TwDte8AdNDltX8FmjPi5AF ymBOiAvqBZo7lCiN7fCU/Sgf1x6N4fZesbAfogciEYqHzEKm4WDZ15jGscT2/waFYcNCkf IS6T9ZhbnSAmYJZ2Kj0WpJEPE16KE8K4fXT2PW8DbFe6cP0teRbzxXix/eHBLBF9fzHOd0 CHFw/dJW6zCHSB7hFFA7OV1210CCjPTwGEdhymYsV6TDnPKEcFR3jy5bo7UIBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693060260; a=rsa-sha256; cv=none; b=xUDMkJkYODf+RGoWVbIJqkf3FqSrtvTE8yo5rLJVR9mrwtnMpx64nwaP6nNp2Q+2YVOLs8 TLkmH7qUHz16bYzpqFJHz+NmZ719DBO6SEhR/+AvhIG9G+CCajr0WI+ntqo5SRpeUXZ2PJ nlWTMnytW1JMT63eN3htBGYwxZvRBk4/mziYRpkcWwHDZoxwf725IjTnnpJM/0+90SK4Yc jrerBkLGnNtCPj21ltG0/l4nkvUCVVqqSQ4LGQPlF+G0uh1QtXki5m44NfabTKXsaFOsKZ QZXebyVnXjIGLEE4x/+97u/cbChKFDM1UNkCPRE+nLdbQqAr43iyqTqMbpOwNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RXzl84d0DzdQr; Sat, 26 Aug 2023 14:31:00 +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 37QEV0er090382; Sat, 26 Aug 2023 14:31:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37QEV0UF090379; Sat, 26 Aug 2023 14:31:00 GMT (envelope-from git) Date: Sat, 26 Aug 2023 14:31:00 GMT Message-Id: <202308261431.37QEV0UF090379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Rabson Subject: git: b5c4616582ce - main - 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dfr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5c4616582cebdcf4dee909a3c2f5b113c4ae59e Auto-Submitted: auto-generated The branch main has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=b5c4616582cebdcf4dee909a3c2f5b113c4ae59e commit b5c4616582cebdcf4dee909a3c2f5b113c4ae59e Author: Doug Rabson AuthorDate: 2023-08-26 09:32:32 +0000 Commit: Doug Rabson CommitDate: 2023-08-26 11:08:37 +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 --- 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 6acff89189f5..4b2954d5bea1 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -360,7 +360,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;