Re: [PATCH v2 4/7] xfs: do the assert for all the log done items in xfs_trans_cancel

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

 




On 2020/9/19 14:27, Christoph Hellwig wrote:
> On Thu, Sep 17, 2020 at 07:38:45PM +0800, xiakaixu1987@xxxxxxxxx wrote:
>> From: Kaixu Xia <kaixuxia@xxxxxxxxxxx>
>>
>> We should do the assert for all the log intent-done items if they appear
>> here. This patch detect intent-done items by the fact that their item ops
>> don't have iop_unpin and iop_push methods.
>>
>> Signed-off-by: Kaixu Xia <kaixuxia@xxxxxxxxxxx>
>> ---
>>  fs/xfs/xfs_trans.c | 9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
>> index ca18a040336a..0d5d5a53fa5a 100644
>> --- a/fs/xfs/xfs_trans.c
>> +++ b/fs/xfs/xfs_trans.c
>> @@ -925,6 +925,13 @@ xfs_trans_commit(
>>  	return __xfs_trans_commit(tp, false);
>>  }
>>  
>> +/* Is this a log intent-done item? */
>> +static inline bool xlog_item_is_intent_done(struct xfs_log_item *lip)
>> +{
>> +	return lip->li_ops->iop_unpin == NULL &&
>> +	       lip->li_ops->iop_push == NULL;
>> +}
> 
> I think this helper should go into xfs_trans.h, next to the
> xfs_log_item log item definition.  And xlog_item_is_intent should
> be moved there as well.
> 
Yeah,make more sense, will move them to xfs_trans.h in the next version.

Thanks,
Kaixu

> Otherwise looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> 

-- 
kaixuxia



[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