linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the nvdimm tree with the ext4 tree
@ 2017-11-03  6:59 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2017-11-03  6:59 UTC (permalink / raw)
  To: Dan Williams, Theodore Ts'o
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List, Jan Kara,
	Christoph Hellwig, Andreas Gruenbacher

Hi Dan,

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

  fs/ext4/inode.c

between commit:

  545052e9e35a ("ext4: Switch to iomap for SEEK_HOLE / SEEK_DATA")

from the ext4 tree and commit:

  31bc9582e43d ("ext4: Support for synchronous DAX faults")

from the nvdimm 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.

Thanks, Dan, for the heads up and sample resolutions.
-- 
Cheers,
Stephen Rothwell

diff --cc fs/ext4/inode.c
index 14bff666d2fc,13a198924a0f..000000000000
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@@ -3394,6 -3393,20 +3394,19 @@@ static int ext4_releasepage(struct pag
  		return try_to_free_buffers(page);
  }
  
 -#ifdef CONFIG_FS_DAX
+ static bool ext4_inode_datasync_dirty(struct inode *inode)
+ {
+ 	journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
+ 
+ 	if (journal)
+ 		return !jbd2_transaction_committed(journal,
+ 					EXT4_I(inode)->i_datasync_tid);
+ 	/* Any metadata buffers to write? */
+ 	if (!list_empty(&inode->i_mapping->private_list))
+ 		return true;
+ 	return inode->i_state & I_DIRTY_DATASYNC;
+ }
+ 
  static int ext4_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
  			    unsigned flags, struct iomap *iomap)
  {

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

* Re: linux-next: manual merge of the nvdimm tree with the ext4 tree
  2021-12-16  8:28 ` Christoph Hellwig
@ 2021-12-17  8:24   ` Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2021-12-17  8:24 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: broonie, Dan Williams, Linux Kernel Mailing List,
	Linux Next Mailing List, Lukas Czerner, Theodore Ts'o

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

Hi all,

On Thu, 16 Dec 2021 09:28:33 +0100 Christoph Hellwig <hch@lst.de> wrote:
>
> On Fri, Dec 10, 2021 at 05:47:40PM +0000, broonie@kernel.org wrote:
> > I'm not comfortable with resolving this in something as critical as ext4
> > at this point on a Friday evening with the code motion that's going on
> > so I've dropped the nvdimm tree for today, I'll look again on Monday.  
> 
> Given that it is Thursday now I've done the (pretty simple) merge
> myself, it can be found here:
> 
> http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/ext4-dax-merge

I have used that today.

-- 
Cheers,
Stephen Rothwell

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

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

* Re: linux-next: manual merge of the nvdimm tree with the ext4 tree
  2021-12-10 17:47 broonie
@ 2021-12-16  8:28 ` Christoph Hellwig
  2021-12-17  8:24   ` Stephen Rothwell
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2021-12-16  8:28 UTC (permalink / raw)
  To: broonie
  Cc: Dan Williams, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Lukas Czerner, Theodore Ts'o

On Fri, Dec 10, 2021 at 05:47:40PM +0000, broonie@kernel.org wrote:
> I'm not comfortable with resolving this in something as critical as ext4
> at this point on a Friday evening with the code motion that's going on
> so I've dropped the nvdimm tree for today, I'll look again on Monday.

Given that it is Thursday now I've done the (pretty simple) merge
myself, it can be found here:

http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/ext4-dax-merge

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

* linux-next: manual merge of the nvdimm tree with the ext4 tree
@ 2021-12-10 17:47 broonie
  2021-12-16  8:28 ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: broonie @ 2021-12-10 17:47 UTC (permalink / raw)
  To: Dan Williams
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Lukas Czerner, Theodore Ts'o

Hi all,

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

  fs/ext4/super.c

between at least commits:

  7edfd85b1ffd3 ("ext4: Completely separate options parsing and sb setup")
  bdd3c50d83bf7 ("dax: remove bdev_dax_supported")

from the ext4 tree and commits:

  89b93a7b15f75 ("ext4: cleanup the dax handling in ext4_fill_super")
  7b0800d00dae8 ("dax: remove dax_capable")

from the nvdimm tree.

I'm not comfortable with resolving this in something as critical as ext4
at this point on a Friday evening with the code motion that's going on
so I've dropped the nvdimm tree for today, I'll look again on Monday.

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

* linux-next: manual merge of the nvdimm tree with the ext4 tree
@ 2017-11-03  6:17 Stephen Rothwell
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Rothwell @ 2017-11-03  6:17 UTC (permalink / raw)
  To: Dan Williams, Theodore Ts'o
  Cc: Linux-Next Mailing List, Linux Kernel Mailing List,
	Andreas Gruenbacher, Jan Kara

Hi Dan,

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

  fs/dax.c

between commit:

  19fe5f643f89 ("iomap: Switch from blkno to disk offset")

from the ext4 tree and commit:

  cac0def9d075 ("dax: Simplify arguments of dax_insert_mapping()")

from the nvdimm 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.

Thanks, Dan, for the heads up and sample solutions.
-- 
Cheers,
Stephen Rothwell

diff --cc fs/dax.c
index f3a44a7c14b3,78233c716757..000000000000
--- a/fs/dax.c
+++ b/fs/dax.c
@@@ -820,38 -820,42 +820,42 @@@ out
  }
  EXPORT_SYMBOL_GPL(dax_writeback_mapping_range);
  
- static int dax_insert_mapping(struct address_space *mapping,
- 		struct block_device *bdev, struct dax_device *dax_dev,
- 		sector_t sector, size_t size, void *entry,
- 		struct vm_area_struct *vma, struct vm_fault *vmf)
+ static sector_t dax_iomap_sector(struct iomap *iomap, loff_t pos)
  {
- 	unsigned long vaddr = vmf->address;
- 	void *ret, *kaddr;
 -	return iomap->blkno + (((pos & PAGE_MASK) - iomap->offset) >> 9);
++	return (iomap->addr + (pos & PAGE_MASK) - iomap->offset) >> 9;
+ }
+ 
+ static int dax_iomap_pfn(struct iomap *iomap, loff_t pos, size_t size,
+ 			 pfn_t *pfnp)
+ {
+ 	const sector_t sector = dax_iomap_sector(iomap, pos);
  	pgoff_t pgoff;
+ 	void *kaddr;
  	int id, rc;
- 	pfn_t pfn;
+ 	long length;
  
- 	rc = bdev_dax_pgoff(bdev, sector, size, &pgoff);
+ 	rc = bdev_dax_pgoff(iomap->bdev, sector, size, &pgoff);
  	if (rc)
  		return rc;
- 
  	id = dax_read_lock();
- 	rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), &kaddr, &pfn);
- 	if (rc < 0) {
- 		dax_read_unlock(id);
- 		return rc;
+ 	length = dax_direct_access(iomap->dax_dev, pgoff, PHYS_PFN(size),
+ 				   &kaddr, pfnp);
+ 	if (length < 0) {
+ 		rc = length;
+ 		goto out;
  	}
+ 	rc = -EINVAL;
+ 	if (PFN_PHYS(length) < size)
+ 		goto out;
+ 	if (pfn_t_to_pfn(*pfnp) & (PHYS_PFN(size)-1))
+ 		goto out;
+ 	/* For larger pages we need devmap */
+ 	if (length > 1 && !pfn_t_devmap(*pfnp))
+ 		goto out;
+ 	rc = 0;
+ out:
  	dax_read_unlock(id);
- 
- 	ret = dax_insert_mapping_entry(mapping, vmf, entry, sector, 0);
- 	if (IS_ERR(ret))
- 		return PTR_ERR(ret);
- 
- 	trace_dax_insert_mapping(mapping->host, vmf, ret);
- 	if (vmf->flags & FAULT_FLAG_WRITE)
- 		return vm_insert_mixed_mkwrite(vma, vaddr, pfn);
- 	else
- 		return vm_insert_mixed(vma, vaddr, pfn);
+ 	return rc;
  }
  
  /*

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-03  6:59 linux-next: manual merge of the nvdimm tree with the ext4 tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2021-12-10 17:47 broonie
2021-12-16  8:28 ` Christoph Hellwig
2021-12-17  8:24   ` Stephen Rothwell
2017-11-03  6:17 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).