Re: [PATCH v4 2/4] mkfs: add -P flag to populate a filesystem from a directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 23, 2025 at 10:22:44AM +0200, Luca Di Maio wrote:
>  					long_options, &option_index)) != EOF) {
>  		switch (c) {
>  		case 0:
> @@ -5136,6 +5138,11 @@ main(
>  				illegal(optarg, "L");
>  			cfg.label = optarg;
>  			break;
> +		case 'P':
> +			if (strlen(optarg) > sizeof(sbp->sb_fname))

This check looks weird.  sb_fname is a 12-byte legacy file system name
in the superblock that is rarely used and looks unrelated to this new
feature.

> +	if (cli.protofile && cli.directory) {
> +		fprintf(stderr, "%s: error: specifying both -P and -p is not supported.\n", progname);
> +		exit(1);

The usual XFS style is to keep very long log message on a line od their
own.  Also this needs to use the _() macro so that the string is
included in the localization database:

		fprintf(stderr,
	_("%s: error: specifying both -P and -p is not supported.\n"),
			progname);

> +	if (!cli.directory)
> +		parse_proto(mp, &cli.fsx, &protostring, cli.proto_slashes_are_spaces);
> +	else
> +		populate_from_dir(mp, NULL, &cli.fsx, cli.directory);

Please keep the line length to 80 characters in the source code.

populate_from_dir is not added in this patch, did you forget to add
newly added source files to the git repository?  If so they are also
missing from the makefile.




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux