linux_dsm_epyc7002/fs/btrfs
Qu Wenruo aa825dbd39 Revert "btrfs: compression: don't try to compress if we don't have enough pages"
commit 4e9655763b82a91e4c341835bb504a2b1590f984 upstream.

This reverts commit f2165627319ffd33a6217275e5690b1ab5c45763.

[BUG]
It's no longer possible to create compressed inline extent after commit
f2165627319f ("btrfs: compression: don't try to compress if we don't
have enough pages").

[CAUSE]
For compression code, there are several possible reasons we have a range
that needs to be compressed while it's no more than one page.

- Compressed inline write
  The data is always smaller than one sector and the test lacks the
  condition to properly recognize a non-inline extent.

- Compressed subpage write
  For the incoming subpage compressed write support, we require page
  alignment of the delalloc range.
  And for 64K page size, we can compress just one page into smaller
  sectors.

For those reasons, the requirement for the data to be more than one page
is not correct, and is already causing regression for compressed inline
data writeback.  The idea of skipping one page to avoid wasting CPU time
could be revisited in the future.

[FIX]
Fix it by reverting the offending commit.

Reported-by: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>
Link: https://lore.kernel.org/linux-btrfs/afa2742.c084f5d6.17b6b08dffc@tnonline.net
Fixes: f2165627319f ("btrfs: compression: don't try to compress if we don't have enough pages")
CC: stable@vger.kernel.org # 4.4+
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-05 18:57:29 +02:00
..
tests init: add dsm gpl source 2024-07-05 18:00:04 +02:00
acl.c btrfs: cleanup btrfs_setxattr_trans and drop transaction parameter 2019-04-29 19:02:44 +02:00
async-thread.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
async-thread.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
backref.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
backref.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
block-group.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
block-group.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
block-rsv.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
block-rsv.h btrfs: Remove __ prefix from btrfs_block_rsv_release 2020-03-23 17:01:55 +01:00
btrfs_inode.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
check-integrity.c btrfs: check-integrity: remove unnecessary failure messages during memory allocation 2020-07-27 12:55:21 +02:00
check-integrity.h btrfs: remove btrfsic_submit_bh() 2020-03-23 17:01:39 +01:00
compression.c btrfs: mark compressed range uptodate only if all bio succeed 2024-07-05 18:02:46 +02:00
compression.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
ctree.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
ctree.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
delalloc-space.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
delalloc-space.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
delayed-inode.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
delayed-inode.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
delayed-ref.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
delayed-ref.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
dev-replace.c btrfs: fix deadlock when cloning inline extent and low on free metadata space 2021-01-17 14:16:54 +01:00
dev-replace.h btrfs: add __pure attribute to functions 2019-11-18 12:46:52 +01:00
dir-item.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
discard.c btrfs: merge critical sections of discard lock in workfn 2021-01-19 18:27:24 +01:00
discard.h btrfs: discard: Use the correct style for SPDX License Identifier 2020-04-20 17:43:42 +02:00
disk-io.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
disk-io.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
export.c btrfs: simplify iget helpers 2020-05-25 11:25:37 +02:00
export.h btrfs: export helpers for subvolume name/id resolution 2020-03-23 17:01:42 +01:00
extent_io.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
extent_io.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
extent_map.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
extent_map.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
extent-io-tree.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
extent-tree.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
file-item.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
file.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
free-space-analyze.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
free-space-cache.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
free-space-cache.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
free-space-tree.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
free-space-tree.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
inode-item.c btrfs: Make btrfs_find_name_in_ext_backref return struct btrfs_inode_extref 2019-09-09 14:59:16 +02:00
inode-map.c btrfs: make btrfs_delalloc_reserve_space take btrfs_inode 2020-07-27 12:55:36 +02:00
inode-map.h btrfs: replace GPL boilerplate by SPDX -- headers 2018-04-12 16:29:46 +02:00
inode.c Revert "btrfs: compression: don't try to compress if we don't have enough pages" 2024-07-05 18:57:29 +02:00
ioctl.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
Kconfig btrfs: disable build on platforms having page size 256K 2021-07-14 16:55:56 +02:00
locking.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
locking.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
lzo.c btrfs: compression: inline free_workspace 2019-11-18 12:46:59 +01:00
Makefile init: add dsm gpl source 2024-07-05 18:00:04 +02:00
misc.h btrfs: rename tree_entry to rb_simple_node and export it 2020-05-25 11:25:19 +02:00
ordered-data.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
ordered-data.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
orphan.c btrfs: replace GPL boilerplate by SPDX -- sources 2018-04-12 16:29:51 +02:00
print-tree.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
print-tree.h btrfs: print the actual offset in btrfs_root_name 2021-01-27 11:55:06 +01:00
props.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
props.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
qgroup.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
qgroup.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
raid56.c btrfs: fix raid6 qstripe kmap 2021-03-09 11:11:10 +01:00
raid56.h btrfs: constify map parameter for nr_parity_stripes and nr_data_stripes 2019-07-01 13:34:58 +02:00
rcu-string.h btrfs: rcu-string: Replace zero-length array with flexible-array member 2020-03-23 17:01:53 +01:00
reada.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
ref-verify.c btrfs: ref-verify: fix memory leak in btrfs_ref_tree_mod 2020-11-05 13:03:39 +01:00
ref-verify.h btrfs: ref-verify: Use btrfs_ref to refactor btrfs_ref_tree_mod() 2019-04-29 19:02:49 +02:00
reflink.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
reflink.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
relocation.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
root-tree.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
scrub.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
send.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
send.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
snapshot-size-query.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
space-info.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
space-info.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
struct-funcs.c btrfs: use unaligned helpers for stack and header set/get helpers 2020-10-07 12:13:23 +02:00
super.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
syno_acl.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
syno_acl.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
syno-extent-usage.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
syno-feat-tree.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
syno-feat-tree.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
syno-locker.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
syno-rbd-meta.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
syno-rbd-meta.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
sysfs.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
sysfs.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
transaction.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
transaction.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
tree-checker.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
tree-checker.h btrfs: get fs_info from eb in btrfs_check_chunk_valid 2019-04-29 19:02:39 +02:00
tree-defrag.c btrfs: remove unused btrfs_root::defrag_trans_start 2020-07-27 12:55:28 +02:00
tree-log.c btrfs: fix lost inode on log replay after mix of fsync, rename and inode eviction 2024-07-05 18:07:24 +02:00
tree-log.h btrfs: make fast fsyncs wait only for writeback 2020-10-07 12:06:56 +02:00
ulist.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
ulist.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
usrquota.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
uuid-tree.c btrfs: simplify root lookup by id 2020-05-25 11:25:36 +02:00
volumes.c btrfs: fix rw device counting in __btrfs_free_extra_devids 2024-07-05 18:02:41 +02:00
volumes.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
xattr.c init: add dsm gpl source 2024-07-05 18:00:04 +02:00
xattr.h init: add dsm gpl source 2024-07-05 18:00:04 +02:00
zlib.c btrfs: use larger zlib buffer for s390 hardware compression 2020-01-31 10:30:40 -08:00
zstd.c btrfs: compression: inline free_workspace 2019-11-18 12:46:59 +01:00