]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: check folio mapping after unlock in put_file_data()
authorBoris Burkov <boris@bur.io>
Fri, 13 Dec 2024 20:33:22 +0000 (12:33 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Dec 2024 21:00:07 +0000 (22:00 +0100)
commit0fba7be1ca6df2881e68386e5575fe096f33c4ca
treef63d2445e8d35420b056a8b4e4116b2098adcf8f
parent3e74859ee35edc33a022c3f3971df066ea0ca6b9
btrfs: check folio mapping after unlock in put_file_data()

When we call btrfs_read_folio() we get an unlocked folio, so it is possible
for a different thread to concurrently modify folio->mapping. We must
check that this hasn't happened once we do have the lock.

CC: stable@vger.kernel.org # 6.12+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Boris Burkov <boris@bur.io>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c