Page MenuHomeFreeBSD

Fix getfsstat(2) handling of flags.
ClosedPublic

Authored by trasz on Oct 28 2016, 1:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 6:51 AM
Unknown Object (File)
Oct 5 2024, 11:37 PM
Unknown Object (File)
Sep 21 2024, 3:48 PM
Unknown Object (File)
Sep 11 2024, 12:23 AM
Unknown Object (File)
Aug 27 2024, 7:01 AM
Unknown Object (File)
Aug 18 2024, 9:37 AM
Unknown Object (File)
Aug 13 2024, 3:35 AM
Unknown Object (File)
Aug 5 2024, 10:37 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.