Skip to contentSkip to conversation

linux-next: manual merge of the vfs-brauner tree with the ntfs tree

PATCH Mark Brown 1 participant 1 message Oct 13

Subsystems (2)
lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

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

fs/ntfs/inode.c

between commit:

1e03db31119eb ("ntfs: clear stale pagecache on initialized-size extension")

from the ntfs tree and commit:

d874f8060847c ("iomap: pass iomap_iter_next_fn directly instead of struct iomap_ops")

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.

fs/ntfs/inode.c +0 -0
diff --cc fs/ntfs/inode.c
index 206db4e99ef13,cceb42b267051..0000000000000
@@@ -2576,33 -2437,23 +2576,33 @@@ int ntfs_extend_initialized_size(struc
  
  	err = ntfs_attr_map_whole_runlist(ni);
  	if (err)
 -		return err;
 +		goto out;
  
 -	if (!NInoCompressed(ni) && old_init_size < offset) {
 -		err = iomap_zero_range(vi, old_init_size,
 -				       offset - old_init_size,
 -				       NULL, ntfs_seek_iomap_next,
 -				       &ntfs_iomap_folio_ops, NULL);
 -		if (err)
 -			return err;
 +	if (!NInoCompressed(ni)) {
 +		/*
 +		 * Zeroing skips holes, so discard cached uninitialized bytes
 +		 * before making them visible to writes or shared mappings.
 +		 */
 +		clear_size = max_t(loff_t, i_size_read(vi), new_size);
 +		truncate_pagecache_range(vi, old_init_size, clear_size - 1);
 +
 +		if (old_init_size < offset) {
 +			err = iomap_zero_range(vi, old_init_size,
 +					       offset - old_init_size,
- 					       NULL, &ntfs_seek_iomap_ops,
++					       NULL, ntfs_seek_iomap_next,
 +					       &ntfs_iomap_folio_ops, NULL);
 +			if (err)
 +				goto out;
 +		}
  	}
  
 -
 -	mutex_lock(&ni->mrec_lock);
 +	mutex_lock(&mrec_ni->mrec_lock);
  	err = ntfs_attr_set_initialized_size(ni, new_size);
 -	mutex_unlock(&ni->mrec_lock);
 +	mutex_unlock(&mrec_ni->mrec_lock);
  	if (err)
  		truncate_setsize(vi, old_init_size);
 +out:
 +	filemap_invalidate_unlock(vi->i_mapping);
  	return err;
  }