linux/fs/btrfs
Filipe Manana 789555b22b btrfs: fix wrong file range cleanup after an error filling dealloc range
[ Upstream commit e2c8e92d11 ]

If an error happens while running dellaloc in COW mode for a range, we can
end up calling extent_clear_unlock_delalloc() for a range that goes beyond
our range's end offset by 1 byte, which affects 1 extra page. This results
in clearing bits and doing page operations (such as a page unlock) outside
our target range.

Fix that by calling extent_clear_unlock_delalloc() with an inclusive end
offset, instead of an exclusive end offset, at cow_file_range().

Fixes: a315e68f6e ("Btrfs: fix invalid attempt to free reserved space on failure to cow range")
CC: stable@vger.kernel.org # 4.14+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-22 09:05:26 +02:00
..
tests Btrfs: fix race between adding and putting tree mod seq elements and nodes 2020-02-11 04:34:06 -08:00
acl.c
async-thread.c Btrfs: fix crash during unmount due to race with delayed inode workers 2020-04-17 10:48:49 +02:00
async-thread.h Btrfs: fix crash during unmount due to race with delayed inode workers 2020-04-17 10:48:49 +02:00
backref.c
backref.h
btrfs_inode.h
check-integrity.c btrfs: fix possible NULL-pointer dereference in integrity checks 2020-02-24 08:34:49 +01:00
check-integrity.h
compression.c
compression.h
ctree.c Btrfs: fix race between adding and putting tree mod seq elements and nodes 2020-02-11 04:34:06 -08:00
ctree.h Btrfs: fix race between adding and putting tree mod seq elements and nodes 2020-02-11 04:34:06 -08:00
dedupe.h
delayed-inode.c btrfs: use nofs allocations for running delayed items 2020-04-17 10:48:54 +02:00
delayed-inode.h
delayed-ref.c Btrfs: fix race between adding and putting tree mod seq elements and nodes 2020-02-11 04:34:06 -08:00
delayed-ref.h
dev-replace.c btrfs: merge btrfs_find_device and find_device 2020-06-22 09:04:59 +02:00
dev-replace.h
dir-item.c
disk-io.c btrfs: Detect unbalanced tree with empty leaf before crashing btree operations 2020-06-22 09:04:59 +02:00
disk-io.h
export.c
export.h
extent_io.c btrfs: flush write bio if we loop in extent_write_cache_pages 2020-02-11 04:34:16 -08:00
extent_io.h Btrfs: allow clear_extent_dirty() to receive a cached extent state record 2019-12-05 09:20:22 +01:00
extent_map.c Btrfs: fix race between using extent maps and merging them 2020-02-19 19:51:56 +01:00
extent_map.h
extent-tree.c btrfs: fix block group leak when removing fails 2020-05-06 08:13:27 +02:00
file-item.c btrfs: do not ignore error from btrfs_next_leaf() when inserting checksums 2020-06-22 09:05:11 +02:00
file.c btrfs: fix missing semaphore unlock in btrfs_sync_file 2020-04-17 10:48:49 +02:00
free-space-cache.c btrfs: check page->mapping when loading free space cache 2019-12-17 20:34:45 +01:00
free-space-cache.h
free-space-tree.c
free-space-tree.h
inode-item.c
inode-map.c Btrfs: fix inode cache waiters hanging on path allocation failure 2020-01-27 14:51:12 +01:00
inode-map.h
inode.c btrfs: fix wrong file range cleanup after an error filling dealloc range 2020-06-22 09:05:26 +02:00
ioctl.c btrfs: merge btrfs_find_device and find_device 2020-06-22 09:04:59 +02:00
Kconfig
locking.c
locking.h
lzo.c
Makefile
math.h
ordered-data.c Btrfs: fix btrfs_wait_ordered_range() so that it waits for all ordered extents 2020-02-28 16:38:58 +01:00
ordered-data.h
orphan.c
print-tree.c
print-tree.h
props.c
props.h
qgroup.c btrfs: qgroup: mark qgroup inconsistent if we're inherting snapshot to a new qgroup 2020-06-22 09:05:19 +02:00
qgroup.h
raid56.c
raid56.h
rcu-string.h
reada.c btrfs: don't prematurely free work in reada_start_machine_worker() 2019-12-31 16:36:16 +01:00
ref-verify.c btrfs: ref-verify: fix memory leaks 2020-02-19 19:51:56 +01:00
ref-verify.h
relocation.c btrfs: check commit root generation in should_ignore_root 2020-04-21 09:03:09 +02:00
root-tree.c btrfs: do not delete mismatched root refs 2020-01-23 08:21:31 +01:00
scrub.c btrfs: merge btrfs_find_device and find_device 2020-06-22 09:04:59 +02:00
send.c btrfs: send: emit file capabilities after chown 2020-06-22 09:05:21 +02:00
send.h
struct-funcs.c
super.c btrfs: log message when rw remount is attempted with unclean tree-log 2020-02-19 19:51:56 +01:00
sysfs.c
sysfs.h
transaction.c btrfs: transaction: Avoid deadlock due to bad initialization timing of fs_info::journal_info 2020-05-06 08:13:33 +02:00
transaction.h
tree-checker.c btrfs: tree-checker: Check level for leaves and nodes 2020-06-22 09:05:01 +02:00
tree-checker.h
tree-defrag.c
tree-log.c btrfs: fix partial loss of prealloc extent past i_size after fsync 2020-05-06 08:13:33 +02:00
tree-log.h
ulist.c
ulist.h
uuid-tree.c btrfs: handle ENOENT in btrfs_uuid_tree_iterate 2019-12-31 16:34:44 +01:00
volumes.c btrfs: include non-missing as a qualifier for the latest_bdev 2020-06-22 09:05:21 +02:00
volumes.h btrfs: merge btrfs_find_device and find_device 2020-06-22 09:04:59 +02:00
xattr.c
xattr.h
zlib.c
zstd.c