From: "wangjianjian (C)" <wangjianjian3@huawei.com>
To: Luis Henriques <luis.henriques@linux.dev>,
Andreas Dilger <adilger@dilger.ca>
Cc: Wang Jianjian <wangjianjian0@foxmail.com>,
Theodore Ts'o <tytso@mit.edu>, Jan Kara <jack@suse.cz>,
Harshad Shirwadkar <harshadshirwadkar@gmail.com>,
<linux-ext4@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] jbd2: make '0' an invalid transaction sequence
Date: Fri, 12 Jul 2024 18:28:26 +0800 [thread overview]
Message-ID: <2c8ba685-403e-4694-81ad-751c40895fa4@huawei.com> (raw)
In-Reply-To: <20b9015d-80ed-4864-811a-ff4b0e3774dd@huawei.com>
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@dilger.ca>
>> Signed-off-by: Luis Henriques (SUSE) <luis.henriques@linux.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
next prev parent reply other threads:[~2024-07-12 10:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-11 8:35 [PATCH v4] ext4: fix fast commit inode enqueueing during a full journal commit Luis Henriques (SUSE)
2024-07-11 13:32 ` wangjianjian (C)
2024-07-11 15:16 ` Luis Henriques
2024-07-11 16:16 ` Wang Jianjian
2024-07-11 19:28 ` Andreas Dilger
2024-07-12 0:51 ` wangjianjian (C)
2024-07-12 9:15 ` Luis Henriques
2024-07-12 9:53 ` [RFC PATCH] jbd2: make '0' an invalid transaction sequence Luis Henriques
2024-07-12 10:04 ` wangjianjian (C)
2024-07-12 10:28 ` wangjianjian (C) [this message]
2024-07-16 9:52 ` Jan Kara
2024-07-16 13:11 ` Luis Henriques
2024-07-16 10:24 ` [PATCH v4] ext4: fix fast commit inode enqueueing during a full journal commit Jan Kara
2024-07-16 14:13 ` Luis Henriques
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c8ba685-403e-4694-81ad-751c40895fa4@huawei.com \
--to=wangjianjian3@huawei.com \
--cc=adilger@dilger.ca \
--cc=harshadshirwadkar@gmail.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luis.henriques@linux.dev \
--cc=tytso@mit.edu \
--cc=wangjianjian0@foxmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®