[sheepdog] [PATCH v4 UPDATE] sheep: introduce journal file to boost IO performance

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Nov 13 10:37:50 CET 2012


At Tue, 13 Nov 2012 17:27:34 +0800,
Liu Yuan wrote:
> 
> +
> +static bool journal_descriptor_valid(struct journal_descriptor *jd)
> +{
> +	if (jd->magic != JOURNAL_DESC_MAGIC)
> +		return false;
> +	if (jd->size > SD_INODE_SIZE)
> +		return false;
> +	if (jd->offset > SD_INODE_SIZE)
> +		return false;
> +	if (jd->create > 1)
> +		return false;
> +	return true;
> +}

I wonder if we need to check all fields.  Checking only jd->magic is
not enough?

Thanks,

Kazutaka



More information about the sheepdog mailing list