]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm-crypt: don't update io->sector after kcryptd_crypt_write_io_submit()
authorHou Tao <houtao1@huawei.com>
Mon, 20 Jan 2025 08:29:49 +0000 (16:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:28 +0000 (12:50 +0100)
commit84d6db1a7327b808220308dd866ffd94efd13420
tree0af1c1b39d66fda4d318d00afa4bf5d9566c3c72
parent453a0a22ceb858a1eacc047e293cffd2789c9c48
dm-crypt: don't update io->sector after kcryptd_crypt_write_io_submit()

commit 9fdbbdbbc92b1474a87b89f8b964892a63734492 upstream.

The updates of io->sector are the leftovers when dm-crypt allocated
pages for partial write request. However, since commit cf2f1abfbd0db
("dm crypt: don't allocate pages for a partial request"), there is no
partial request anymore.

After the introduction of write request rb-tree, the updates of
io->sectors may interfere the insertion procedure, because ->sectors of
these write requests which have already been added in the rb-tree may be
changed during the insertion of new write request.

Fix it by removing these buggy updates of io->sectors. Considering these
updates only effect the write request rb-tree, the commit which
introduces the write request rb-tree is used as the fix tag.

Fixes: b3c5fd305249 ("dm crypt: sort writes")
Cc: stable@vger.kernel.org
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-crypt.c