android_kernel_samsung_a7y1.../fs/btrfs
Filipe Manana c670f766aa Btrfs: fix btrfs_wait_ordered_range() so that it waits for all ordered extents
commit e75fd33b3f744f644061a4f9662bd63f5434f806 upstream.

In btrfs_wait_ordered_range() once we find an ordered extent that has
finished with an error we exit the loop and don't wait for any other
ordered extents that might be still in progress.

All the users of btrfs_wait_ordered_range() expect that there are no more
ordered extents in progress after that function returns. So past fixes
such like the ones from the two following commits:

  ff612ba7849964 ("btrfs: fix panic during relocation after ENOSPC before
                   writeback happens")

  28aeeac1dd3080 ("Btrfs: fix panic when starting bg cache writeout after
                   IO error")

don't work when there are multiple ordered extents in the range.

Fix that by making btrfs_wait_ordered_range() wait for all ordered extents
even after it finds one that had an error.

Link: https://github.com/kdave/btrfs-progs/issues/228#issuecomment-569777554
CC: stable@vger.kernel.org # 4.4+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 14:03:50 +02:00
..
tests Btrfs: fix race between adding and putting tree mod seq elements and nodes 2020-04-07 13:51:16 +02:00
acl.c
async-thread.c
async-thread.h
backref.c Btrfs: do not start a transaction at iterate_extent_inodes() 2020-04-06 18:12:40 +02:00
backref.h
btrfs_inode.h
check-integrity.c
check-integrity.h
compression.c
compression.h
ctree.c Btrfs: fix race between adding and putting tree mod seq elements and nodes 2020-04-07 13:51:16 +02:00
ctree.h Btrfs: fix race between adding and putting tree mod seq elements and nodes 2020-04-07 13:51:16 +02:00
delayed-inode.c
delayed-inode.h
delayed-ref.c Btrfs: fix race between adding and putting tree mod seq elements and nodes 2020-04-07 13:51:16 +02:00
delayed-ref.h
dev-replace.c btrfs: Ensure replaced device doesn't have pending chunk allocation 2020-04-06 19:21:08 +02:00
dev-replace.h
dir-item.c
disk-io.c btrfs: print message when tree-log replay starts 2020-04-07 13:55:27 +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-04-07 13:51:27 +02:00
extent_io.h
extent_map.c Btrfs: fix race between using extent maps and merging them 2020-04-07 13:55:14 +02:00
extent_map.h
extent-tree.c btrfs: block-group: Fix a memory leak due to missing btrfs_put_block_group() 2020-04-07 09:27:00 +02:00
extent-tree.h
file-item.c
file.c Btrfs: fix negative subv_writers counter and data space leak after buffered write 2020-04-07 13:07:47 +02:00
free-space-cache.c btrfs: check page->mapping when loading free space cache 2020-04-07 13:06:51 +02:00
free-space-cache.h
hash.c
hash.h
inode-item.c
inode-map.c Btrfs: fix hang when loading existing inode cache off disk 2020-04-07 13:43:17 +02:00
inode-map.h
inode.c btrfs: do not call synchronize_srcu() in inode_tree_del 2020-04-07 13:21:58 +02:00
ioctl.c btrfs: abort transaction after failed inode updates in create_subvol 2020-04-07 13:22:02 +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-04-07 14:03:50 +02:00
ordered-data.h
orphan.c
print-tree.c
print-tree.h
props.c
props.h
qgroup.c Btrfs: fix race setting up and completing qgroup rescan workers 2020-04-07 07:41:26 +02:00
qgroup.h
raid56.c
raid56.h
rcu-string.h
reada.c btrfs: start readahead also in seed devices 2020-04-06 19:16:44 +02:00
relocation.c btrfs: do not leak reloc root if we fail to read the fs root 2020-04-07 13:19:14 +02:00
root-tree.c
scrub.c
send.c
send.h
struct-funcs.c
super.c btrfs: log message when rw remount is attempted with unclean tree-log 2020-04-07 13:55:16 +02:00
sysfs.c btrfs: sysfs: don't leak memory when failing add fsid 2020-04-06 18:15:08 +02:00
sysfs.h
transaction.c btrfs: set trans->drity in btrfs_commit_transaction 2020-04-07 13:50:10 +02:00
transaction.h
tree-checker.c
tree-checker.h
tree-defrag.c
tree-log.c Btrfs: fix assertion failure on fsync with NO_HOLES enabled 2020-04-07 13:51:12 +02:00
tree-log.h
ulist.c
ulist.h
uuid-tree.c btrfs: handle ENOENT in btrfs_uuid_tree_iterate 2020-04-07 13:19:56 +02:00
volumes.c btrfs: fix minimum number of chunk errors for DUP 2020-04-06 20:26:57 +02:00
volumes.h btrfs: Remove btrfs_bio::flags member 2020-04-07 13:06:53 +02:00
xattr.c
xattr.h
zlib.c