kernel-fxtec-pro1x/fs/btrfs
Omar Sandoval 6ec047a0b8 btrfs: use correct count in btrfs_file_write_iter()
[ Upstream commit c09767a8960ca0500fb636bf73686723337debf4 ]

generic_write_checks() may modify iov_iter_count(), so we must get the
count after the call, not before. Using the wrong one has a couple of
consequences:

1. We check a longer range in check_can_nocow() for nowait than we're
   actually writing.
2. We create extra hole extent maps in btrfs_cont_expand(). As far as I
   can tell, this is harmless, but I might be missing something.

These issues are pretty minor, but let's fix it before something more
important trips on it.

Fixes: edf064e7c6 ("btrfs: nowait aio support")
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-27 14:51:12 +01:00
..
tests btrfs: return error pointer from alloc_test_extent_buffer 2019-12-31 16:36:20 +01:00
acl.c
async-thread.c btrfs: don't prematurely free work in run_ordered_work() 2019-12-31 16:36:05 +01:00
async-thread.h
backref.c Btrfs: fix deadlock between fiemap and transaction commits 2019-08-25 10:47:54 +02:00
backref.h
btrfs_inode.h
check-integrity.c
check-integrity.h
compression.c btrfs: correctly validate compression type 2019-09-16 08:22:19 +02:00
compression.h btrfs: correctly validate compression type 2019-09-16 08:22:19 +02:00
ctree.c Btrfs: fix removal logic of the tree mod log that leads to use-after-free issues 2019-12-31 16:34:44 +01:00
ctree.h Btrfs: fix missing data checksums after replaying a log tree 2019-12-31 16:34:42 +01:00
dedupe.h
delayed-inode.c btrfs: use refcount_inc_not_zero in kill_all_nodes 2019-12-17 20:34:46 +01:00
delayed-inode.h
delayed-ref.c btrfs: only track ref_heads in delayed_ref_updates 2019-12-05 09:20:23 +01:00
delayed-ref.h
dev-replace.c btrfs: dev-replace: set result code of cancel by status of scrub 2019-12-05 09:20:21 +01:00
dev-replace.h
dir-item.c
disk-io.c btrfs: don't prematurely free work in end_workqueue_fn() 2019-12-31 16:36:04 +01:00
disk-io.h
export.c
export.h
extent-tree.c Btrfs: fix missing data checksums after replaying a log tree 2019-12-31 16:34:42 +01:00
extent_io.c btrfs: return error pointer from alloc_test_extent_buffer 2019-12-31 16:36:20 +01: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
extent_map.h
file-item.c Btrfs: fix missing data checksums after replaying a log tree 2019-12-31 16:34:42 +01:00
file.c btrfs: use correct count in btrfs_file_write_iter() 2020-01-27 14:51:12 +01: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 invalid removal of root ref 2020-01-23 08:21:31 +01:00
ioctl.c btrfs: abort transaction after failed inode updates in create_subvol 2019-12-31 16:34:43 +01:00
Kconfig
locking.c
locking.h
lzo.c
Makefile
math.h
ordered-data.c
ordered-data.h
orphan.c
print-tree.c
print-tree.h
props.c btrfs: correctly validate compression type 2019-09-16 08:22:19 +02:00
props.h
qgroup.c btrfs: fix memory leak in qgroup accounting 2020-01-23 08:21:31 +01: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: fix uninitialized ret in ref-verify 2019-10-17 13:45:27 -07:00
ref-verify.h
relocation.c btrfs: do not leak reloc root if we fail to read the fs root 2019-12-31 16:34:43 +01:00
root-tree.c btrfs: do not delete mismatched root refs 2020-01-23 08:21:31 +01:00
scrub.c btrfs: don't prematurely free work in scrub_missing_raid56_worker() 2019-12-31 16:36:16 +01:00
send.c btrfs: send: remove WARN_ON for readonly mount 2019-12-31 16:34:42 +01:00
send.h
struct-funcs.c
super.c btrfs: avoid link error with CONFIG_NO_AUTO_INLINE 2019-12-01 09:17:19 +01:00
sysfs.c btrfs: sysfs: don't leak memory when failing add fsid 2019-05-31 06:46:02 -07:00
sysfs.h
transaction.c Btrfs: fix deadlock between fiemap and transaction commits 2019-08-25 10:47:54 +02:00
transaction.h Btrfs: fix deadlock between fiemap and transaction commits 2019-08-25 10:47:54 +02:00
tree-checker.c
tree-checker.h
tree-defrag.c
tree-log.c btrfs: skip log replay on orphaned roots 2019-12-31 16:34:43 +01: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: fix ncopies raid_attr for RAID56 2019-12-05 09:20:21 +01:00
volumes.h btrfs: Remove btrfs_bio::flags member 2019-12-17 20:34:48 +01:00
xattr.c
xattr.h
zlib.c
zstd.c