[lustre-discuss] Possible change to "lfs find -size" default units?

Peter Grandi pg at lustre.list.sabi.co.UK
Sun Nov 5 04:34:19 PST 2023


>>> On Sun, 5 Nov 2023 06:13:52 +0000, Andreas Dilger via
>>> lustre-discuss <lustre-discuss at lists.lustre.org> said:

> I've recently realized that "lfs find -size N" defaults to
> looking for files of N *bytes* by default, unlike regular
> find(1) that is assuming 512-byte blocks by default if no
> units are given. [...]

I think that compatibility with 'find' matters a lot, so I
support the proposed changes.

Also note that 'find' has a bizarre rule about rounding up to a
whole multiple of the given unit, which 'lfs find' regrettably
ought to do too if it does not already.
http://www.sabi.co.uk/blog/23-one.html?230117#230117

BTW I was about to report a problem specific to 'lfs find':

  --mirror-state ro -a --mirror-state wp -a --mirror-state sp

only tests "sp", the two previous tests for "ro" and "wp" have
no effect. This has caused me problems because I was trying to
run 'lfs resync' only on files that are "^ro" and also "^sp" and
not "^wp", and this seems impossible in a single 'lfs find'.

It looks to me as if '--mirror-state' behaves as an *option*
('find' has "options", "positional options" and "global
options") and not as a *test*. At the very least this should be
prominently documented.

This might be hinted by having "xx" and "^xx" forms, which
suggests that these two are not equivalent:

  ! --mirror state ro
  --mirror-state ^ro

which would make sense if "--mirror-state" is an option.


More information about the lustre-discuss mailing list