Page MenuHomeFreeBSD

Fix getfsstat(2) handling of flags.
ClosedPublic

Authored by trasz on Oct 28 2016, 1:34 PM.
Tags
None
Referenced Files
F79496118: D8373.id21763.diff
Tue, Mar 19, 5:01 AM
Unknown Object (File)
Fri, Mar 8, 2:07 AM
Unknown Object (File)
Fri, Mar 8, 1:05 AM
Unknown Object (File)
Jan 25 2024, 5:14 AM
Unknown Object (File)
Jan 12 2024, 10:31 PM
Unknown Object (File)
Jan 11 2024, 4:30 AM
Unknown Object (File)
Dec 14 2023, 12:48 AM
Unknown Object (File)
Dec 13 2023, 10:39 PM
Subscribers

Details

Summary

Fix getfsstat(2) handling of flags. The 'flags' argument is an enum,
not a bitfield. For the intended usage - being passed either MNT_WAIT,
or MNT_NOWAIT - this shouldn't introduce any changes in behaviour.

Diff Detail

Event Timeline

trasz retitled this revision from to Fix getfsstat(2) handling of flags..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)
jhb added a reviewer: jhb.
jhb added a subscriber: jhb.

As some followups:

  1. We should probably validate 'flags' and fail with EINVAL for bad values.
  2. We should rename 'flags' to 'flag' to note it is an enum and not a mask of values. Along with this, libsysdecode/kdump should be fixed to treat it as an enum rather than a mask.
This revision is now accepted and ready to land.Oct 28 2016, 6:39 PM

Indeed, the command should be checked. I think I already asked this question in the discussion elsewhere, are there wrong callers of the fstatfs(2) ? It would be more natural to check flags == MNT_WAIT there, but feasibility of the change depends on the existing apps.

This revision was automatically updated to reflect the committed changes.

I agree about the 'flag' thing, and being more strict about validating it. Still, I'd prefer to do it separately, to make merging easier. Yes, I did review the callers in the tree; I didn't look at the ports, though.