RFC mkfs: sanitise input parameters
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest15 patches 26 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | xfsprogs: use common code for multi-disk detectioninclude/ include/ mkfs/ +3 more | +171 | 2 replies | |
| 2/15 | mkfs: sanitise ftype parameter values.mkfs/ | +4 | 1 reply | |
| 3/15 | mkfs: Sanitise the superblock feature macrosinclude/ mkfs/ | +146 | 2 replies | |
| 4/15 | mkfs: validate all input valuesinclude/ man/ mkfs/ +1 more | +153 | 5 replies | |
| 5/15 | mkfs: factor boolean option parsingmkfs/ | +42 | 2 replies | |
| 6/15 | mkfs: validate logarithmic parameters sanelymkfs/ | +51 | 3 replies | |
| 7/15 | mkfs: structify input parameter passingmkfs/ | +392 | 2 replies | |
| 8/15 | mkfs: getbool is redundantmkfs/ | +106 | 1 reply | |
| 9/15 | mkfs: use getnum_checked for all ranged parametersinclude/ mkfs/ | +81 | 1 reply | |
| 10/15 | mkfs: add respecification detection to generic parsingmkfs/ | +17 | 1 reply | |
| 11/15 | mkfs: table based parsing for converted parametersmkfs/ | +68 | 1 reply | |
| 12/15 | mkfs: merge getnuminclude/ mkfs/ mkfs/ | +113 | 2 replies | |
| 13/15 | mkfs: encode conflicts into parsing tablemkfs/ | +123 | 1 reply | |
| 14/15 | mkfs: add string options to generic parsingmkfs/ | +71 | 0 replies | |
| 15/15 | mkfs: don't treat files as though they are block deviceslibxfs/ mkfs/ | +126 | 2 replies |
Reviews trailers per patch
10 of 15 patches have a Reviewed-by or Acked-by.
| Patch | Christoph Hellwig |
|---|---|
| 1/15 | |
| 2/15 | R-b |
| 3/15 | R-b |
| 4/15 | |
| 5/15 | R-b |
| 6/15 | R-b |
| 7/15 | R-b |
| 8/15 | R-b |
| 9/15 | R-b |
| 10/15 | R-b |
| 11/15 | R-b |
| 12/15 | |
| 13/15 | R-b |
| 14/15 | |
| 15/15 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC, PATCH 00/15] mkfs: sanitise input parameters
Hi folks,
This is still a work in progress, but is compelte enough to get feedback on the general structure. The problem being solved here is that mkfs does a terrible job of input validation from the command line, has huge amounts of repeated code in the sub options processing loops and has many, many unnecessary variable for tracking simply things like whether a parameter was specified.
This patchset introduces a parameter table structure that is used to define the parameters and their constraints. Things like minimum and maximum valid values, default values, conflicting options, etc are all contained within the table, so all the "policy" is found in a single place.
This greatly reduces the complexity of the option parsing loop. It doesn't remove all the complexity (yet) because many of the options have special cases or more complex conflicts than I've yet added support for. The idea is, however, that all of the sub-option parameter setup will eventually end up being implemented as a generic loop as the parameter structure will hold all the information about in the input parameters.
To get there, the parameter table still needs more work - it needs to hold the value/string for the parameter, and we need to reference those in the code.
The flow on effect of this is that we can remove the many, many individual variables and start passing the option structures to functions rather than avoiding using functions because passing so many variables is messy and nasty. IOWs, it lays the groundwork for factoring xfs_mkfs.c into something more than a bunch of spagetti...
Anyway, have a look and see what you think about progress so far.
FWIW, the first patch is following up on the multi-disk discussion Christoph and I had, and the last patch in the series covers all the issues that arose with "-d file" and treating files like block devices....
Cheers,
Dave.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs