[Bug 260921] /bin/df: make -l and -t nonexclusive

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 04 Jan 2022 13:12:49 UTC

Stefan Eßer <se@FreeBSD.org> changed:

           What    |Removed                     |Added
           Assignee|bugs@FreeBSD.org            |se@FreeBSD.org
             Status|New                         |Open
                 CC|                            |se@FreeBSD.org

--- Comment #1 from Stefan Eßer <se@FreeBSD.org> ---
Created attachment 230685
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=230685&action=edit
Allow -l and -t to be used together

The attached patch allows -l and -t to both be specified.

It is tested to work, but maybe the desired semantics need to be better

The patch makes -l and additional and independent condition that can be applied
to the list generated by -t <type,...>.

An alternative concept would be to allow for multiple -t options and to make
each operate on the list of file systems selected at this point.

The traditional behavior of e.g. "df -t notmpfs,noufs" would be to list all
file systems, since a set union is performed for each parameters of -t (i.e.
all file systems that are not tmpfs are added to the list, then all that are
not ufs ...).

With multiple -t options allowed, -l could just be equivalent to the list of
all local file systems specified with -l. In that case, a later "noufs" could
delete file systems from the list (and a -l would delete all currently in the
list that are not local).

But that would be a much more complex change and not that useful since it is
not expected to work by currently existing scripts.

You are receiving this mail because:
You are the assignee for the bug.