mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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)
This commit is contained in:
parent
fc04560978
commit
a1e55af8d1
3 changed files with 3 additions and 3 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue