linux-next: manual merge of the btrfs tree with the btrfs-fixes tree
Subsystems (2)
[email protected]
maintainerHi all,
Today's linux-next merge of the btrfs tree got conflicts in:
fs/btrfs/ctree.h
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/lzo.c
between commit:
2ac3e062af024 ("btrfs: reduce extent threshold for autodefrag")
741b23a970a79 ("btrfs: prevent copying too big compressed lzo segment")
26fbac2517fca ("btrfs: autodefrag: only scan one inode once")
966d879bafaaf ("btrfs: defrag: allow defrag_one_cluster() to skip large extent which is not a target") d5633b0dee02d ("btrfs: defrag: bring back the old file extent search behavior")
from the btrfs-fixes tree and commit:
13b2f7ab699a5 ("btrfs: close the gap between inode_should_defrag() and autodefrag extent size threshold") 48b433a2ef82a ("btrfs: add lzo workspace buffer length constants")
db360c49d476f ("btrfs: autodefrag: only scan one inode once")
e6c69fcbee7ef ("btrfs: defrag: use control structure in btrfs_defrag_file()") 6b17743d934ec ("btrfs: defrag: bring back the old file extent search behavior")
from the btrfs tree.
I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.
fs/btrfs/ctree.h +0 -0
fs/btrfs/file.c +0 -0
fs/btrfs/inode.c +0 -0
fs/btrfs/ioctl.c +0 -0
@@@ -1435,16 -1460,16 +1461,23 @@@ static int defrag_collect_targets(struc goto add;/* Skip too large extent */ -if (range_len >= extent_thresh) +if (range_len >= ctrl->extent_thresh) + goto next; + +/* +* Skip extents already at its max capacity, this is mostly for +* compressed extents, which max cap is only 128K. +*/ +if (em->len >=get_extent_max_capacity (em)) goto next; +/* + * Skip extents already at its max capacity, this is mostly for + * compressed extents, which max cap is only 128K. + */ + if (em->len >= get_extent_max_capacity(em)) + goto next; + next_mergeable =defrag_check_next_extent (&inode->vfs_inode, em, locked);if (!next_mergeable) {break ; } -if (max_sectors) +if (ctrl->max_sectors_to_defrag) range_len =min_t (u32, range_len, - (max_sectors - *sectors_defragged) * sectorsize); + (ctrl->max_sectors_to_defrag - + ctrl->sectors_defragged) * sectorsize); +/* + * If defrag_one_range() has updated last_scanned_ret, + * our range may already be invalid (e.g. hole punched). + * Skip if our range is before last_scanned_ret, as there is + * no need to defrag the range anymore. + */ + if (entry->start + range_len <= *last_scanned_ret) + continue; + if (ra)page_cache_sync_readahead (inode->vfs_inode.i_mapping, ra,NULL , entry->start >>PAGE_SHIFT , break; }if (do_compress) -BTRFS_I (inode)->defrag_compress = compress_type; - ret =defrag_one_cluster (BTRFS_I (inode), ra, cur, - cluster_end +1 - cur, extent_thresh, - newer_than, do_compress, §ors_defragged, - max_to_defrag, &last_scanned); -BTRFS_I (inode)->defrag_compress = ctrl->compress; + ret =defrag_one_cluster (BTRFS_I (inode), ra, ctrl, cur, + cluster_end +1 - cur); -if (sectors_defragged > prev_sectors_defragged) +if (ctrl->sectors_defragged > prev_sectors_defragged)balance_dirty_pages_ratelimited (inode->i_mapping);btrfs_inode_unlock (inode,0 );
fs/btrfs/lzo.c +0 -0
fs/btrfs/ioctl.c +2 -2
@@ -1734,7 +1734,7 @@ static int defrag_one_cluster(struct btrfs_inode *inode,* Skip if our range is before last_scanned_ret, as there is * no need to defrag the range anymore. */ -if (entry->start + range_len <= *last_scanned_ret) +if (entry->start + range_len <= ctrl->last_scanned)continue ;if (ra)
@@ -1760,7 +1760,7 @@ static int defrag_one_cluster(struct btrfs_inode *inode,kfree (entry); }if (ret >=0 ) - *last_scanned_ret =max (*last_scanned_ret, start + len); + ctrl->last_scanned =max (ctrl->last_scanned, start + len);return ret; }
Quoted 20 lines · On Thu, Feb 24, 2022 at 01:44:27PM +0000, [email protected] wrote:
Hi all,
Today's linux-next merge of the btrfs tree got conflicts in:
fs/btrfs/ctree.h
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/lzo.cbetween commit:
2ac3e062af024("btrfs: reduce extent threshold for autodefrag")
741b23a970a79("btrfs: prevent copying too big compressed lzo segment")
26fbac2517fca("btrfs: autodefrag: only scan one inode once")
966d879bafaaf("btrfs: defrag: allowdefrag_one_cluster()to skip large extent which is not a target")d5633b0dee02d("btrfs: defrag: bring back the old file extent search behavior")from the btrfs-fixes tree and commit:
Quoted 7 lines
13b2f7ab699a5("btrfs: close the gap betweeninode_should_defrag()and autodefrag extent size threshold")48b433a2ef82a("btrfs: add lzo workspace buffer length constants")
db360c49d476f("btrfs: autodefrag: only scan one inode once")
e6c69fcbee7ef("btrfs: defrag: use control structure inbtrfs_defrag_file()")6b17743d934ec("btrfs: defrag: bring back the old file extent search behavior")from the btrfs tree.
The fixes and for-next snapshot branches got out of sync a bit, I've checked that they merge without conflicts as of yesterday.