mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
jbd2: correctly compare tids with tid_geq function in jbd2_fc_begin_commit
Use tid_geq to compare tids to work over sequence number wraps. Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Cc: stable@kernel.org Link: https://patch.msgid.link/20240801013815.2393869-2-shikemeng@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
01cdf03b13
commit
f0e3c14802
@ -710,7 +710,7 @@ int jbd2_fc_begin_commit(journal_t *journal, tid_t tid)
|
||||
return -EINVAL;
|
||||
|
||||
write_lock(&journal->j_state_lock);
|
||||
if (tid <= journal->j_commit_sequence) {
|
||||
if (tid_geq(journal->j_commit_sequence, tid)) {
|
||||
write_unlock(&journal->j_state_lock);
|
||||
return -EALREADY;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user