Re: linux-next: manual merge of the nvdimm tree with the xfs tree

2018-06-01 Thread Dan Williams
On Fri, Jun 1, 2018 at 6:33 PM, Stephen Rothwell  wrote:
> Hi Darrick,
>
> On Fri, 1 Jun 2018 17:59:48 -0700 "Darrick J. Wong"  
> wrote:
>>
>> > +   if (!dax_enabled) {
>> >  -  pr_debug("VFS (%s): error: dax support not enabled\n",
>> >  -  sb->s_id);
>> >  +  pr_debug("%s: error: dax support not enabled\n",
>> >  +  bdevname(bdev, buf));
>> > -   return false;
>> > +   return -EOPNOTSUPP;
>>
>> Hang on a sec, the changes in the xfs tree make this function return a
>> boolean (true for dax-is-supported, false for dax-not-supported), but
>> this change partially reverts the boolean return values.
>
> OK, weird, that is what I though I had done.  Thanks for pointing it
> out (I guess it was getting late :-().
>
>> > }
>> > -
>> > -   return true;
>> > +   return 0;

Good catch Darrick, I missed that too...


Re: linux-next: manual merge of the nvdimm tree with the xfs tree

2018-06-01 Thread Stephen Rothwell
Hi Darrick,

On Fri, 1 Jun 2018 17:59:48 -0700 "Darrick J. Wong"  
wrote:
>
> > +   if (!dax_enabled) {
> >  -  pr_debug("VFS (%s): error: dax support not enabled\n",
> >  -  sb->s_id);
> >  +  pr_debug("%s: error: dax support not enabled\n",
> >  +  bdevname(bdev, buf));
> > -   return false;
> > +   return -EOPNOTSUPP;  
> 
> Hang on a sec, the changes in the xfs tree make this function return a
> boolean (true for dax-is-supported, false for dax-not-supported), but
> this change partially reverts the boolean return values.

OK, weird, that is what I though I had done.  Thanks for pointing it
out (I guess it was getting late :-().

> > }
> > - 
> > -   return true;
> > +   return 0;  
> 
> The merge should retain the 'return false' above and the 'return true'
> here... or possibly just return dax_enabled:
> 
> if (!dax_enabled) {
>   pr_debug(...);
>   pr_debug(...);
> }
> 
> return dax_enabled;

OK, I have fixed up my merge resolution.  The end of that function will
now look like this:

if (IS_ENABLED(CONFIG_FS_DAX_LIMITED) && pfn_t_special(pfn)) {
/*
 * An arch that has enabled the pmem api should also
 * have its drivers support pfn_t_devmap()
 *
 * This is a developer warning and should not trigger in
 * production. dax_flush() will crash since it depends
 * on being able to do (page_address(pfn_to_page())).
 */
WARN_ON(IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API));
dax_enabled = true;
} else if (pfn_t_devmap(pfn)) {
struct dev_pagemap *pgmap;

pgmap = get_dev_pagemap(pfn_t_to_pfn(pfn), NULL);
if (pgmap && pgmap->type == MEMORY_DEVICE_FS_DAX)
dax_enabled = true;
put_dev_pagemap(pgmap);
}

if (!dax_enabled)
pr_debug("%s: error: dax support not enabled\n",
bdevname(bdev, buf));

return dax_enabled;
}
EXPORT_SYMBOL_GPL(__bdev_dax_supported);

-- 
Cheers,
Stephen Rothwell


pgpQM1JB8VUDJ.pgp
Description: OpenPGP digital signature


Re: linux-next: manual merge of the nvdimm tree with the xfs tree

2018-06-01 Thread Darrick J. Wong
On Fri, Jun 01, 2018 at 06:58:46PM +1000, Stephen Rothwell wrote:
> Hi Dan,
> 
> Today's linux-next merge of the nvdimm tree got a conflict in:
> 
>   drivers/dax/super.c
> 
> between commits:
> 
>   ba23cba9b3bd ("fs: allow per-device dax status checking for filesystems")
>   80660f20252d ("dax: change bdev_dax_supported() to support boolean returns")
> 
> from the xfs tree and commit:
> 
>   e76384884344 ("mm: introduce MEMORY_DEVICE_FS_DAX and 
> CONFIG_DEV_PAGEMAP_OPS")
> 
> 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.
> 
> -- 
> Cheers,
> Stephen Rothwell
> diff --cc drivers/dax/super.c
> index 1d7bd96511f0,88672b6f6252..
> --- a/drivers/dax/super.c
> +++ b/drivers/dax/super.c
> @@@ -80,11 -80,13 +80,12 @@@ EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev)
>* This is a library function for filesystems to check if the block device
>* can be mounted with dax option.
>*
>  - * Return: negative errno if unsupported, 0 if supported.
>  + * Return: true if supported, false if unsupported
>*/
>  -int __bdev_dax_supported(struct super_block *sb, int blocksize)
>  +bool __bdev_dax_supported(struct block_device *bdev, int blocksize)
>   {
>  -struct block_device *bdev = sb->s_bdev;
>   struct dax_device *dax_dev;
> + bool dax_enabled = false;
>   pgoff_t pgoff;
>   int err, id;
>   void *kaddr;
> @@@ -134,15 -135,22 +135,22 @@@
>* on being able to do (page_address(pfn_to_page())).
>*/
>   WARN_ON(IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API));
> + dax_enabled = true;
>   } else if (pfn_t_devmap(pfn)) {
> - /* pass */;
> - } else {
> + struct dev_pagemap *pgmap;
> + 
> + pgmap = get_dev_pagemap(pfn_t_to_pfn(pfn), NULL);
> + if (pgmap && pgmap->type == MEMORY_DEVICE_FS_DAX)
> + dax_enabled = true;
> + put_dev_pagemap(pgmap);
> + }
> + 
> + if (!dax_enabled) {
>  -pr_debug("VFS (%s): error: dax support not enabled\n",
>  -sb->s_id);
>  +pr_debug("%s: error: dax support not enabled\n",
>  +bdevname(bdev, buf));
> - return false;
> + return -EOPNOTSUPP;

Hang on a sec, the changes in the xfs tree make this function return a
boolean (true for dax-is-supported, false for dax-not-supported), but
this change partially reverts the boolean return values.

>   }
> - 
> - return true;
> + return 0;

The merge should retain the 'return false' above and the 'return true'
here... or possibly just return dax_enabled:

if (!dax_enabled) {
pr_debug(...);
pr_debug(...);
}

return dax_enabled;

--D

>   }
>   EXPORT_SYMBOL_GPL(__bdev_dax_supported);
>   #endif




Re: linux-next: manual merge of the nvdimm tree with the xfs tree

2018-06-01 Thread Dan Williams
On Fri, Jun 1, 2018 at 1:58 AM, Stephen Rothwell  wrote:
> Hi Dan,
>
> Today's linux-next merge of the nvdimm tree got a conflict in:
>
>   drivers/dax/super.c
>
> between commits:
>
>   ba23cba9b3bd ("fs: allow per-device dax status checking for filesystems")
>   80660f20252d ("dax: change bdev_dax_supported() to support boolean returns")
>
> from the xfs tree and commit:
>
>   e76384884344 ("mm: introduce MEMORY_DEVICE_FS_DAX and 
> CONFIG_DEV_PAGEMAP_OPS")
>
> 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.

Resolution looks good to me Stephen. Thanks for fixing this up, I'll
let Linus know in the libnvdimm pull request.


linux-next: manual merge of the nvdimm tree with the xfs tree

2018-06-01 Thread Stephen Rothwell
Hi Dan,

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

  drivers/dax/super.c

between commits:

  ba23cba9b3bd ("fs: allow per-device dax status checking for filesystems")
  80660f20252d ("dax: change bdev_dax_supported() to support boolean returns")

from the xfs tree and commit:

  e76384884344 ("mm: introduce MEMORY_DEVICE_FS_DAX and CONFIG_DEV_PAGEMAP_OPS")

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.

-- 
Cheers,
Stephen Rothwell
diff --cc drivers/dax/super.c
index 1d7bd96511f0,88672b6f6252..
--- a/drivers/dax/super.c
+++ b/drivers/dax/super.c
@@@ -80,11 -80,13 +80,12 @@@ EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev)
   * This is a library function for filesystems to check if the block device
   * can be mounted with dax option.
   *
 - * Return: negative errno if unsupported, 0 if supported.
 + * Return: true if supported, false if unsupported
   */
 -int __bdev_dax_supported(struct super_block *sb, int blocksize)
 +bool __bdev_dax_supported(struct block_device *bdev, int blocksize)
  {
 -  struct block_device *bdev = sb->s_bdev;
struct dax_device *dax_dev;
+   bool dax_enabled = false;
pgoff_t pgoff;
int err, id;
void *kaddr;
@@@ -134,15 -135,22 +135,22 @@@
 * on being able to do (page_address(pfn_to_page())).
 */
WARN_ON(IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API));
+   dax_enabled = true;
} else if (pfn_t_devmap(pfn)) {
-   /* pass */;
-   } else {
+   struct dev_pagemap *pgmap;
+ 
+   pgmap = get_dev_pagemap(pfn_t_to_pfn(pfn), NULL);
+   if (pgmap && pgmap->type == MEMORY_DEVICE_FS_DAX)
+   dax_enabled = true;
+   put_dev_pagemap(pgmap);
+   }
+ 
+   if (!dax_enabled) {
 -  pr_debug("VFS (%s): error: dax support not enabled\n",
 -  sb->s_id);
 +  pr_debug("%s: error: dax support not enabled\n",
 +  bdevname(bdev, buf));
-   return false;
+   return -EOPNOTSUPP;
}
- 
-   return true;
+   return 0;
  }
  EXPORT_SYMBOL_GPL(__bdev_dax_supported);
  #endif


pgpy7Mt7qxig8.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the nvdimm tree with the xfs tree

2018-03-21 Thread Stephen Rothwell
Hi Dan,

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

  fs/xfs/xfs_inode.h

between commit:

  f5c54717bf2b ("xfs: remove xfs_zero_range")

from the xfs tree and commit:

  6ea4108852e9 ("xfs: prepare xfs_break_layouts() for another layout type")

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.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/xfs/xfs_inode.h
index 132d8aa2afc4,6951d57aae71..
--- a/fs/xfs/xfs_inode.h
+++ b/fs/xfs/xfs_inode.h
@@@ -443,6 -457,12 +457,8 @@@ enum xfs_prealloc_flags 
  
  int   xfs_update_prealloc_flags(struct xfs_inode *ip,
  enum xfs_prealloc_flags flags);
 -int   xfs_zero_eof(struct xfs_inode *ip, xfs_off_t offset,
 -   xfs_fsize_t isize, bool *did_zeroing);
 -int   xfs_zero_range(struct xfs_inode *ip, xfs_off_t pos, xfs_off_t count,
 -  bool *did_zero);
+ int   xfs_break_layouts(struct inode *inode, uint *iolock,
+   enum layout_break_reason reason);
  
  /* from xfs_iops.c */
  extern void xfs_setup_inode(struct xfs_inode *ip);


pgpay6iO1ZjYO.pgp
Description: OpenPGP digital signature