Re: [PATCH 3/7] xfs: filter out obviously bad btree pointers

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

 



On 1/31/17 2:09 PM, Darrick J. Wong wrote:
>>> diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
>>> index 21e6a6a..2849d3f 100644
>>> --- a/fs/xfs/libxfs/xfs_btree.c
>>> +++ b/fs/xfs/libxfs/xfs_btree.c
>>> @@ -810,7 +810,8 @@ xfs_btree_read_bufl(
>>>  	xfs_daddr_t		d;		/* real disk block address */
>>>  	int			error;
>>>  
>>> -	ASSERT(fsbno != NULLFSBLOCK);
>>> +	if (!XFS_FSB_SANITY_CHECK(mp, fsbno))
>>> +		return -EFSCORRUPTED;
>> This does away with the NULLFSBLOCK checks though, right?
>>
>> #define NULLFSBLOCK     ((xfs_fsblock_t)-1)
>>
>> which is also used as an in-memory condition, so I'm not sure
>> it should be added to XFS_FSB_SANITY_CHECK.
> [reiterating our irc conversation]
> 
> It shouldn't, since XFS_FSB_TO_AGNO(mp, NULLFSBLOCK) ought to produce
> NULLAGNUMBER, which will still fail the check.

Oh, sure.  sorry for missing that.

Looks ok after all.  :)

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

>> IOWs some asserts about it are really code flow asserts, though
>> it also shouldn't be read from disk.
> xfs_btree_read_bufl is called by xfs_bmap_check_leaf_extents, which is
> the verifier of the on-disk data.
> 
> --D
> 
--
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