[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211019085319.GA3255@quack2.suse.cz>
Date: Tue, 19 Oct 2021 10:53:19 +0200
From: Jan Kara <jack@...e.cz>
To: Ye Bin <yebin10@...wei.com>
Cc: tytso@....edu, adilger.kernel@...ger.ca,
linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org,
jack@...e.cz
Subject: Re: [PATCH -next v3 1/5] ext4: init 'seq' with the value which set
in 'ext4_multi_mount_protect'
On Tue 19-10-21 14:49:55, Ye Bin wrote:
> If two host have the same nodename, and seq start from 0, May cause the
> detection mechanism to fail.
> So init 'seq' with the value which set in 'ext4_multi_mount_protect' to
> accelerate conflict detection.
>
> Signed-off-by: Ye Bin <yebin10@...wei.com>
...
> @@ -143,6 +143,7 @@ static int kmmpd(void *data)
> mmp_block = le64_to_cpu(es->s_mmp_block);
> mmp = (struct mmp_struct *)(bh->b_data);
> mmp->mmp_time = cpu_to_le64(ktime_get_real_seconds());
> + seq = le32_to_cpu(mmp->mmp_seq);
> /*
> * Start with the higher mmp_check_interval and reduce it if
> * the MMP block is being updated on time.
Thanks for the patch. After discussing what MMP guards against and what it
does not protect, I don't think this change is actually needed. Under
normal conditions we expect kmmpd() to only write to MMP block, checking of
MMP block is done only in ext4_multi_mount_protect(). And for checking
there to trigger, using 'seq' starting from 1 in kmmpd is enough...
Honza
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists