[sheepdog] Preview - patch convertconfig part 1
Christoph Hellwig
hch at infradead.org
Fri Aug 10 10:25:22 CEST 2012
> +#define CONFIGFILE_SIGNATURE 0x0000aaaa00000000
Does this mean anything? :)
> +/***** remove in > v0.5.0 *****/
> +/* configfile version 2 */
> +struct sheepdog_config_2 {
> + uint64_t ctime;
> + uint64_t space;
> + uint16_t flags;
> + uint8_t copies;
> + uint8_t store[STORE_LEN];
> +};
Do we really need to keep this one around?
> +/***** remove in > v0.5.0 *****/
> +/* configfile version 1 */
A more useful comment would be what versions used it.
> + /*
> + * read and convert config
> + * new config has a version in the first 8 bytes
> + * 4 bytes version number
> + * 4 bytes fix version signature
> + */
A safer check might simply be by file size?
> + fd = open(config_path, O_RDONLY);
> + if (fd < 0)
> + {
Please try to run the checkpath.pl script over the code and fix it's
warnings.
> + /* new config file */
> + mknod(config_path, def_fmode, S_IFREG);
mknod errors should be handled.
More information about the sheepdog
mailing list