public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/17] mkfs: sanitise input parameters
@ 2015-06-19 11:01 Jan Ťulák
  2015-06-19 11:01 ` [PATCH 01/17] xfsprogs: use common code for multi-disk detection Jan Ťulák
                   ` (16 more replies)
  0 siblings, 17 replies; 51+ messages in thread
From: Jan Ťulák @ 2015-06-19 11:01 UTC (permalink / raw)
  To: xfs

Hi all,

I picked up this patch set Dave Chinner wrote back in 2013 to clean
mkfs a bit. It is just part of what I want to do, and still work in progress.
I updated it to the current codebase (for-next branch) and fixed issues
the original set was causing - currently, this set goes through
./check -n quick with the same result, as clean for-next branch.

Two changes against the original set are left in separate patches:
"mkfs: move spinodes crc check" is just a small cosmetic thing that doesn't
fit into the existing patches, but "mkfs fix: handling of files" is a fix
for the last patch from Dave about files. I put this fix standalone for now
to make sure the changes in it are reviewed. As I'm learning about xfs,
I could misunderstood something. :-)

Bellow is the original message from Dave:

> 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.

Cheers,
Jan

Dave Chinner (15):
  xfsprogs: use common code for multi-disk detection
  mkfs: sanitise ftype parameter values.
  mkfs: Sanitise the superblock feature macros
  mkfs: validate all input values
  mkfs: factor boolean option parsing
  mkfs: validate logarithmic parameters sanely
  mkfs: structify input parameter passing
  mkfs: getbool is redundant
  mkfs: use getnum_checked for all ranged parameters
  mkfs: add respecification detection to generic parsing
  mkfs: table based parsing for converted parameters
  mkfs: merge getnum
  mkfs: encode conflicts into parsing table
  mkfs: add string options to generic parsing
  mkfs: don't treat files as though they are block devices

Jan Ťulák (2):
  mkfs fix: handling of files
  mkfs: move spinodes crc check

 include/Makefile    |    8 +-
 include/xfs_mkfs.h  |   73 ++
 libxfs/init.c       |    7 +
 libxfs/linux.c      |   11 +-
 man/man8/mkfs.xfs.8 |   26 +-
 mkfs/Makefile       |    2 +-
 mkfs/proto.c        |   56 +-
 mkfs/xfs_mkfs.c     | 1873 ++++++++++++++++++++++++++++++---------------------
 mkfs/xfs_mkfs.h     |   89 ---
 repair/xfs_repair.c |   45 +-
 10 files changed, 1305 insertions(+), 885 deletions(-)
 create mode 100644 include/xfs_mkfs.h
 delete mode 100644 mkfs/xfs_mkfs.h

-- 
2.1.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 51+ messages in thread

end of thread, other threads:[~2015-07-09  8:24 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-19 11:01 [PATCH 00/17] mkfs: sanitise input parameters Jan Ťulák
2015-06-19 11:01 ` [PATCH 01/17] xfsprogs: use common code for multi-disk detection Jan Ťulák
2015-06-19 11:10   ` Christoph Hellwig
2015-06-19 11:51     ` Jan Tulak
2015-06-25 19:37   ` Brian Foster
2015-07-02 12:47     ` Jan Tulak
2015-07-02 14:14       ` Brian Foster
2015-07-02 23:05         ` Dave Chinner
2015-07-03 13:22           ` Brian Foster
2015-07-08 16:14           ` Jan Tulak
2015-07-09  0:45             ` Dave Chinner
2015-07-09  8:24               ` Jan Tulak
2015-07-03 10:06         ` Jan Tulak
2015-06-19 11:01 ` [PATCH 02/17] mkfs: sanitise ftype parameter values Jan Ťulák
2015-06-25 19:37   ` Brian Foster
2015-06-19 11:01 ` [PATCH 03/17] mkfs: Sanitise the superblock feature macros Jan Ťulák
2015-06-25 19:38   ` Brian Foster
2015-07-03  9:53     ` Jan Tulak
2015-07-03 13:24       ` Brian Foster
2015-06-19 11:01 ` [PATCH 04/17] mkfs: validate all input values Jan Ťulák
2015-06-25 19:38   ` Brian Foster
2015-06-19 11:01 ` [PATCH 05/17] mkfs: factor boolean option parsing Jan Ťulák
2015-06-25 19:38   ` Brian Foster
2015-06-19 11:01 ` [PATCH 06/17] mkfs: validate logarithmic parameters sanely Jan Ťulák
2015-06-26 17:16   ` Brian Foster
2015-06-19 11:01 ` [PATCH 07/17] mkfs: structify input parameter passing Jan Ťulák
2015-06-26 17:16   ` Brian Foster
2015-06-19 11:01 ` [PATCH 08/17] mkfs: getbool is redundant Jan Ťulák
2015-06-26 17:17   ` Brian Foster
2015-06-30  1:32     ` Dave Chinner
2015-06-19 11:01 ` [PATCH 09/17] mkfs: use getnum_checked for all ranged parameters Jan Ťulák
2015-06-26 17:17   ` Brian Foster
2015-06-19 11:01 ` [PATCH 10/17] mkfs: add respecification detection to generic parsing Jan Ťulák
2015-06-26 17:17   ` Brian Foster
2015-06-19 11:02 ` [PATCH 11/17] mkfs: table based parsing for converted parameters Jan Ťulák
2015-06-26 17:17   ` Brian Foster
2015-06-19 11:02 ` [PATCH 12/17] mkfs: merge getnum Jan Ťulák
2015-06-26 17:17   ` Brian Foster
2015-06-19 11:02 ` [PATCH 13/17] mkfs: encode conflicts into parsing table Jan Ťulák
2015-06-26 17:17   ` Brian Foster
2015-06-30  3:57     ` Dave Chinner
2015-06-30 11:27       ` Brian Foster
2015-07-01  8:30         ` Jan Tulak
2015-06-19 11:02 ` [PATCH 14/17] mkfs: add string options to generic parsing Jan Ťulák
2015-06-26 19:32   ` Brian Foster
2015-06-19 11:02 ` [PATCH 15/17] mkfs: don't treat files as though they are block devices Jan Ťulák
2015-06-26 19:32   ` Brian Foster
2015-06-19 11:02 ` [PATCH 16/17] mkfs fix: handling of files Jan Ťulák
2015-06-26 19:32   ` Brian Foster
2015-06-19 11:02 ` [PATCH 17/17] mkfs: move spinodes crc check Jan Ťulák
2015-06-26 19:32   ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox