[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c8ba685-403e-4694-81ad-751c40895fa4@huawei.com>
Date: Fri, 12 Jul 2024 18:28:26 +0800
From: "wangjianjian (C)" <wangjianjian3@...wei.com>
To: Luis Henriques <luis.henriques@...ux.dev>, Andreas Dilger
<adilger@...ger.ca>
CC: Wang Jianjian <wangjianjian0@...mail.com>, Theodore Ts'o <tytso@....edu>,
Jan Kara <jack@...e.cz>, Harshad Shirwadkar <harshadshirwadkar@...il.com>,
<linux-ext4@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] jbd2: make '0' an invalid transaction sequence
On 2024/7/12 18:04, wangjianjian (C) wrote:
> On 2024/7/12 17:53, Luis Henriques wrote:
>> Since there's code (in fast-commit) that already handles a '0' tid as a
>> special case, it's better to ensure that jbd2 never sets it to that value
>> when journal->j_transaction_sequence increment wraps.
>>
>> Suggested-by: Andreas Dilger <adilger@...ger.ca>
>> Signed-off-by: Luis Henriques (SUSE) <luis.henriques@...ux.dev>
>> ---
>> fs/jbd2/transaction.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
>> index 66513c18ca29..4dbdd37349c3 100644
>> --- a/fs/jbd2/transaction.c
>> +++ b/fs/jbd2/transaction.c
>> @@ -84,6 +84,8 @@ static void jbd2_get_transaction(journal_t *journal,
>> transaction->t_state = T_RUNNING;
>> transaction->t_start_time = ktime_get();
>> transaction->t_tid = journal->j_transaction_sequence++;
>> + if (unlikely(transaction->t_tid == 0))
>> + transaction->t_tid = journal->j_transaction_sequence++;
> Do we need add j_transaction_sequence again here? if tansanction->t_tid
> == 0, then journal->j_trnasaction_sequence must be 1
still need add 1. Sorry for confuse.
>
>> transaction->t_expires = jiffies + journal->j_commit_interval;
>> atomic_set(&transaction->t_updates, 0);
>> atomic_set(&transaction->t_outstanding_credits,
--
Regards
Powered by blists - more mailing lists