linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2023-10-08 23:48 Stephen Rothwell
  2023-10-09 16:15 ` Christian Brauner
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2023-10-08 23:48 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 10743 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got lots of conflicts
against the btrfs tree.  This is because the vfs-braunter tree has merged
a previous version of the btrfs tree and now the btrfs tree has rebased
and changed several commits.

You cannot merge another tree in linux-next unless the otehr tree is
guaranteed not to rebase (or have commits rewritten in it).

The following commits are duplicates between the two trees (same patch
but different commit) and there are also some that are slightly different
patches:

  00e27794611a ("btrfs: qgroup: use qgroup_iterator to replace tmp ulist in qgroup_update_refcnt()")
  0170b5c5e607 ("btrfs: reduce size of prelim_ref::level")
  01c41e751fcb ("btrfs: call btrfs_close_devices from ->kill_sb")
  025e4dc521e1 ("btrfs: remove refs_to_drop argument from __btrfs_free_extent()")
  0266c8c65c81 ("btrfs: use a single variable for return value at lookup_inline_extent_backref()")
  096833591c4b ("btrfs: qgroup: iterate qgroups without memory allocation for qgroup_reserve()")
  0bd5b51b99fa ("btrfs: always open the device read-only in btrfs_scan_one_device")
  0c516db11952 ("btrfs: remove redundant root argument from btrfs_update_inode_item()")
  0c612f9e77cc ("btrfs: stop doing excessive space reservation for csum deletion")
  0d9436739af2 ("btrfs: scan but don't register device on single device filesystem")
  0e3380da547b ("btrfs: don't arbitrarily slow down delalloc if we're committing")
  1172a0c18f3b ("btrfs: remove pointless initialization at btrfs_delayed_refs_rsv_release()")
  1488ae026122 ("btrfs: sysfs: add simple_quota incompat feature entry")
  18030a255de2 ("btrfs: move extent_buffer::lock_owner to debug section")
  1a5bda4c5bac ("btrfs: relocation: use more natural types for tree_block bitfields")
  1e4f604b274f ("btrfs: return -EUCLEAN if extent item is missing when searching inline backref")
  1fbf413f4346 ("btrfs: use a single variable for return value at run_delayed_extent_op()")
  206536cd2851 ("btrfs: reject devices with CHANGING_FSID_V2")
  2263c3dadd27 ("btrfs: remove redundant root argument from btrfs_update_inode()")
  23030f1872bd ("btrfs: map uncontinuous extent buffer pages into virtual address space")
  244c627c729d ("btrfs: move btrfs_extref_hash into inode-item.h")
  254cedfd09da ("btrfs: remove stale comment from btrfs_free_extent()")
  256a88a21f59 ("btrfs: mark transaction id check as unlikely at btrfs_mark_buffer_dirty()")
  25ec25120282 ("btrfs: zoned: factor out single bg handling from btrfs_load_block_group_zone_info")
  28a4901d0247 ("btrfs: comment about fsid and metadata_uuid relationship")
  2c5a947f8f7a ("btrfs: tree-checker: add support for raid stripe tree")
  2fe808177f98 ("btrfs: qgroup: use qgroup_iterator in __qgroup_excl_accounting()")
  37282c19f15b ("btrfs: relocation: switch bitfields to bool in reloc_control")
  37adfa983dde ("btrfs: qgroup: use qgroup_iterator in qgroup_convert_meta()")
  39e02b54f663 ("btrfs: qgroup: remove unused helpers for ulist aux data")
  3a2ccead18f6 ("btrfs: check-integrity: remove CONFIG_BTRFS_FS_CHECK_INTEGRITY option")
  3cf06838fab9 ("btrfs: remove pointless 'ref_root' variable from run_delayed_data_ref()")
  3dbaabf131ab ("btrfs: sysfs: expose quota mode via sysfs")
  401f89cc5c1e ("btrfs: reduce parameters of btrfs_pin_reserved_extent")
  4146050f0535 ("btrfs: utilize the physically/virtually continuous extent buffer memory")
  41dd41a59eef ("btrfs: split btrfs_fs_devices.opened")
  41f394848b0c ("btrfs: qgroup: introduce quota mode")
  44d518b3a2f3 ("btrfs: rename tree_ref and data_ref owning_root")
  44ef1e5b86ea ("btrfs: record simple quota deltas in delayed refs")
  4b58a2dbb970 ("btrfs: add raid stripe tree to features enabled with debug config")
  55f696fe8f18 ("btrfs: track original extent owner in head_ref")
  58d8cff02f7c ("btrfs: relocation: open code mapping_tree_init")
  5d2c6a3f6a5a ("btrfs: track data relocation with simple quota")
  5f5ff8f0d9ce ("btrfs: remove redundant root argument from maybe_insert_hole()")
  6261fa6c858f ("btrfs: reduce size of struct btrfs_ref")
  655df68dc47d ("btrfs: scrub: implement raid stripe tree support")
  667904274890 ("btrfs: qgroup: prealloc btrfs_qgroup_list for __add_relation_rb()")
  686b6a24fc74 ("btrfs: make extent_io_tree_release() more efficient")
  7181df86dc94 ("btrfs: check-integrity: remove btrfsic_unmount() function")
  775b26e4ccaa ("btrfs: remove redundant root argument from btrfs_delayed_update_inode()")
  78b5f8cf81a6 ("btrfs: make sure we cache next state in find_first_extent_bit()")
  7913ec811cb3 ("btrfs: reformat remaining kdoc style comments")
  7a2841ae12d7 ("btrfs: qgroup: track metadata relocation COW with simple quota")
  7b2f8e075d2b ("btrfs: tracepoints: add events for raid stripe tree")
  7ba59aa76414 ("btrfs: zoned: factor out DUP bg handling from btrfs_load_block_group_zone_info")
  7d2d132d7377 ("btrfs: qgroup: pre-allocate btrfs_qgroup to reduce GFP_ATOMIC usage")
  7e4ea691953d ("btrfs: add btrfs_delayed_ref_head declaration to extent-tree.h")
  81652d9abb4c ("btrfs: sipmlify uuid parameters of alloc_fs_devices()")
  847de878cd77 ("btrfs: create qgroup earlier in snapshot creation")
  8764e2b05fa2 ("btrfs: update comment for reservation of metadata space for delayed items")
  88303e09efeb ("btrfs: qgroup: add new quota mode for simple quotas")
  88d6b34c273b ("btrfs: add fscrypt related dependencies to respective headers")
  89a134e82379 ("btrfs: drop __must_check annotations")
  8c4c87fee0cb ("btrfs: initialize key where it's used when running delayed data ref")
  8c8c0668bc06 ("btrfs: remove redundant root argument from btrfs_update_inode_fallback()")
  8dbfbc8212b6 ("btrfs: remove unnecessary logic when running new delayed references")
  8f46ee177f9e ("btrfs: qgroup: only set QUOTA_ENABLED when done reading qgroups")
  8fccdeee3260 ("btrfs: use btrfs_crit at btrfs_mark_buffer_dirty()")
  90911b16854e ("btrfs: update stale comment at extent_io_tree_release()")
  974ea1e1dced ("btrfs: include linux/iomap.h in file.c")
  9823506bbabc ("btrfs: collapse wait_on_state() to its caller wait_extent_bit()")
  99fea7429097 ("btrfs: relocation: use enum for stages")
  9a8264cbc207 ("btrfs: remove refs_to_add argument from __btrfs_inc_extent_ref()")
  9af116141f5e ("btrfs: check-integrity: remove btrfsic_check_bio() function")
  a13fc1494581 ("btrfs: relocation: constify parameters where possible")
  a51d5aa50249 ("btrfs: move btrfs_defrag_root() to defrag.{c,h}")
  a5526bfa5317 ("btrfs: reserve space for delayed refs on a per ref basis")
  aa1cbbaaceb4 ("btrfs: add helper for inline owner ref lookup")
  adcbff903c0a ("btrfs: new inline ref storing owning subvol of data extents")
  ae3c53e03eaf ("btrfs: qgroup: check generation when recording simple quota delta")
  af2851c7e85c ("btrfs: qgroup: use qgroup_iterator in btrfs_qgroup_free_refroot()")
  b07a0f7efc15 ("btrfs: pass a space_info argument to btrfs_reserve_metadata_bytes()")
  b10a83023f61 ("btrfs: remove the refcount warning/check at btrfs_put_delayed_ref()")
  b1668d4289b5 ("btrfs: remove pointless loop from btrfs_update_block_group()")
  b17b48262238 ("btrfs: include linux/security.h in super.c")
  b464b68ffa11 ("btrfs: simplify check for extent item overrun at lookup_inline_extent_backref()")
  b4a664ad7058 ("btrfs: move btrfs_name_hash to dir-item.h")
  ba41e3f24f38 ("btrfs: zoned: introduce a zone_info struct in btrfs_load_block_group_zone_info")
  ba76f99bc974 ("btrfs: reduce parameters of btrfs_pin_extent_for_log_replay")
  bd07fb48543d ("btrfs: remove useless comment from btrfs_pin_extent_for_log_replay()")
  bd2397cfa662 ("btrfs: zoned: factor out per-zone logic from btrfs_load_block_group_zone_info")
  be4ccd3db6ad ("btrfs: remove redundant root argument from fixup_inode_link_count()")
  bf7009433d2c ("btrfs: move btrfs_crc32c_final into free-space-cache.c")
  c20943e2cfda ("btrfs: include trace header in where necessary")
  c43c08fdc78e ("btrfs: reduce size and reorder compression members in struct btrfs_inode")
  c461ca14b76e ("btrfs: remove incomplete metadata_uuid conversion fixup logic")
  c51cdcd1ba63 ("btrfs: make wait_extent_bit() static")
  c703dc4d72a6 ("btrfs: move functions comments from qgroup.h to qgroup.c")
  d056274031e5 ("btrfs: simplify error check condition at btrfs_dirty_inode()")
  d08ef7486357 ("btrfs: do not require EXTENT_NOWAIT for btrfs_redirty_list_add()")
  d1432a9acc60 ("btrfs: include asm/unaligned.h in accessors.h")
  d387ae42784d ("btrfs: remove noinline from btrfs_update_inode()")
  d6540ef346d1 ("btrfs: make extent state merges more efficient during insertions")
  d74100792148 ("btrfs: track owning root in btrfs_ref")
  d8897d7d197e ("btrfs: check-integrity: remove btrfsic_mount() function")
  da64d31c6820 ("btrfs: remove the need_raid_map parameter from btrfs_map_block()")
  da9b993b494f ("btrfs: add helper for recording simple quota deltas")
  dd20d5749497 ("btrfs: remove btrfs_crc32c wrapper")
  dd3800cf0f2b ("btrfs: zoned: support RAID0/1/10 on top of raid stripe tree")
  dd99b78be273 ("btrfs: open block devices after superblock creation")
  de2aa50f1af4 ("btrfs: abort transaction on generation mismatch when marking eb as dirty")
  e0a95452557f ("btrfs: read raid stripe tree from disk")
  e52ee3a64a18 ("btrfs: warn on tree blocks which are not nodesize aligned")
  e6aece34f28c ("btrfs: remove pointless memory barrier from extent_io_tree_release()")
  e79beb802f47 ("btrfs: qgroup: use qgroup_iterator_nested to in qgroup_update_refcnt()")
  e9ff4ac68dd9 ("btrfs: always reserve space for delayed refs when starting transaction")
  ed8c68fb0cad ("btrfs: sysfs: announce presence of raid-stripe-tree")
  f25fab65bfff ("btrfs: qgroup: simple quota auto hierarchy for nested subvolumes")
  f359f7ce2037 ("btrfs: relocation: return bool from btrfs_should_ignore_reloc_root")
  f4164e6df0d7 ("btrfs: use the super_block as holder when mounting file systems")
  f47602f7605d ("btrfs: allow to run delayed refs by bytes to be released instead of count")
  f4e65ababe47 ("btrfs: use extent_io_tree_release() to empty dirty log pages")
  f8fdb685b8d9 ("btrfs: switch btrfs_backref_cache::is_reloc to bool")
  f92547da557f ("btrfs: merge ordered work callbacks in btrfs_work into one")
  fa5cf2ac4d06 ("btrfs: reduce arguments of helpers space accounting root item")
  fdd5252afbc3 ("btrfs: remove extraneous includes from ctree.h")

I have dropped the vfs-brauner tree for today as there is no way I can
sort them out in a reasonable time.  Please sort this out between
yourselves.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2025-11-02 21:58 Stephen Rothwell
  2025-12-02  0:58 ` Stephen Rothwell
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2025-11-02 21:58 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: David Sterba, Filipe Manana, Linux Kernel Mailing List,
	Linux Next Mailing List, Matthew Wilcox (Oracle)

[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/file.c

between commit:

  ede21a086a16 ("btrfs: use end_pos variable where needed in btrfs_dirty_folio()")

from the btrfs tree and commit:

  48f3784b17d9 ("btrfs: Use folio_next_pos()")

from the vfs-brauner 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/file.c
index 1e0ff3d7210d,977931cfa71e..000000000000
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@@ -86,9 -86,11 +86,9 @@@ int btrfs_dirty_folio(struct btrfs_inod
  		extra_bits |= EXTENT_NORESERVE;
  
  	start_pos = round_down(pos, fs_info->sectorsize);
 -	num_bytes = round_up(write_bytes + pos - start_pos,
 -			     fs_info->sectorsize);
 +	num_bytes = round_up(end_pos - start_pos, fs_info->sectorsize);
  	ASSERT(num_bytes <= U32_MAX);
- 	ASSERT(folio_pos(folio) <= pos && folio_end(folio) >= end_pos);
 -	ASSERT(folio_pos(folio) <= pos &&
 -	       folio_next_pos(folio) >= pos + write_bytes);
++	ASSERT(folio_pos(folio) <= pos && folio_next_pos(folio) >= end_pos);
  
  	end_of_last_block = start_pos + num_bytes - 1;
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2024-10-31 22:22 Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2024-10-31 22:22 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: David Sterba, Haisu Wang, Linux Kernel Mailing List,
	Linux Next Mailing List, Matthew Wilcox (Oracle), Qu Wenruo

[-- Attachment #1: Type: text/plain, Size: 6041 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/inode.c

between commits:

  530eec3e0f6e ("btrfs: simplify range tracking in cow_file_range()")
  25e40a35c927 ("btrfs: extract the inner loop of cow_file_range() to enhance the error handling")

from the btrfs tree and commit:

  a6752a6e7fb0 ("btrfs: Switch from using the private_2 flag to owner_2")

from the vfs-brauner 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/inode.c
index 6ec223f9987f,c14e37438a0b..000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -1293,147 -1320,6 +1293,147 @@@ u64 btrfs_get_extent_allocation_hint(st
  	return alloc_hint;
  }
  
 +/*
 + * Run one cow range, which includes:
 + *
 + * - Reserve the data extent
 + * - Create the io extent map
 + * - Create the ordered extent
 + *
 + * @ins will be updated if the range should be skipped for error handling, no
 + * matter the return value.
 + *
 + * Return 0 if everything is fine.
 + * Return -EAGAIN if btrfs_reserve_extent() failed for zoned fs, caller needs
 + * some extra handling.
 + * Return <0 for other errors.
 + */
 +static int run_one_cow_range(struct btrfs_inode *inode,
 +			     struct folio *locked_folio,
 +			     struct btrfs_key *ins,
 +			     u64 start,
 +			     u64 end, u64 *alloc_hint, bool keep_locked)
 +{
 +	struct btrfs_root *root = inode->root;
 +	struct btrfs_fs_info *fs_info = root->fs_info;
 +	struct btrfs_ordered_extent *ordered;
 +	struct btrfs_file_extent file_extent = { 0 };
 +	struct extent_state *cached = NULL;
 +	struct extent_map *em = NULL;
 +	unsigned long page_ops;
 +	const u64 len = end + 1 - start;
 +	u32 min_alloc_size;
 +	int ret;
 +
 +	ASSERT(IS_ALIGNED(start, fs_info->sectorsize));
 +	ASSERT(IS_ALIGNED(end + 1, fs_info->sectorsize));
 +
 +	ins->offset = 0;
 +	ins->objectid = 0;
 +
 +	/*
 +	 * Relocation relies on the relocated extents to have exactly the same
 +	 * size as the original extents. Normally writeback for relocation data
 +	 * extents follows a NOCOW path because relocation preallocates the
 +	 * extents. However, due to an operation such as scrub turning a block
 +	 * group to RO mode, it may fallback to COW mode, so we must make sure
 +	 * an extent allocated during COW has exactly the requested size and can
 +	 * not be split into smaller extents, otherwise relocation breaks and
 +	 * fails during the stage where it updates the bytenr of file extent
 +	 * items.
 +	 */
 +	if (btrfs_is_data_reloc_root(root))
 +		min_alloc_size = len;
 +	else
 +		min_alloc_size = fs_info->sectorsize;
 +
 +	ret = btrfs_reserve_extent(root, len, len, min_alloc_size, 0,
 +				   *alloc_hint, ins, 1, 1);
 +	if (ret < 0)
 +		return ret;
 +
 +	file_extent.disk_bytenr = ins->objectid;
 +	file_extent.disk_num_bytes = ins->offset;
 +	file_extent.num_bytes = ins->offset;
 +	file_extent.ram_bytes = ins->offset;
 +	file_extent.offset = 0;
 +	file_extent.compression = BTRFS_COMPRESS_NONE;
 +
 +	lock_extent(&inode->io_tree, start, start + ins->offset - 1,
 +		    &cached);
 +
 +	em = btrfs_create_io_em(inode, start, &file_extent,
 +				BTRFS_ORDERED_REGULAR);
 +	if (IS_ERR(em)) {
 +		unlock_extent(&inode->io_tree, start,
 +			      start + ins->offset - 1, &cached);
 +		ret = PTR_ERR(em);
 +		goto out_free_reserved;
 +	}
 +	free_extent_map(em);
 +
 +	ordered = btrfs_alloc_ordered_extent(inode, start, &file_extent,
 +					     1 << BTRFS_ORDERED_REGULAR);
 +	if (IS_ERR(ordered)) {
 +		unlock_extent(&inode->io_tree, start,
 +			      start + ins->offset - 1, &cached);
 +		ret = PTR_ERR(ordered);
 +		goto out_drop_em;
 +	}
 +
 +	if (btrfs_is_data_reloc_root(root)) {
 +		ret = btrfs_reloc_clone_csums(ordered);
 +
 +		/*
 +		 * Only drop cache here, and process as normal.
 +		 *
 +		 * We must not allow extent_clear_unlock_delalloc()
 +		 * at error handling to free meta of this ordered
 +		 * extent, as its meta should be freed by
 +		 * btrfs_finish_ordered_io().
 +		 *
 +		 * So we must continue until @start is increased to
 +		 * skip current ordered extent.
 +		 */
 +		if (ret < 0)
 +			btrfs_drop_extent_map_range(inode, start,
 +						    start + ins->offset - 1,
 +						    false);
 +	}
 +	btrfs_put_ordered_extent(ordered);
 +
 +	btrfs_dec_block_group_reservations(fs_info, ins->objectid);
 +
 +	/*
 +	 * We're not doing compressed IO, don't unlock the first page
 +	 * (which the caller expects to stay locked), don't clear any
 +	 * dirty bits and don't set any writeback bits
 +	 *
- 	 * Do set the Ordered (Private2) bit so we know this page was
++	 * Do set the Ordered flag so we know this page was
 +	 * properly setup for writepage.
 +	 */
 +	page_ops = (keep_locked ? 0 : PAGE_UNLOCK);
 +	page_ops |= PAGE_SET_ORDERED;
 +
 +	extent_clear_unlock_delalloc(inode, start, start + ins->offset - 1,
 +				     locked_folio, &cached,
 +				     EXTENT_LOCKED | EXTENT_DELALLOC,
 +				     page_ops);
 +	*alloc_hint = ins->objectid + ins->offset;
 +	return ret;
 +
 +out_drop_em:
 +	btrfs_drop_extent_map_range(inode, start, start + ins->offset - 1, false);
 +out_free_reserved:
 +	btrfs_dec_block_group_reservations(fs_info, ins->objectid);
 +	btrfs_free_reserved_extent(fs_info, ins->objectid, ins->offset, 1);
 +	/* This is reserved for btrfs_reserve_extent() error. */
 +	ASSERT(ret != -EAGAIN);
 +	ins->offset = 0;
 +	ins->objectid = 0;
 +	return ret;
 +}
 +
  /*
   * when extent_io.c finds a delayed allocation range in the file,
   * the call backs end up in this code.  The basic idea is to

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2024-10-15 21:51 Stephen Rothwell
  2024-11-18 22:16 ` Stephen Rothwell
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2024-10-15 21:51 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: David Sterba, Jeff Layton, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1709 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/file.c

between commit:

  377781e9e6f8 ("btrfs: drop unused parameter iov_iter from btrfs_write_check()")

from the btrfs tree and commit:

  e2e801d6e625 ("btrfs: convert to multigrain timestamps")

from the vfs-brauner 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/file.c
index 033f85ea8c9d,e5384ceb8acf..000000000000
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@@ -1124,27 -1120,7 +1124,7 @@@ void btrfs_check_nocow_unlock(struct bt
  	btrfs_drew_write_unlock(&inode->root->snapshot_lock);
  }
  
- static void update_time_for_write(struct inode *inode)
- {
- 	struct timespec64 now, ts;
- 
- 	if (IS_NOCMTIME(inode))
- 		return;
- 
- 	now = current_time(inode);
- 	ts = inode_get_mtime(inode);
- 	if (!timespec64_equal(&ts, &now))
- 		inode_set_mtime_to_ts(inode, now);
- 
- 	ts = inode_get_ctime(inode);
- 	if (!timespec64_equal(&ts, &now))
- 		inode_set_ctime_to_ts(inode, now);
- 
- 	if (IS_I_VERSION(inode))
- 		inode_inc_iversion(inode);
- }
- 
 -int btrfs_write_check(struct kiocb *iocb, struct iov_iter *from, size_t count)
 +int btrfs_write_check(struct kiocb *iocb, size_t count)
  {
  	struct file *file = iocb->ki_filp;
  	struct inode *inode = file_inode(file);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2024-06-18 11:41 Mark Brown
  2024-07-16  0:58 ` Stephen Rothwell
  0 siblings, 1 reply; 33+ messages in thread
From: Mark Brown @ 2024-06-18 11:41 UTC (permalink / raw)
  To: Christian Brauner
  Cc: David Sterba, Filipe Manana, Linux Kernel Mailing List,
	Linux Next Mailing List, Mateusz Guzik

[-- Attachment #1: Type: text/plain, Size: 1230 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/inode.c

between commit:

  adaac2633c9ad ("btrfs: remove super block argument from btrfs_iget_locked()")

from the btrfs tree and commit:

  b49558e8ce3dc ("btrfs: use iget5_locked_rcu")

from the vfs-brauner 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.

diff --cc fs/btrfs/inode.c
index 89e58647d08de,cbb2c92b6c084..0000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -5582,7 -5587,7 +5582,7 @@@ static struct inode *btrfs_iget_locked(
  	args.ino = ino;
  	args.root = root;
  
- 	inode = iget5_locked(root->fs_info->sb, hashval, btrfs_find_actor,
 -	inode = iget5_locked_rcu(s, hashval, btrfs_find_actor,
++	inode = iget5_locked_rcu(root->fs_info->sb, hashval, btrfs_find_actor,
  			     btrfs_init_locked_inode,
  			     (void *)&args);
  	return inode;

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2024-05-03  1:00 Stephen Rothwell
  2024-05-14  1:38 ` Stephen Rothwell
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2024-05-03  1:00 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: Al Viro, David Sterba, Linux Kernel Mailing List,
	Linux Next Mailing List, Matthew Wilcox (Oracle)

[-- Attachment #1: Type: text/plain, Size: 2819 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/disk-io.c

between commits:

  4a63bd0ffbd2 ("btrfs: convert super block writes to folio in wait_dev_supers()")
  545799bb1bb9 ("btrfs: count super block write errors in device instead of tracking folio error state")

from the btrfs tree and commit:

  db3102368e1b ("use ->bd_mapping instead of ->bd_inode->i_mapping")

from the vfs-brauner 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/disk-io.c
index e8aca9f0e692,f10e894b0bf5..000000000000
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@@ -3739,9 -3738,10 +3739,9 @@@ static int write_dev_supers(struct btrf
  			    struct btrfs_super_block *sb, int max_mirrors)
  {
  	struct btrfs_fs_info *fs_info = device->fs_info;
- 	struct address_space *mapping = device->bdev->bd_inode->i_mapping;
+ 	struct address_space *mapping = device->bdev->bd_mapping;
  	SHASH_DESC_ON_STACK(shash, fs_info->csum_shash);
  	int i;
 -	int errors = 0;
  	int ret;
  	u64 bytenr, bytenr_orig;
  
@@@ -3857,21 -3855,30 +3857,21 @@@ static int wait_dev_supers(struct btrfs
  		    device->commit_total_bytes)
  			break;
  
- 		folio = filemap_get_folio(device->bdev->bd_inode->i_mapping,
 -		page = find_get_page(device->bdev->bd_mapping,
 -				     bytenr >> PAGE_SHIFT);
 -		if (!page) {
 -			errors++;
 -			if (i == 0)
 -				primary_failed = true;
++		folio = filemap_get_folio(device->bdev->bd_mapping,
 +					  bytenr >> PAGE_SHIFT);
 +		/* If the folio has been removed, then we know it completed. */
 +		if (IS_ERR(folio))
  			continue;
 -		}
 -		/* Page is submitted locked and unlocked once the IO completes */
 -		wait_on_page_locked(page);
 -		if (PageError(page)) {
 -			errors++;
 -			if (i == 0)
 -				primary_failed = true;
 -		}
 +		ASSERT(folio_order(folio) == 0);
  
 -		/* Drop our reference */
 -		put_page(page);
 -
 -		/* Drop the reference from the writing run */
 -		put_page(page);
 +		/* Folio will be unlocked once the write completes. */
 +		folio_wait_locked(folio);
 +		folio_put(folio);
  	}
  
 -	/* log error, force error return */
 +	errors += atomic_read(&device->sb_write_errors);
 +	if (errors >= BTRFS_SUPER_PRIMARY_WRITE_ERROR)
 +		primary_failed = true;
  	if (primary_failed) {
  		btrfs_err(device->fs_info, "error writing primary super block to device %llu",
  			  device->devid);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2024-04-30 23:42 Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2024-04-30 23:42 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: Al Viro, David Sterba, Linux Kernel Mailing List,
	Linux Next Mailing List, Matthew Wilcox (Oracle)

[-- Attachment #1: Type: text/plain, Size: 2572 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/disk-io.c

between commit:

  5c855642bbb9 ("btrfs: Use a folio in wait_dev_supers()")

from the btrfs tree and commit:

  db3102368e1b ("use ->bd_mapping instead of ->bd_inode->i_mapping")

from the vfs-brauner 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/disk-io.c
index 6b3720b13939,f10e894b0bf5..000000000000
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@@ -3739,9 -3738,10 +3739,9 @@@ static int write_dev_supers(struct btrf
  			    struct btrfs_super_block *sb, int max_mirrors)
  {
  	struct btrfs_fs_info *fs_info = device->fs_info;
- 	struct address_space *mapping = device->bdev->bd_inode->i_mapping;
+ 	struct address_space *mapping = device->bdev->bd_mapping;
  	SHASH_DESC_ON_STACK(shash, fs_info->csum_shash);
  	int i;
 -	int errors = 0;
  	int ret;
  	u64 bytenr, bytenr_orig;
  
@@@ -3855,19 -3855,29 +3855,19 @@@ static int wait_dev_supers(struct btrfs
  		    device->commit_total_bytes)
  			break;
  
- 		folio = filemap_get_folio(device->bdev->bd_inode->i_mapping,
 -		page = find_get_page(device->bdev->bd_mapping,
++		folio = filemap_get_folio(device->bdev->bd_mapping,
  				     bytenr >> PAGE_SHIFT);
 -		if (!page) {
 -			errors++;
 -			if (i == 0)
 -				primary_failed = true;
 +		/* If the folio has been removed, then we know it completed */
 +		if (IS_ERR(folio))
  			continue;
 -		}
 -		/* Page is submitted locked and unlocked once the IO completes */
 -		wait_on_page_locked(page);
 -		if (PageError(page)) {
 -			errors++;
 -			if (i == 0)
 -				primary_failed = true;
 -		}
 -
 -		/* Drop our reference */
 -		put_page(page);
 -
 -		/* Drop the reference from the writing run */
 -		put_page(page);
 +		/* Folio is unlocked once the IO completes */
 +		folio_wait_locked(folio);
 +		folio_put(folio);
  	}
  
 +	errors += atomic_read(&device->sb_wb_errors);
 +	if (errors >= BTRFS_DEV_PRIMARY_ERROR)
 +		primary_failed = true;
  	/* log error, force error return */
  	if (primary_failed) {
  		btrfs_err(device->fs_info, "error writing primary super block to device %llu",

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2023-12-06 23:32 Stephen Rothwell
  2024-01-08 20:56 ` Stephen Rothwell
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2023-12-06 23:32 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: David Sterba, Linux Kernel Mailing List, Linux Next Mailing List,
	Matthew Wilcox (Oracle), Qu Wenruo

[-- Attachment #1: Type: text/plain, Size: 8310 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/extent_io.c

between commits:

  16aee93de711 ("btrfs: migrate to use folio private instead of page private")
  042eab832c43 ("btrfs: refactor alloc_extent_buffer() to allocate-then-attach method")

from the btrfs tree and commit:

  600f111ef51d ("fs: Rename mapping private members")

from the vfs-brauner 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/extent_io.c
index 5cae7884e8d9,3431a53bf3fd..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -881,13 -870,13 +881,13 @@@ static int attach_extent_buffer_page(st
  	 * will not race with any other ebs.
  	 */
  	if (page->mapping)
- 		lockdep_assert_held(&page->mapping->private_lock);
+ 		lockdep_assert_held(&page->mapping->i_private_lock);
  
  	if (fs_info->nodesize >= PAGE_SIZE) {
 -		if (!PagePrivate(page))
 -			attach_page_private(page, eb);
 +		if (!folio_test_private(folio))
 +			folio_attach_private(folio, eb);
  		else
 -			WARN_ON(page->private != (unsigned long)eb);
 +			WARN_ON(folio_get_private(folio) != eb);
  		return 0;
  	}
  
@@@ -1750,9 -1736,9 +1750,9 @@@ static int submit_eb_subpage(struct pag
  		 * Take private lock to ensure the subpage won't be detached
  		 * in the meantime.
  		 */
- 		spin_lock(&page->mapping->private_lock);
+ 		spin_lock(&page->mapping->i_private_lock);
 -		if (!PagePrivate(page)) {
 +		if (!folio_test_private(folio)) {
- 			spin_unlock(&page->mapping->private_lock);
+ 			spin_unlock(&page->mapping->i_private_lock);
  			break;
  		}
  		spin_lock_irqsave(&subpage->lock, flags);
@@@ -1826,9 -1811,9 +1826,9 @@@ static int submit_eb_page(struct page *
  	if (btrfs_sb(page->mapping->host->i_sb)->nodesize < PAGE_SIZE)
  		return submit_eb_subpage(page, wbc);
  
- 	spin_lock(&mapping->private_lock);
+ 	spin_lock(&mapping->i_private_lock);
 -	if (!PagePrivate(page)) {
 +	if (!folio_test_private(folio)) {
- 		spin_unlock(&mapping->private_lock);
+ 		spin_unlock(&mapping->i_private_lock);
  		return 0;
  	}
  
@@@ -3070,13 -3054,12 +3070,13 @@@ static int extent_buffer_under_io(cons
  
  static bool page_range_has_eb(struct btrfs_fs_info *fs_info, struct page *page)
  {
 +	struct folio *folio = page_folio(page);
  	struct btrfs_subpage *subpage;
  
- 	lockdep_assert_held(&page->mapping->private_lock);
+ 	lockdep_assert_held(&page->mapping->i_private_lock);
  
 -	if (PagePrivate(page)) {
 -		subpage = (struct btrfs_subpage *)page->private;
 +	if (folio_test_private(folio)) {
 +		subpage = folio_get_private(folio);
  		if (atomic_read(&subpage->eb_refs))
  			return true;
  		/*
@@@ -3093,18 -3076,17 +3093,18 @@@ static void detach_extent_buffer_page(s
  {
  	struct btrfs_fs_info *fs_info = eb->fs_info;
  	const bool mapped = !test_bit(EXTENT_BUFFER_UNMAPPED, &eb->bflags);
 +	struct folio *folio = page_folio(page);
  
  	/*
 -	 * For mapped eb, we're going to change the page private, which should
 +	 * For mapped eb, we're going to change the folio private, which should
- 	 * be done under the private_lock.
+ 	 * be done under the i_private_lock.
  	 */
  	if (mapped)
- 		spin_lock(&page->mapping->private_lock);
+ 		spin_lock(&page->mapping->i_private_lock);
  
 -	if (!PagePrivate(page)) {
 +	if (!folio_test_private(folio)) {
  		if (mapped)
- 			spin_unlock(&page->mapping->private_lock);
+ 			spin_unlock(&page->mapping->i_private_lock);
  		return;
  	}
  
@@@ -3120,11 -3103,14 +3120,11 @@@
  			BUG_ON(test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags));
  			BUG_ON(PageDirty(page));
  			BUG_ON(PageWriteback(page));
 -			/*
 -			 * We need to make sure we haven't be attached
 -			 * to a new eb.
 -			 */
 -			detach_page_private(page);
 +			/* We need to make sure we haven't be attached to a new eb. */
 +			folio_detach_private(folio);
  		}
  		if (mapped)
- 			spin_unlock(&page->mapping->private_lock);
+ 			spin_unlock(&page->mapping->i_private_lock);
  		return;
  	}
  
@@@ -3588,8 -3513,8 +3588,8 @@@ struct extent_buffer *alloc_extent_buff
  	num_pages = num_extent_pages(eb);
  
  	/*
 -	 * Preallocate page->private for subpage case, so that we won't
 +	 * Preallocate folio private for subpage case, so that we won't
- 	 * allocate memory with private_lock nor page lock hold.
+ 	 * allocate memory with i_private_lock nor page lock hold.
  	 *
  	 * The memory will be freed by attach_extent_buffer_page() or freed
  	 * manually if we exit earlier.
@@@ -3602,31 -3527,24 +3602,31 @@@
  		}
  	}
  
 -	for (i = 0; i < num_pages; i++, index++) {
 -		p = find_or_create_page(mapping, index, GFP_NOFS|__GFP_NOFAIL);
 -		if (!p) {
 -			exists = ERR_PTR(-ENOMEM);
 -			btrfs_free_subpage(prealloc);
 -			goto free_eb;
 -		}
 +	/* Allocate all pages first. */
 +	ret = btrfs_alloc_page_array(num_pages, eb->pages, __GFP_NOFAIL);
 +	if (ret < 0) {
 +		btrfs_free_subpage(prealloc);
 +		goto out;
 +	}
  
 -		spin_lock(&mapping->i_private_lock);
 -		exists = grab_extent_buffer(fs_info, p);
 -		if (exists) {
 -			spin_unlock(&mapping->i_private_lock);
 -			unlock_page(p);
 -			put_page(p);
 -			mark_extent_buffer_accessed(exists, p);
 -			btrfs_free_subpage(prealloc);
 -			goto free_eb;
 +	/* Attach all pages to the filemap. */
 +	for (int i = 0; i < num_pages; i++) {
 +		struct page *p;
 +
 +		ret = attach_eb_page_to_filemap(eb, i, &existing_eb);
 +		if (ret > 0) {
 +			ASSERT(existing_eb);
 +			goto out;
  		}
 +		attached++;
 +
 +		/*
 +		 * Only after attach_eb_page_to_filemap(), eb->pages[] is
 +		 * reliable, as we may choose to reuse the existing page cache
 +		 * and free the allocated page.
 +		 */
 +		p = eb->pages[i];
- 		spin_lock(&mapping->private_lock);
++		spin_lock(&mapping->i_private_lock);
  		/* Should not fail, as we have preallocated the memory */
  		ret = attach_extent_buffer_page(eb, p, prealloc);
  		ASSERT(!ret);
@@@ -3640,17 -3558,10 +3640,17 @@@
  		 * Thus needs no special handling in error path.
  		 */
  		btrfs_page_inc_eb_refs(fs_info, p);
- 		spin_unlock(&mapping->private_lock);
+ 		spin_unlock(&mapping->i_private_lock);
  
  		WARN_ON(btrfs_page_test_dirty(fs_info, p, eb->start, eb->len));
 -		eb->pages[i] = p;
 +
 +		/*
 +		 * Check if the current page is physically contiguous with previous eb
 +		 * page.
 +		 */
 +		if (i && eb->pages[i - 1] + 1 != p)
 +			page_contig = false;
 +
  		if (!btrfs_page_test_uptodate(fs_info, p, eb->start, eb->len))
  			uptodate = 0;
  
@@@ -4713,11 -4560,11 +4713,11 @@@ static int try_release_subpage_extent_b
  		release_extent_buffer(eb);
  	}
  	/*
 -	 * Finally to check if we have cleared page private, as if we have
 -	 * released all ebs in the page, the page private should be cleared now.
 +	 * Finally to check if we have cleared folio private, as if we have
 +	 * released all ebs in the page, the folio private should be cleared now.
  	 */
- 	spin_lock(&page->mapping->private_lock);
+ 	spin_lock(&page->mapping->i_private_lock);
 -	if (!PagePrivate(page))
 +	if (!folio_test_private(page_folio(page)))
  		ret = 1;
  	else
  		ret = 0;
@@@ -4735,12 -4581,12 +4735,12 @@@ int try_release_extent_buffer(struct pa
  		return try_release_subpage_extent_buffer(page);
  
  	/*
 -	 * We need to make sure nobody is changing page->private, as we rely on
 -	 * page->private as the pointer to extent buffer.
 +	 * We need to make sure nobody is changing folio private, as we rely on
 +	 * folio private as the pointer to extent buffer.
  	 */
- 	spin_lock(&page->mapping->private_lock);
+ 	spin_lock(&page->mapping->i_private_lock);
 -	if (!PagePrivate(page)) {
 +	if (!folio_test_private(folio)) {
- 		spin_unlock(&page->mapping->private_lock);
+ 		spin_unlock(&page->mapping->i_private_lock);
  		return 1;
  	}
  

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2023-11-26 22:20 Stephen Rothwell
  2023-11-28 21:33 ` Nathan Chancellor
  0 siblings, 1 reply; 33+ messages in thread
From: Stephen Rothwell @ 2023-11-26 22:20 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: David Sterba, Jan Kara, Josef Bacik, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 839 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/super.c

between commit:

  2f2cfead5107 ("btrfs: remove old mount API code")

from the btrfs tree and commit:

  ead622674df5 ("btrfs: Do not restrict writes to btrfs devices")

from the vfs-brauner tree.

I fixed it up (the former removed the funtion updated by the latter, but
a further fix may be required to implement the intent of the latter?) 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.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2023-11-26 22:14 Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2023-11-26 22:14 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: David Sterba, Linux Kernel Mailing List, Linux Next Mailing List,
	Matthew Wilcox (Oracle), Qu Wenruo

[-- Attachment #1: Type: text/plain, Size: 7344 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got conflicts in:

  fs/btrfs/extent_io.c
  fs/btrfs/subpage.c

between commit:

  16aee93de711 ("btrfs: migrate to use folio private instead of page private")

from the btrfs tree and commit:

  600f111ef51d ("fs: Rename mapping private members")

from the vfs-brauner 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/extent_io.c
index 40cf80af88b1,3431a53bf3fd..000000000000
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@@ -878,13 -870,13 +878,13 @@@ static int attach_extent_buffer_page(st
  	 * will not race with any other ebs.
  	 */
  	if (page->mapping)
- 		lockdep_assert_held(&page->mapping->private_lock);
+ 		lockdep_assert_held(&page->mapping->i_private_lock);
  
  	if (fs_info->nodesize >= PAGE_SIZE) {
 -		if (!PagePrivate(page))
 -			attach_page_private(page, eb);
 +		if (!folio_test_private(folio))
 +			folio_attach_private(folio, eb);
  		else
 -			WARN_ON(page->private != (unsigned long)eb);
 +			WARN_ON(folio_get_private(folio) != eb);
  		return 0;
  	}
  
@@@ -1748,9 -1736,9 +1748,9 @@@ static int submit_eb_subpage(struct pag
  		 * Take private lock to ensure the subpage won't be detached
  		 * in the meantime.
  		 */
- 		spin_lock(&page->mapping->private_lock);
+ 		spin_lock(&page->mapping->i_private_lock);
 -		if (!PagePrivate(page)) {
 +		if (!folio_test_private(folio)) {
- 			spin_unlock(&page->mapping->private_lock);
+ 			spin_unlock(&page->mapping->i_private_lock);
  			break;
  		}
  		spin_lock_irqsave(&subpage->lock, flags);
@@@ -1824,9 -1811,9 +1824,9 @@@ static int submit_eb_page(struct page *
  	if (btrfs_sb(page->mapping->host->i_sb)->nodesize < PAGE_SIZE)
  		return submit_eb_subpage(page, wbc);
  
- 	spin_lock(&mapping->private_lock);
+ 	spin_lock(&mapping->i_private_lock);
 -	if (!PagePrivate(page)) {
 +	if (!folio_test_private(folio)) {
- 		spin_unlock(&mapping->private_lock);
+ 		spin_unlock(&mapping->i_private_lock);
  		return 0;
  	}
  
@@@ -3067,13 -3054,12 +3067,13 @@@ static int extent_buffer_under_io(cons
  
  static bool page_range_has_eb(struct btrfs_fs_info *fs_info, struct page *page)
  {
 +	struct folio *folio = page_folio(page);
  	struct btrfs_subpage *subpage;
  
- 	lockdep_assert_held(&page->mapping->private_lock);
+ 	lockdep_assert_held(&page->mapping->i_private_lock);
  
 -	if (PagePrivate(page)) {
 -		subpage = (struct btrfs_subpage *)page->private;
 +	if (folio_test_private(folio)) {
 +		subpage = folio_get_private(folio);
  		if (atomic_read(&subpage->eb_refs))
  			return true;
  		/*
@@@ -3090,18 -3076,17 +3090,18 @@@ static void detach_extent_buffer_page(s
  {
  	struct btrfs_fs_info *fs_info = eb->fs_info;
  	const bool mapped = !test_bit(EXTENT_BUFFER_UNMAPPED, &eb->bflags);
 +	struct folio *folio = page_folio(page);
  
  	/*
 -	 * For mapped eb, we're going to change the page private, which should
 +	 * For mapped eb, we're going to change the folio private, which should
- 	 * be done under the private_lock.
+ 	 * be done under the i_private_lock.
  	 */
  	if (mapped)
- 		spin_lock(&page->mapping->private_lock);
+ 		spin_lock(&page->mapping->i_private_lock);
  
 -	if (!PagePrivate(page)) {
 +	if (!folio_test_private(folio)) {
  		if (mapped)
- 			spin_unlock(&page->mapping->private_lock);
+ 			spin_unlock(&page->mapping->i_private_lock);
  		return;
  	}
  
@@@ -3117,11 -3103,14 +3117,11 @@@
  			BUG_ON(test_bit(EXTENT_BUFFER_DIRTY, &eb->bflags));
  			BUG_ON(PageDirty(page));
  			BUG_ON(PageWriteback(page));
 -			/*
 -			 * We need to make sure we haven't be attached
 -			 * to a new eb.
 -			 */
 -			detach_page_private(page);
 +			/* We need to make sure we haven't be attached to a new eb. */
 +			folio_detach_private(folio);
  		}
  		if (mapped)
- 			spin_unlock(&page->mapping->private_lock);
+ 			spin_unlock(&page->mapping->i_private_lock);
  		return;
  	}
  
@@@ -3526,8 -3513,8 +3526,8 @@@ struct extent_buffer *alloc_extent_buff
  	num_pages = num_extent_pages(eb);
  
  	/*
 -	 * Preallocate page->private for subpage case, so that we won't
 +	 * Preallocate folio private for subpage case, so that we won't
- 	 * allocate memory with private_lock nor page lock hold.
+ 	 * allocate memory with i_private_lock nor page lock hold.
  	 *
  	 * The memory will be freed by attach_extent_buffer_page() or freed
  	 * manually if we exit earlier.
@@@ -4638,11 -4560,11 +4638,11 @@@ static int try_release_subpage_extent_b
  		release_extent_buffer(eb);
  	}
  	/*
 -	 * Finally to check if we have cleared page private, as if we have
 -	 * released all ebs in the page, the page private should be cleared now.
 +	 * Finally to check if we have cleared folio private, as if we have
 +	 * released all ebs in the page, the folio private should be cleared now.
  	 */
- 	spin_lock(&page->mapping->private_lock);
+ 	spin_lock(&page->mapping->i_private_lock);
 -	if (!PagePrivate(page))
 +	if (!folio_test_private(page_folio(page)))
  		ret = 1;
  	else
  		ret = 0;
@@@ -4660,12 -4581,12 +4660,12 @@@ int try_release_extent_buffer(struct pa
  		return try_release_subpage_extent_buffer(page);
  
  	/*
 -	 * We need to make sure nobody is changing page->private, as we rely on
 -	 * page->private as the pointer to extent buffer.
 +	 * We need to make sure nobody is changing folio private, as we rely on
 +	 * folio private as the pointer to extent buffer.
  	 */
- 	spin_lock(&page->mapping->private_lock);
+ 	spin_lock(&page->mapping->i_private_lock);
 -	if (!PagePrivate(page)) {
 +	if (!folio_test_private(folio)) {
- 		spin_unlock(&page->mapping->private_lock);
+ 		spin_unlock(&page->mapping->i_private_lock);
  		return 1;
  	}
  
diff --cc fs/btrfs/subpage.c
index caf0013f2545,2347cf15278b..000000000000
--- a/fs/btrfs/subpage.c
+++ b/fs/btrfs/subpage.c
@@@ -202,10 -199,10 +202,10 @@@ void btrfs_page_inc_eb_refs(const struc
  	if (!btrfs_is_subpage(fs_info, page))
  		return;
  
 -	ASSERT(PagePrivate(page) && page->mapping);
 +	ASSERT(folio_test_private(folio) && page->mapping);
- 	lockdep_assert_held(&page->mapping->private_lock);
+ 	lockdep_assert_held(&page->mapping->i_private_lock);
  
 -	subpage = (struct btrfs_subpage *)page->private;
 +	subpage = folio_get_private(folio);
  	atomic_inc(&subpage->eb_refs);
  }
  
@@@ -218,10 -214,10 +218,10 @@@ void btrfs_page_dec_eb_refs(const struc
  	if (!btrfs_is_subpage(fs_info, page))
  		return;
  
 -	ASSERT(PagePrivate(page) && page->mapping);
 +	ASSERT(folio_test_private(folio) && page->mapping);
- 	lockdep_assert_held(&page->mapping->private_lock);
+ 	lockdep_assert_held(&page->mapping->i_private_lock);
  
 -	subpage = (struct btrfs_subpage *)page->private;
 +	subpage = folio_get_private(folio);
  	ASSERT(atomic_read(&subpage->eb_refs));
  	atomic_dec(&subpage->eb_refs);
  }

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread
* linux-next: manual merge of the vfs-brauner tree with the btrfs tree
@ 2023-08-15  1:20 Stephen Rothwell
  0 siblings, 0 replies; 33+ messages in thread
From: Stephen Rothwell @ 2023-08-15  1:20 UTC (permalink / raw)
  To: Christian Brauner, David Sterba
  Cc: David Sterba, Jeff Layton, Lee Trager, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]

Hi all,

Today's linux-next merge of the vfs-brauner tree got a conflict in:

  fs/btrfs/inode.c

between commit:

  ea6aa58a9229 ("btrfs: copy dir permission and time when creating a stub subvolume")

from the btrfs tree and commit:

  2a9462de4352 ("btrfs: convert to ctime accessor functions")

from the vfs-brauner tree.

I fixed it up (I think - 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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/btrfs/inode.c
index 06c9ad527458,db7e1a19bb67..000000000000
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -5558,12 -5757,9 +5555,11 @@@ static struct inode *new_simple_dir(str
  	inode->i_opflags &= ~IOP_XATTR;
  	inode->i_fop = &simple_dir_operations;
  	inode->i_mode = S_IFDIR | S_IRUGO | S_IWUSR | S_IXUGO;
- 	inode->i_mtime = current_time(inode);
+ 	inode->i_mtime = inode_set_ctime_current(inode);
 -	inode->i_atime = inode->i_mtime;
 +	inode->i_atime = dir->i_atime;
- 	inode->i_ctime = dir->i_ctime;
  	BTRFS_I(inode)->i_otime = inode->i_mtime;
 +	inode->i_uid = dir->i_uid;
 +	inode->i_gid = dir->i_gid;
  
  	return inode;
  }

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2025-12-02  0:58 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-08 23:48 linux-next: manual merge of the vfs-brauner tree with the btrfs tree Stephen Rothwell
2023-10-09 16:15 ` Christian Brauner
2023-10-10 21:37   ` Stephen Rothwell
2023-10-11  0:24     ` Stephen Rothwell
2023-10-11  9:20     ` David Sterba
2023-10-12 15:42       ` David Sterba
2023-10-23 17:55         ` David Sterba
2023-10-23 21:25           ` Stephen Rothwell
2023-10-24  8:59             ` upcoming merge window: " Christian Brauner
2023-10-24 15:46               ` David Sterba
2023-10-25 13:19                 ` Christian Brauner
2023-10-28 14:10                   ` upcoming merge window: Where did the patches we had intended to depend on go? " Christian Brauner
2023-10-24 15:32             ` linux-next: manual merge of the " David Sterba
2023-10-25  0:09               ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2025-11-02 21:58 Stephen Rothwell
2025-12-02  0:58 ` Stephen Rothwell
2024-10-31 22:22 Stephen Rothwell
2024-10-15 21:51 Stephen Rothwell
2024-11-18 22:16 ` Stephen Rothwell
2024-06-18 11:41 Mark Brown
2024-07-16  0:58 ` Stephen Rothwell
2024-05-03  1:00 Stephen Rothwell
2024-05-14  1:38 ` Stephen Rothwell
2024-04-30 23:42 Stephen Rothwell
2023-12-06 23:32 Stephen Rothwell
2024-01-08 20:56 ` Stephen Rothwell
2023-11-26 22:20 Stephen Rothwell
2023-11-28 21:33 ` Nathan Chancellor
2023-11-29 11:09   ` Jan Kara
2023-11-29 20:50     ` Stephen Rothwell
2024-01-08 20:53       ` Stephen Rothwell
2023-11-26 22:14 Stephen Rothwell
2023-08-15  1:20 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).