Re: [PATCH V2] xfs: enhance dinode verifier

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

 



On 4/12/18 10:56 PM, Darrick J. Wong wrote:
> On Thu, Apr 12, 2018 at 09:55:41PM -0500, Eric Sandeen wrote:
>> Add several more validations to xfs_dinode_verify:
...

>> @@ -476,12 +478,25 @@ xfs_dinode_verify(
>>  	if (XFS_DFORK_Q(dip)) {
>>  		switch (dip->di_aformat) {
>>  		case XFS_DINODE_FMT_LOCAL:
>> +			if (dip->di_anextents)
>> +				return __this_address;
>> +		/* fall through */
>>  		case XFS_DINODE_FMT_EXTENTS:
>>  		case XFS_DINODE_FMT_BTREE:
>>  			break;
>>  		default:
>>  			return __this_address;
>>  		}
>> +	} else {	/* No attr fork */
>> +		switch (dip->di_aformat) {
>> +		case 0:	/* Uninitialized OK */
> 
> Might be a good idea to point out that a newly allocated inode chunk
> will have all these fields set to zero

Well, that was the intent of my terse comment...  I can write a longer
one, clearly it did not do the trick?

-Eric

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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