All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the folio-iomap tree with the nvdimm tree
@ 2021-12-22 10:15 Stephen Rothwell
  2021-12-24  6:24 ` Stephen Rothwell
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2021-12-22 10:15 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Christoph Hellwig, Dan Williams, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

FIXME: Add owner of second tree to To:
       Add author(s)/SOB of conflicting commits.

Today's linux-next merge of the folio-iomap tree got a conflict in:

  fs/iomap/buffered-io.c

between commit:

  de291b590286 ("iomap: turn the byte variable in iomap_zero_iter into a ssize_t")

from the nvdimm tree and commits:

  a25def1fe568 ("iomap: Convert __iomap_zero_iter to use a folio")
  4d7bd0eb72e5 ("iomap: Inline __iomap_zero_iter into its caller")

from the folio-iomap tree.

I fixed it up (following Matthew's suggestion, I ended up with the
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/iomap/buffered-io.c
index ff541190fc73,c6b3a148e898..c938bbad075e
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@@ -888,21 -908,34 +907,25 @@@ static loff_t iomap_zero_iter(struct io
  		return length;
  
  	do {
- 		unsigned offset = offset_in_page(pos);
- 		ssize_t bytes = min_t(u64, PAGE_SIZE - offset, length);
- 		struct page *page;
+ 		struct folio *folio;
  		int status;
+ 		size_t offset;
+ 		size_t bytes = min_t(u64, SIZE_MAX, length);
  
- 		status = iomap_write_begin(iter, pos, bytes, &page);
 -		if (IS_DAX(iter->inode)) {
 -			s64 tmp = dax_iomap_zero(pos, bytes, iomap);
 -			if (tmp < 0)
 -				return tmp;
 -			bytes = tmp;
 -			goto good;
 -		}
 -
+ 		status = iomap_write_begin(iter, pos, bytes, &folio);
  		if (status)
  			return status;
  
- 		zero_user(page, offset, bytes);
- 		mark_page_accessed(page);
+ 		offset = offset_in_folio(folio, pos);
+ 		if (bytes > folio_size(folio) - offset)
+ 			bytes = folio_size(folio) - offset;
  
- 		bytes = iomap_write_end(iter, pos, bytes, bytes, page);
- 		if (bytes < 0)
- 			return bytes;
+ 		folio_zero_range(folio, offset, bytes);
+ 		folio_mark_accessed(folio);
+ 
+ 		bytes = iomap_write_end(iter, pos, bytes, bytes, folio);
 -good:
+ 		if (WARN_ON_ONCE(bytes == 0))
+ 			return -EIO;
  
  		pos += bytes;
  		length -= bytes;

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

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

* Re: linux-next: manual merge of the folio-iomap tree with the nvdimm tree
  2021-12-22 10:15 linux-next: manual merge of the folio-iomap tree with the nvdimm tree Stephen Rothwell
@ 2021-12-24  6:24 ` Stephen Rothwell
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2021-12-24  6:24 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Christoph Hellwig, Dan Williams, Linux Kernel Mailing List,
	Linux Next Mailing List

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

Hi all,

On Wed, 22 Dec 2021 21:15:36 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the folio-iomap tree got a conflict in:
> 
>   fs/iomap/buffered-io.c
> 
> between commit:
> 
>   de291b590286 ("iomap: turn the byte variable in iomap_zero_iter into a ssize_t")
> 
> from the nvdimm tree and commits:
> 
>   a25def1fe568 ("iomap: Convert __iomap_zero_iter to use a folio")
>   4d7bd0eb72e5 ("iomap: Inline __iomap_zero_iter into its caller")
> 
> from the folio-iomap tree.

Thanks to the addition of commit

  9e05e95ca8da ("iomap: Fix error handling in iomap_zero_iter()")

to the nvdimm tree, the resolutions is now as below.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/iomap/buffered-io.c
index d3b1169602fa,c6b3a148e898..000000000000
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@@ -888,19 -908,32 +907,23 @@@ static loff_t iomap_zero_iter(struct io
  		return length;
  
  	do {
- 		unsigned offset = offset_in_page(pos);
- 		ssize_t bytes = min_t(u64, PAGE_SIZE - offset, length);
- 		struct page *page;
+ 		struct folio *folio;
  		int status;
+ 		size_t offset;
+ 		size_t bytes = min_t(u64, SIZE_MAX, length);
  
- 		status = iomap_write_begin(iter, pos, bytes, &page);
 -		if (IS_DAX(iter->inode)) {
 -			s64 tmp = dax_iomap_zero(pos, bytes, iomap);
 -			if (tmp < 0)
 -				return tmp;
 -			bytes = tmp;
 -			goto good;
 -		}
 -
+ 		status = iomap_write_begin(iter, pos, bytes, &folio);
  		if (status)
  			return status;
  
- 		zero_user(page, offset, bytes);
- 		mark_page_accessed(page);
+ 		offset = offset_in_folio(folio, pos);
+ 		if (bytes > folio_size(folio) - offset)
+ 			bytes = folio_size(folio) - offset;
+ 
+ 		folio_zero_range(folio, offset, bytes);
+ 		folio_mark_accessed(folio);
  
- 		bytes = iomap_write_end(iter, pos, bytes, bytes, page);
+ 		bytes = iomap_write_end(iter, pos, bytes, bytes, folio);
 -good:
  		if (WARN_ON_ONCE(bytes == 0))
  			return -EIO;
  

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

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

end of thread, other threads:[~2021-12-24  6:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22 10:15 linux-next: manual merge of the folio-iomap tree with the nvdimm tree Stephen Rothwell
2021-12-24  6:24 ` Stephen Rothwell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.