]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: release old extent maps during page release
authorFilipe Manana <fdmanana@suse.com>
Wed, 22 Jul 2020 11:28:52 +0000 (12:28 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:48 +0000 (12:55 +0200)
commitce0ffcf60dfa65637f5ec24e362447a8e1004e06
tree2a0b0a7b98e485914c1e762eab854fdb3c509cd3
parentf3764d6c3384b6d8187e0fbef8b5334df60256b4
btrfs: release old extent maps during page release

When removing an extent map at try_release_extent_mapping(), called through
the page release callback (btrfs_releasepage()), we never release an extent
map that is in the list of modified extents. This is to prevent races with
a concurrent fsync using the fast path, which could lead to not logging an
extent created in the current transaction.

However we can safely remove an extent map created in a past transaction
that is still in the list of modified extents (because no one fsynced yet
the inode after that transaction got commited), because such extents are
skipped during an fsync as it is pointless to log them. This change does
that.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c