All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-10 16:23 ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: hch, tytso, linux-nvdimm, linux-block, linux-kernel,
	micah.parrish, axboe, adilger.kernel, linux-fsdevel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.  Add alignment check to ext4, ext2, and xfs.

- Patch 1-2 add bdev_dax_supported() which performs all the checks
  necessary for dax mount.
- Patch 3-5 change fillesystems to call bdev_dax_supported().
- Patch 6 is a cleanup to keep dax capability checks consistent.

v4:
 - blkdev_dax_capable() is similar to bdev_dax_supported().
   Manage them consistently. (Dan Williams, Dave Chinner)

v3:
 - Remove boilerplate code from filesytems (Christoph Hellwig)
 - Add a helper function to perform all checks (Dave Chinner)

v2:
 - Use a helper function via ->direct_access for the check.
   (Christoph Hellwig)
 - Call bdev_direct_access() with sector 0 for the check.
   (Boaz Harrosh)

---
Toshi Kani (6):
 1/6 block: Add vfs_msg() interface
 2/6 block: Add bdev_dax_supported() for dax mount checks
 3/6 ext4: Add alignment check for DAX mount
 4/6 ext2: Add alignment check for DAX mount
 5/6 xfs: Add alignment check for DAX mount
 6/6 block: Update blkdev_dax_capable() for consistency

---
 block/ioctl.c          | 30 ----------------
 fs/block_dev.c         | 96 ++++++++++++++++++++++++++++++++++++++++++++++++--
 fs/ext2/super.c        | 11 ++----
 fs/ext4/super.c        | 11 ++----
 fs/xfs/xfs_super.c     | 12 +++----
 include/linux/blkdev.h | 13 +++++++
 include/linux/fs.h     |  8 -----
 7 files changed, 116 insertions(+), 65 deletions(-)
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-10 16:23 ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.  Add alignment check to ext4, ext2, and xfs.

- Patch 1-2 add bdev_dax_supported() which performs all the checks
  necessary for dax mount.
- Patch 3-5 change fillesystems to call bdev_dax_supported().
- Patch 6 is a cleanup to keep dax capability checks consistent.

v4:
 - blkdev_dax_capable() is similar to bdev_dax_supported().
   Manage them consistently. (Dan Williams, Dave Chinner)

v3:
 - Remove boilerplate code from filesytems (Christoph Hellwig)
 - Add a helper function to perform all checks (Dave Chinner)

v2:
 - Use a helper function via ->direct_access for the check.
   (Christoph Hellwig)
 - Call bdev_direct_access() with sector 0 for the check.
   (Boaz Harrosh)

---
Toshi Kani (6):
 1/6 block: Add vfs_msg() interface
 2/6 block: Add bdev_dax_supported() for dax mount checks
 3/6 ext4: Add alignment check for DAX mount
 4/6 ext2: Add alignment check for DAX mount
 5/6 xfs: Add alignment check for DAX mount
 6/6 block: Update blkdev_dax_capable() for consistency

---
 block/ioctl.c          | 30 ----------------
 fs/block_dev.c         | 96 ++++++++++++++++++++++++++++++++++++++++++++++++--
 fs/ext2/super.c        | 11 ++----
 fs/ext4/super.c        | 11 ++----
 fs/xfs/xfs_super.c     | 12 +++----
 include/linux/blkdev.h | 13 +++++++
 include/linux/fs.h     |  8 -----
 7 files changed, 116 insertions(+), 65 deletions(-)

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

* [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-10 16:23 ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.  Add alignment check to ext4, ext2, and xfs.

- Patch 1-2 add bdev_dax_supported() which performs all the checks
  necessary for dax mount.
- Patch 3-5 change fillesystems to call bdev_dax_supported().
- Patch 6 is a cleanup to keep dax capability checks consistent.

v4:
 - blkdev_dax_capable() is similar to bdev_dax_supported().
   Manage them consistently. (Dan Williams, Dave Chinner)

v3:
 - Remove boilerplate code from filesytems (Christoph Hellwig)
 - Add a helper function to perform all checks (Dave Chinner)

v2:
 - Use a helper function via ->direct_access for the check.
   (Christoph Hellwig)
 - Call bdev_direct_access() with sector 0 for the check.
   (Boaz Harrosh)

---
Toshi Kani (6):
 1/6 block: Add vfs_msg() interface
 2/6 block: Add bdev_dax_supported() for dax mount checks
 3/6 ext4: Add alignment check for DAX mount
 4/6 ext2: Add alignment check for DAX mount
 5/6 xfs: Add alignment check for DAX mount
 6/6 block: Update blkdev_dax_capable() for consistency

---
 block/ioctl.c          | 30 ----------------
 fs/block_dev.c         | 96 ++++++++++++++++++++++++++++++++++++++++++++++++--
 fs/ext2/super.c        | 11 ++----
 fs/ext4/super.c        | 11 ++----
 fs/xfs/xfs_super.c     | 12 +++----
 include/linux/blkdev.h | 13 +++++++
 include/linux/fs.h     |  8 -----
 7 files changed, 116 insertions(+), 65 deletions(-)

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

* [PATCH v4 1/6] block: Add vfs_msg() interface
  2016-05-10 16:23 ` Toshi Kani
  (?)
@ 2016-05-10 16:23   ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: hch, tytso, linux-nvdimm, linux-block, linux-kernel,
	micah.parrish, axboe, adilger.kernel, linux-fsdevel

In preparation of moving DAX capability checks to the block layer
from filesystem code, add a VFS message interface that aligns with
filesystem's message format.

For instance, a vfs_msg() message followed by XFS messages in case
of a dax mount error may look like:

  VFS (pmem0p1): error: unaligned partition for dax
  XFS (pmem0p1): DAX unsupported by block device. Turning off DAX.
  XFS (pmem0p1): Mounting V5 Filesystem
   :

vfs_msg() is largely based on ext4_msg().

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/block_dev.c         |   12 ++++++++++++
 include/linux/blkdev.h |   11 +++++++++++
 2 files changed, 23 insertions(+)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 20a2c02..7be17c4 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -50,6 +50,18 @@ struct block_device *I_BDEV(struct inode *inode)
 }
 EXPORT_SYMBOL(I_BDEV);
 
+void __vfs_msg(struct super_block *sb, const char *prefix, const char *fmt, ...)
+{
+	struct va_format vaf;
+	va_list args;
+
+	va_start(args, fmt);
+	vaf.fmt = fmt;
+	vaf.va = &args;
+	printk_ratelimited("%sVFS (%s): %pV\n", prefix, sb->s_id, &vaf);
+	va_end(args);
+}
+
 static void bdev_write_inode(struct block_device *bdev)
 {
 	struct inode *inode = bdev->bd_inode;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 669e419..78c48ab 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -767,6 +767,17 @@ static inline void rq_flush_dcache_pages(struct request *rq)
 }
 #endif
 
+#ifdef CONFIG_PRINTK
+#define vfs_msg(sb, level, fmt, ...)				\
+	__vfs_msg(sb, level, fmt, ##__VA_ARGS__)
+#else
+#define vfs_msg(sb, level, fmt, ...)				\
+do {								\
+	no_printk(fmt, ##__VA_ARGS__);				\
+	__vfs_msg(sb, "", " ");					\
+} while (0)
+#endif
+
 extern int blk_register_queue(struct gendisk *disk);
 extern void blk_unregister_queue(struct gendisk *disk);
 extern blk_qc_t generic_make_request(struct bio *bio);
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH v4 1/6] block: Add vfs_msg() interface
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

In preparation of moving DAX capability checks to the block layer
from filesystem code, add a VFS message interface that aligns with
filesystem's message format.

For instance, a vfs_msg() message followed by XFS messages in case
of a dax mount error may look like:

  VFS (pmem0p1): error: unaligned partition for dax
  XFS (pmem0p1): DAX unsupported by block device. Turning off DAX.
  XFS (pmem0p1): Mounting V5 Filesystem
   :

vfs_msg() is largely based on ext4_msg().

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/block_dev.c         |   12 ++++++++++++
 include/linux/blkdev.h |   11 +++++++++++
 2 files changed, 23 insertions(+)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 20a2c02..7be17c4 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -50,6 +50,18 @@ struct block_device *I_BDEV(struct inode *inode)
 }
 EXPORT_SYMBOL(I_BDEV);
 
+void __vfs_msg(struct super_block *sb, const char *prefix, const char *fmt, ...)
+{
+	struct va_format vaf;
+	va_list args;
+
+	va_start(args, fmt);
+	vaf.fmt = fmt;
+	vaf.va = &args;
+	printk_ratelimited("%sVFS (%s): %pV\n", prefix, sb->s_id, &vaf);
+	va_end(args);
+}
+
 static void bdev_write_inode(struct block_device *bdev)
 {
 	struct inode *inode = bdev->bd_inode;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 669e419..78c48ab 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -767,6 +767,17 @@ static inline void rq_flush_dcache_pages(struct request *rq)
 }
 #endif
 
+#ifdef CONFIG_PRINTK
+#define vfs_msg(sb, level, fmt, ...)				\
+	__vfs_msg(sb, level, fmt, ##__VA_ARGS__)
+#else
+#define vfs_msg(sb, level, fmt, ...)				\
+do {								\
+	no_printk(fmt, ##__VA_ARGS__);				\
+	__vfs_msg(sb, "", " ");					\
+} while (0)
+#endif
+
 extern int blk_register_queue(struct gendisk *disk);
 extern void blk_unregister_queue(struct gendisk *disk);
 extern blk_qc_t generic_make_request(struct bio *bio);

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

* [PATCH v4 1/6] block: Add vfs_msg() interface
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

In preparation of moving DAX capability checks to the block layer
from filesystem code, add a VFS message interface that aligns with
filesystem's message format.

For instance, a vfs_msg() message followed by XFS messages in case
of a dax mount error may look like:

  VFS (pmem0p1): error: unaligned partition for dax
  XFS (pmem0p1): DAX unsupported by block device. Turning off DAX.
  XFS (pmem0p1): Mounting V5 Filesystem
   :

vfs_msg() is largely based on ext4_msg().

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/block_dev.c         |   12 ++++++++++++
 include/linux/blkdev.h |   11 +++++++++++
 2 files changed, 23 insertions(+)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 20a2c02..7be17c4 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -50,6 +50,18 @@ struct block_device *I_BDEV(struct inode *inode)
 }
 EXPORT_SYMBOL(I_BDEV);
 
+void __vfs_msg(struct super_block *sb, const char *prefix, const char *fmt, ...)
+{
+	struct va_format vaf;
+	va_list args;
+
+	va_start(args, fmt);
+	vaf.fmt = fmt;
+	vaf.va = &args;
+	printk_ratelimited("%sVFS (%s): %pV\n", prefix, sb->s_id, &vaf);
+	va_end(args);
+}
+
 static void bdev_write_inode(struct block_device *bdev)
 {
 	struct inode *inode = bdev->bd_inode;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 669e419..78c48ab 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -767,6 +767,17 @@ static inline void rq_flush_dcache_pages(struct request *rq)
 }
 #endif
 
+#ifdef CONFIG_PRINTK
+#define vfs_msg(sb, level, fmt, ...)				\
+	__vfs_msg(sb, level, fmt, ##__VA_ARGS__)
+#else
+#define vfs_msg(sb, level, fmt, ...)				\
+do {								\
+	no_printk(fmt, ##__VA_ARGS__);				\
+	__vfs_msg(sb, "", " ");					\
+} while (0)
+#endif
+
 extern int blk_register_queue(struct gendisk *disk);
 extern void blk_unregister_queue(struct gendisk *disk);
 extern blk_qc_t generic_make_request(struct bio *bio);

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

* [PATCH v4 2/6] block: Add bdev_dax_supported() for dax mount checks
  2016-05-10 16:23 ` Toshi Kani
  (?)
@ 2016-05-10 16:23   ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: hch, tytso, linux-nvdimm, linux-block, linux-kernel,
	micah.parrish, axboe, adilger.kernel, linux-fsdevel

DAX imposes additional requirements to a device.  Add
bdev_dax_supported() which performs all the precondition checks
necessary for filesystem to mount the device with dax option.

Also add a new check to verify if a partition is aligned by 4KB.
When a partition is unaligned, any dax read/write access fails,
except for metadata update.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/block_dev.c         |   45 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/blkdev.h |    1 +
 2 files changed, 46 insertions(+)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 7be17c4..db55638 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -509,6 +509,51 @@ long bdev_direct_access(struct block_device *bdev, struct blk_dax_ctl *dax)
 }
 EXPORT_SYMBOL_GPL(bdev_direct_access);
 
+/**
+ * bdev_dax_supported() - Check if the device supports dax for filesystem
+ * @sb: The superblock of the device
+ * @blocksize: The block size of the device
+ *
+ * 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.
+ */
+int bdev_dax_supported(struct super_block *sb, int blocksize)
+{
+	struct blk_dax_ctl dax = {
+		.sector = 0,
+		.size = PAGE_SIZE,
+	};
+	int err;
+
+	if (blocksize != PAGE_SIZE) {
+		vfs_msg(sb, KERN_ERR, "error: unsupported blocksize for dax");
+		return -EINVAL;
+	}
+
+	err = bdev_direct_access(sb->s_bdev, &dax);
+	if (err < 0) {
+		switch (err) {
+		case -EOPNOTSUPP:
+			vfs_msg(sb, KERN_ERR,
+				"error: device does not support dax");
+			break;
+		case -EINVAL:
+			vfs_msg(sb, KERN_ERR,
+				"error: unaligned partition for dax");
+			break;
+		default:
+			vfs_msg(sb, KERN_ERR,
+				"error: dax access failed (%d)", err);
+		}
+		return err;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(bdev_dax_supported);
+
 /*
  * pseudo-fs
  */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 78c48ab..71231a5 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1688,6 +1688,7 @@ extern int bdev_read_page(struct block_device *, sector_t, struct page *);
 extern int bdev_write_page(struct block_device *, sector_t, struct page *,
 						struct writeback_control *);
 extern long bdev_direct_access(struct block_device *, struct blk_dax_ctl *);
+extern int bdev_dax_supported(struct super_block *, int);
 #else /* CONFIG_BLOCK */
 
 struct block_device;
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH v4 2/6] block: Add bdev_dax_supported() for dax mount checks
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

DAX imposes additional requirements to a device.  Add
bdev_dax_supported() which performs all the precondition checks
necessary for filesystem to mount the device with dax option.

Also add a new check to verify if a partition is aligned by 4KB.
When a partition is unaligned, any dax read/write access fails,
except for metadata update.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/block_dev.c         |   45 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/blkdev.h |    1 +
 2 files changed, 46 insertions(+)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 7be17c4..db55638 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -509,6 +509,51 @@ long bdev_direct_access(struct block_device *bdev, struct blk_dax_ctl *dax)
 }
 EXPORT_SYMBOL_GPL(bdev_direct_access);
 
+/**
+ * bdev_dax_supported() - Check if the device supports dax for filesystem
+ * @sb: The superblock of the device
+ * @blocksize: The block size of the device
+ *
+ * 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.
+ */
+int bdev_dax_supported(struct super_block *sb, int blocksize)
+{
+	struct blk_dax_ctl dax = {
+		.sector = 0,
+		.size = PAGE_SIZE,
+	};
+	int err;
+
+	if (blocksize != PAGE_SIZE) {
+		vfs_msg(sb, KERN_ERR, "error: unsupported blocksize for dax");
+		return -EINVAL;
+	}
+
+	err = bdev_direct_access(sb->s_bdev, &dax);
+	if (err < 0) {
+		switch (err) {
+		case -EOPNOTSUPP:
+			vfs_msg(sb, KERN_ERR,
+				"error: device does not support dax");
+			break;
+		case -EINVAL:
+			vfs_msg(sb, KERN_ERR,
+				"error: unaligned partition for dax");
+			break;
+		default:
+			vfs_msg(sb, KERN_ERR,
+				"error: dax access failed (%d)", err);
+		}
+		return err;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(bdev_dax_supported);
+
 /*
  * pseudo-fs
  */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 78c48ab..71231a5 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1688,6 +1688,7 @@ extern int bdev_read_page(struct block_device *, sector_t, struct page *);
 extern int bdev_write_page(struct block_device *, sector_t, struct page *,
 						struct writeback_control *);
 extern long bdev_direct_access(struct block_device *, struct blk_dax_ctl *);
+extern int bdev_dax_supported(struct super_block *, int);
 #else /* CONFIG_BLOCK */
 
 struct block_device;

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

* [PATCH v4 2/6] block: Add bdev_dax_supported() for dax mount checks
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

DAX imposes additional requirements to a device.  Add
bdev_dax_supported() which performs all the precondition checks
necessary for filesystem to mount the device with dax option.

Also add a new check to verify if a partition is aligned by 4KB.
When a partition is unaligned, any dax read/write access fails,
except for metadata update.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/block_dev.c         |   45 +++++++++++++++++++++++++++++++++++++++++++++
 include/linux/blkdev.h |    1 +
 2 files changed, 46 insertions(+)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 7be17c4..db55638 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -509,6 +509,51 @@ long bdev_direct_access(struct block_device *bdev, struct blk_dax_ctl *dax)
 }
 EXPORT_SYMBOL_GPL(bdev_direct_access);
 
+/**
+ * bdev_dax_supported() - Check if the device supports dax for filesystem
+ * @sb: The superblock of the device
+ * @blocksize: The block size of the device
+ *
+ * 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.
+ */
+int bdev_dax_supported(struct super_block *sb, int blocksize)
+{
+	struct blk_dax_ctl dax = {
+		.sector = 0,
+		.size = PAGE_SIZE,
+	};
+	int err;
+
+	if (blocksize != PAGE_SIZE) {
+		vfs_msg(sb, KERN_ERR, "error: unsupported blocksize for dax");
+		return -EINVAL;
+	}
+
+	err = bdev_direct_access(sb->s_bdev, &dax);
+	if (err < 0) {
+		switch (err) {
+		case -EOPNOTSUPP:
+			vfs_msg(sb, KERN_ERR,
+				"error: device does not support dax");
+			break;
+		case -EINVAL:
+			vfs_msg(sb, KERN_ERR,
+				"error: unaligned partition for dax");
+			break;
+		default:
+			vfs_msg(sb, KERN_ERR,
+				"error: dax access failed (%d)", err);
+		}
+		return err;
+	}
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(bdev_dax_supported);
+
 /*
  * pseudo-fs
  */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 78c48ab..71231a5 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1688,6 +1688,7 @@ extern int bdev_read_page(struct block_device *, sector_t, struct page *);
 extern int bdev_write_page(struct block_device *, sector_t, struct page *,
 						struct writeback_control *);
 extern long bdev_direct_access(struct block_device *, struct blk_dax_ctl *);
+extern int bdev_dax_supported(struct super_block *, int);
 #else /* CONFIG_BLOCK */
 
 struct block_device;

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

* [PATCH v4 3/6] ext4: Add alignment check for DAX mount
  2016-05-10 16:23 ` Toshi Kani
  (?)
@ 2016-05-10 16:23   ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: hch, tytso, linux-nvdimm, linux-block, linux-kernel,
	micah.parrish, axboe, adilger.kernel, linux-fsdevel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Reported-by: Micah Parrish <micah.parrish@hpe.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/ext4/super.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 304c712..6925e86 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3416,16 +3416,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	}
 
 	if (sbi->s_mount_opt & EXT4_MOUNT_DAX) {
-		if (blocksize != PAGE_SIZE) {
-			ext4_msg(sb, KERN_ERR,
-					"error: unsupported blocksize for dax");
-			goto failed_mount;
-		}
-		if (!sb->s_bdev->bd_disk->fops->direct_access) {
-			ext4_msg(sb, KERN_ERR,
-					"error: device does not support dax");
+		err = bdev_dax_supported(sb, blocksize);
+		if (err)
 			goto failed_mount;
-		}
 	}
 
 	if (ext4_has_feature_encrypt(sb) && es->s_encryption_level) {
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH v4 3/6] ext4: Add alignment check for DAX mount
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Reported-by: Micah Parrish <micah.parrish@hpe.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/ext4/super.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 304c712..6925e86 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3416,16 +3416,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	}
 
 	if (sbi->s_mount_opt & EXT4_MOUNT_DAX) {
-		if (blocksize != PAGE_SIZE) {
-			ext4_msg(sb, KERN_ERR,
-					"error: unsupported blocksize for dax");
-			goto failed_mount;
-		}
-		if (!sb->s_bdev->bd_disk->fops->direct_access) {
-			ext4_msg(sb, KERN_ERR,
-					"error: device does not support dax");
+		err = bdev_dax_supported(sb, blocksize);
+		if (err)
 			goto failed_mount;
-		}
 	}
 
 	if (ext4_has_feature_encrypt(sb) && es->s_encryption_level) {

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

* [PATCH v4 3/6] ext4: Add alignment check for DAX mount
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Reported-by: Micah Parrish <micah.parrish@hpe.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/ext4/super.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 304c712..6925e86 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3416,16 +3416,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 	}
 
 	if (sbi->s_mount_opt & EXT4_MOUNT_DAX) {
-		if (blocksize != PAGE_SIZE) {
-			ext4_msg(sb, KERN_ERR,
-					"error: unsupported blocksize for dax");
-			goto failed_mount;
-		}
-		if (!sb->s_bdev->bd_disk->fops->direct_access) {
-			ext4_msg(sb, KERN_ERR,
-					"error: device does not support dax");
+		err = bdev_dax_supported(sb, blocksize);
+		if (err)
 			goto failed_mount;
-		}
 	}
 
 	if (ext4_has_feature_encrypt(sb) && es->s_encryption_level) {

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

* [PATCH v4 4/6] ext2: Add alignment check for DAX mount
  2016-05-10 16:23 ` Toshi Kani
  (?)
@ 2016-05-10 16:23   ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: hch, tytso, linux-nvdimm, linux-block, linux-kernel,
	micah.parrish, axboe, adilger.kernel, linux-fsdevel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/ext2/super.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index b78caf2..1d93795 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -922,16 +922,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 	blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
 
 	if (sbi->s_mount_opt & EXT2_MOUNT_DAX) {
-		if (blocksize != PAGE_SIZE) {
-			ext2_msg(sb, KERN_ERR,
-					"error: unsupported blocksize for dax");
+		err = bdev_dax_supported(sb, blocksize);
+		if (err)
 			goto failed_mount;
-		}
-		if (!sb->s_bdev->bd_disk->fops->direct_access) {
-			ext2_msg(sb, KERN_ERR,
-					"error: device does not support dax");
-			goto failed_mount;
-		}
 	}
 
 	/* If the blocksize doesn't match, re-read the thing.. */
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH v4 4/6] ext2: Add alignment check for DAX mount
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/ext2/super.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index b78caf2..1d93795 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -922,16 +922,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 	blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
 
 	if (sbi->s_mount_opt & EXT2_MOUNT_DAX) {
-		if (blocksize != PAGE_SIZE) {
-			ext2_msg(sb, KERN_ERR,
-					"error: unsupported blocksize for dax");
+		err = bdev_dax_supported(sb, blocksize);
+		if (err)
 			goto failed_mount;
-		}
-		if (!sb->s_bdev->bd_disk->fops->direct_access) {
-			ext2_msg(sb, KERN_ERR,
-					"error: device does not support dax");
-			goto failed_mount;
-		}
 	}
 
 	/* If the blocksize doesn't match, re-read the thing.. */

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

* [PATCH v4 4/6] ext2: Add alignment check for DAX mount
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/ext2/super.c |   11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index b78caf2..1d93795 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -922,16 +922,9 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 	blocksize = BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
 
 	if (sbi->s_mount_opt & EXT2_MOUNT_DAX) {
-		if (blocksize != PAGE_SIZE) {
-			ext2_msg(sb, KERN_ERR,
-					"error: unsupported blocksize for dax");
+		err = bdev_dax_supported(sb, blocksize);
+		if (err)
 			goto failed_mount;
-		}
-		if (!sb->s_bdev->bd_disk->fops->direct_access) {
-			ext2_msg(sb, KERN_ERR,
-					"error: device does not support dax");
-			goto failed_mount;
-		}
 	}
 
 	/* If the blocksize doesn't match, re-read the thing.. */

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

* [PATCH v4 5/6] xfs: Add alignment check for DAX mount
  2016-05-10 16:23 ` Toshi Kani
  (?)
@ 2016-05-10 16:23   ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: hch, tytso, linux-nvdimm, linux-block, linux-kernel,
	micah.parrish, axboe, adilger.kernel, linux-fsdevel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/xfs/xfs_super.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 187e14b..39f4e6a 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1558,14 +1558,12 @@ xfs_fs_fill_super(
 
 	if (mp->m_flags & XFS_MOUNT_DAX) {
 		xfs_warn(mp,
-	"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
-		if (sb->s_blocksize != PAGE_SIZE) {
-			xfs_alert(mp,
-		"Filesystem block size invalid for DAX Turning DAX off.");
-			mp->m_flags &= ~XFS_MOUNT_DAX;
-		} else if (!sb->s_bdev->bd_disk->fops->direct_access) {
+		"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
+
+		error = bdev_dax_supported(sb, sb->s_blocksize);
+		if (error) {
 			xfs_alert(mp,
-		"Block device does not support DAX Turning DAX off.");
+			"DAX unsupported by block device. Turning off DAX.");
 			mp->m_flags &= ~XFS_MOUNT_DAX;
 		}
 	}
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH v4 5/6] xfs: Add alignment check for DAX mount
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/xfs/xfs_super.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 187e14b..39f4e6a 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1558,14 +1558,12 @@ xfs_fs_fill_super(
 
 	if (mp->m_flags & XFS_MOUNT_DAX) {
 		xfs_warn(mp,
-	"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
-		if (sb->s_blocksize != PAGE_SIZE) {
-			xfs_alert(mp,
-		"Filesystem block size invalid for DAX Turning DAX off.");
-			mp->m_flags &= ~XFS_MOUNT_DAX;
-		} else if (!sb->s_bdev->bd_disk->fops->direct_access) {
+		"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
+
+		error = bdev_dax_supported(sb, sb->s_blocksize);
+		if (error) {
 			xfs_alert(mp,
-		"Block device does not support DAX Turning DAX off.");
+			"DAX unsupported by block device. Turning off DAX.");
 			mp->m_flags &= ~XFS_MOUNT_DAX;
 		}
 	}

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

* [PATCH v4 5/6] xfs: Add alignment check for DAX mount
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

When a partition is not aligned by 4KB, mount -o dax succeeds,
but any read/write access to the filesystem fails, except for
metadata update.

Call bdev_dax_supported() to perform proper precondition checks
which includes this partition alignment check.

Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 fs/xfs/xfs_super.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 187e14b..39f4e6a 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1558,14 +1558,12 @@ xfs_fs_fill_super(
 
 	if (mp->m_flags & XFS_MOUNT_DAX) {
 		xfs_warn(mp,
-	"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
-		if (sb->s_blocksize != PAGE_SIZE) {
-			xfs_alert(mp,
-		"Filesystem block size invalid for DAX Turning DAX off.");
-			mp->m_flags &= ~XFS_MOUNT_DAX;
-		} else if (!sb->s_bdev->bd_disk->fops->direct_access) {
+		"DAX enabled. Warning: EXPERIMENTAL, use at your own risk");
+
+		error = bdev_dax_supported(sb, sb->s_blocksize);
+		if (error) {
 			xfs_alert(mp,
-		"Block device does not support DAX Turning DAX off.");
+			"DAX unsupported by block device. Turning off DAX.");
 			mp->m_flags &= ~XFS_MOUNT_DAX;
 		}
 	}

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

* [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
  2016-05-10 16:23 ` Toshi Kani
  (?)
@ 2016-05-10 16:23   ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: hch, tytso, linux-nvdimm, linux-block, linux-kernel,
	micah.parrish, axboe, adilger.kernel, linux-fsdevel

blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
to remain as a separate interface for checking dax capability of
a raw block device.

Rename and relocate blkdev_dax_capable() to keep them maintained
consistently, and call bdev_direct_access() for the dax capability
check.

There is no change in the behavior.

Link: https://lkml.org/lkml/2016/5/9/950
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 block/ioctl.c          |   30 ------------------------------
 fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
 include/linux/blkdev.h |    1 +
 include/linux/fs.h     |    8 --------
 4 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/block/ioctl.c b/block/ioctl.c
index 4ff1f92..7eeda07 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -4,7 +4,6 @@
 #include <linux/gfp.h>
 #include <linux/blkpg.h>
 #include <linux/hdreg.h>
-#include <linux/badblocks.h>
 #include <linux/backing-dev.h>
 #include <linux/fs.h>
 #include <linux/blktrace_api.h>
@@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
 		ret == -ENOIOCTLCMD;
 }
 
-#ifdef CONFIG_FS_DAX
-bool blkdev_dax_capable(struct block_device *bdev)
-{
-	struct gendisk *disk = bdev->bd_disk;
-
-	if (!disk->fops->direct_access)
-		return false;
-
-	/*
-	 * If the partition is not aligned on a page boundary, we can't
-	 * do dax I/O to it.
-	 */
-	if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
-			|| (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
-		return false;
-
-	/*
-	 * If the device has known bad blocks, force all I/O through the
-	 * driver / page cache.
-	 *
-	 * TODO: support finer grained dax error handling
-	 */
-	if (disk->bb && disk->bb->count)
-		return false;
-
-	return true;
-}
-#endif
-
 static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
 		unsigned cmd, unsigned long arg)
 {
diff --git a/fs/block_dev.c b/fs/block_dev.c
index db55638..5d79093 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -29,6 +29,7 @@
 #include <linux/log2.h>
 #include <linux/cleancache.h>
 #include <linux/dax.h>
+#include <linux/badblocks.h>
 #include <asm/uaccess.h>
 #include "internal.h"
 
@@ -554,6 +555,40 @@ int bdev_dax_supported(struct super_block *sb, int blocksize)
 }
 EXPORT_SYMBOL_GPL(bdev_dax_supported);
 
+/**
+ * bdev_dax_capable() - Return if the raw device is capable for dax
+ * @bdev: The device for raw block device access
+ */
+bool bdev_dax_capable(struct block_device *bdev)
+{
+	struct gendisk *disk = bdev->bd_disk;
+	struct blk_dax_ctl dax = {
+		.size = PAGE_SIZE,
+	};
+
+	if (!IS_ENABLED(CONFIG_FS_DAX))
+		return false;
+
+	dax.sector = 0;
+	if (bdev_direct_access(bdev, &dax) < 0)
+		return false;
+
+	dax.sector = bdev->bd_part->nr_sects - (PAGE_SIZE / 512);
+	if (bdev_direct_access(bdev, &dax) < 0)
+		return false;
+
+	/*
+	 * If the device has known bad blocks, force all I/O through the
+	 * driver / page cache.
+	 *
+	 * TODO: support finer grained dax error handling
+	 */
+	if (disk->bb && disk->bb->count)
+		return false;
+
+	return true;
+}
+
 /*
  * pseudo-fs
  */
@@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 
 			if (!ret) {
 				bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
-				if (!blkdev_dax_capable(bdev))
+				if (!bdev_dax_capable(bdev))
 					bdev->bd_inode->i_flags &= ~S_DAX;
 			}
 
@@ -1332,7 +1367,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 				goto out_clear;
 			}
 			bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9);
-			if (!blkdev_dax_capable(bdev))
+			if (!bdev_dax_capable(bdev))
 				bdev->bd_inode->i_flags &= ~S_DAX;
 		}
 	} else {
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 71231a5..27cbefe 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1689,6 +1689,7 @@ extern int bdev_write_page(struct block_device *, sector_t, struct page *,
 						struct writeback_control *);
 extern long bdev_direct_access(struct block_device *, struct blk_dax_ctl *);
 extern int bdev_dax_supported(struct super_block *, int);
+extern bool bdev_dax_capable(struct block_device *);
 #else /* CONFIG_BLOCK */
 
 struct block_device;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 70e61b5..8363a10 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2320,14 +2320,6 @@ extern struct super_block *freeze_bdev(struct block_device *);
 extern void emergency_thaw_all(void);
 extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
 extern int fsync_bdev(struct block_device *);
-#ifdef CONFIG_FS_DAX
-extern bool blkdev_dax_capable(struct block_device *bdev);
-#else
-static inline bool blkdev_dax_capable(struct block_device *bdev)
-{
-	return false;
-}
-#endif
 
 extern struct super_block *blockdev_superblock;
 
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
to remain as a separate interface for checking dax capability of
a raw block device.

Rename and relocate blkdev_dax_capable() to keep them maintained
consistently, and call bdev_direct_access() for the dax capability
check.

There is no change in the behavior.

Link: https://lkml.org/lkml/2016/5/9/950
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 block/ioctl.c          |   30 ------------------------------
 fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
 include/linux/blkdev.h |    1 +
 include/linux/fs.h     |    8 --------
 4 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/block/ioctl.c b/block/ioctl.c
index 4ff1f92..7eeda07 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -4,7 +4,6 @@
 #include <linux/gfp.h>
 #include <linux/blkpg.h>
 #include <linux/hdreg.h>
-#include <linux/badblocks.h>
 #include <linux/backing-dev.h>
 #include <linux/fs.h>
 #include <linux/blktrace_api.h>
@@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
 		ret == -ENOIOCTLCMD;
 }
 
-#ifdef CONFIG_FS_DAX
-bool blkdev_dax_capable(struct block_device *bdev)
-{
-	struct gendisk *disk = bdev->bd_disk;
-
-	if (!disk->fops->direct_access)
-		return false;
-
-	/*
-	 * If the partition is not aligned on a page boundary, we can't
-	 * do dax I/O to it.
-	 */
-	if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
-			|| (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
-		return false;
-
-	/*
-	 * If the device has known bad blocks, force all I/O through the
-	 * driver / page cache.
-	 *
-	 * TODO: support finer grained dax error handling
-	 */
-	if (disk->bb && disk->bb->count)
-		return false;
-
-	return true;
-}
-#endif
-
 static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
 		unsigned cmd, unsigned long arg)
 {
diff --git a/fs/block_dev.c b/fs/block_dev.c
index db55638..5d79093 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -29,6 +29,7 @@
 #include <linux/log2.h>
 #include <linux/cleancache.h>
 #include <linux/dax.h>
+#include <linux/badblocks.h>
 #include <asm/uaccess.h>
 #include "internal.h"
 
@@ -554,6 +555,40 @@ int bdev_dax_supported(struct super_block *sb, int blocksize)
 }
 EXPORT_SYMBOL_GPL(bdev_dax_supported);
 
+/**
+ * bdev_dax_capable() - Return if the raw device is capable for dax
+ * @bdev: The device for raw block device access
+ */
+bool bdev_dax_capable(struct block_device *bdev)
+{
+	struct gendisk *disk = bdev->bd_disk;
+	struct blk_dax_ctl dax = {
+		.size = PAGE_SIZE,
+	};
+
+	if (!IS_ENABLED(CONFIG_FS_DAX))
+		return false;
+
+	dax.sector = 0;
+	if (bdev_direct_access(bdev, &dax) < 0)
+		return false;
+
+	dax.sector = bdev->bd_part->nr_sects - (PAGE_SIZE / 512);
+	if (bdev_direct_access(bdev, &dax) < 0)
+		return false;
+
+	/*
+	 * If the device has known bad blocks, force all I/O through the
+	 * driver / page cache.
+	 *
+	 * TODO: support finer grained dax error handling
+	 */
+	if (disk->bb && disk->bb->count)
+		return false;
+
+	return true;
+}
+
 /*
  * pseudo-fs
  */
@@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 
 			if (!ret) {
 				bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
-				if (!blkdev_dax_capable(bdev))
+				if (!bdev_dax_capable(bdev))
 					bdev->bd_inode->i_flags &= ~S_DAX;
 			}
 
@@ -1332,7 +1367,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 				goto out_clear;
 			}
 			bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9);
-			if (!blkdev_dax_capable(bdev))
+			if (!bdev_dax_capable(bdev))
 				bdev->bd_inode->i_flags &= ~S_DAX;
 		}
 	} else {
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 71231a5..27cbefe 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1689,6 +1689,7 @@ extern int bdev_write_page(struct block_device *, sector_t, struct page *,
 						struct writeback_control *);
 extern long bdev_direct_access(struct block_device *, struct blk_dax_ctl *);
 extern int bdev_dax_supported(struct super_block *, int);
+extern bool bdev_dax_capable(struct block_device *);
 #else /* CONFIG_BLOCK */
 
 struct block_device;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 70e61b5..8363a10 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2320,14 +2320,6 @@ extern struct super_block *freeze_bdev(struct block_device *);
 extern void emergency_thaw_all(void);
 extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
 extern int fsync_bdev(struct block_device *);
-#ifdef CONFIG_FS_DAX
-extern bool blkdev_dax_capable(struct block_device *bdev);
-#else
-static inline bool blkdev_dax_capable(struct block_device *bdev)
-{
-	return false;
-}
-#endif
 
 extern struct super_block *blockdev_superblock;
 

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

* [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-10 16:23   ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 16:23 UTC (permalink / raw)
  To: dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	toshi.kani, micah.parrish, linux-nvdimm, linux-fsdevel,
	linux-block, linux-kernel

blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
to remain as a separate interface for checking dax capability of
a raw block device.

Rename and relocate blkdev_dax_capable() to keep them maintained
consistently, and call bdev_direct_access() for the dax capability
check.

There is no change in the behavior.

Link: https://lkml.org/lkml/2016/5/9/950
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Jens Axboe <axboe@fb.com>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <boaz@plexistor.com>
---
 block/ioctl.c          |   30 ------------------------------
 fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
 include/linux/blkdev.h |    1 +
 include/linux/fs.h     |    8 --------
 4 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/block/ioctl.c b/block/ioctl.c
index 4ff1f92..7eeda07 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -4,7 +4,6 @@
 #include <linux/gfp.h>
 #include <linux/blkpg.h>
 #include <linux/hdreg.h>
-#include <linux/badblocks.h>
 #include <linux/backing-dev.h>
 #include <linux/fs.h>
 #include <linux/blktrace_api.h>
@@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
 		ret == -ENOIOCTLCMD;
 }
 
-#ifdef CONFIG_FS_DAX
-bool blkdev_dax_capable(struct block_device *bdev)
-{
-	struct gendisk *disk = bdev->bd_disk;
-
-	if (!disk->fops->direct_access)
-		return false;
-
-	/*
-	 * If the partition is not aligned on a page boundary, we can't
-	 * do dax I/O to it.
-	 */
-	if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
-			|| (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
-		return false;
-
-	/*
-	 * If the device has known bad blocks, force all I/O through the
-	 * driver / page cache.
-	 *
-	 * TODO: support finer grained dax error handling
-	 */
-	if (disk->bb && disk->bb->count)
-		return false;
-
-	return true;
-}
-#endif
-
 static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
 		unsigned cmd, unsigned long arg)
 {
diff --git a/fs/block_dev.c b/fs/block_dev.c
index db55638..5d79093 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -29,6 +29,7 @@
 #include <linux/log2.h>
 #include <linux/cleancache.h>
 #include <linux/dax.h>
+#include <linux/badblocks.h>
 #include <asm/uaccess.h>
 #include "internal.h"
 
@@ -554,6 +555,40 @@ int bdev_dax_supported(struct super_block *sb, int blocksize)
 }
 EXPORT_SYMBOL_GPL(bdev_dax_supported);
 
+/**
+ * bdev_dax_capable() - Return if the raw device is capable for dax
+ * @bdev: The device for raw block device access
+ */
+bool bdev_dax_capable(struct block_device *bdev)
+{
+	struct gendisk *disk = bdev->bd_disk;
+	struct blk_dax_ctl dax = {
+		.size = PAGE_SIZE,
+	};
+
+	if (!IS_ENABLED(CONFIG_FS_DAX))
+		return false;
+
+	dax.sector = 0;
+	if (bdev_direct_access(bdev, &dax) < 0)
+		return false;
+
+	dax.sector = bdev->bd_part->nr_sects - (PAGE_SIZE / 512);
+	if (bdev_direct_access(bdev, &dax) < 0)
+		return false;
+
+	/*
+	 * If the device has known bad blocks, force all I/O through the
+	 * driver / page cache.
+	 *
+	 * TODO: support finer grained dax error handling
+	 */
+	if (disk->bb && disk->bb->count)
+		return false;
+
+	return true;
+}
+
 /*
  * pseudo-fs
  */
@@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 
 			if (!ret) {
 				bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
-				if (!blkdev_dax_capable(bdev))
+				if (!bdev_dax_capable(bdev))
 					bdev->bd_inode->i_flags &= ~S_DAX;
 			}
 
@@ -1332,7 +1367,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
 				goto out_clear;
 			}
 			bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9);
-			if (!blkdev_dax_capable(bdev))
+			if (!bdev_dax_capable(bdev))
 				bdev->bd_inode->i_flags &= ~S_DAX;
 		}
 	} else {
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 71231a5..27cbefe 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1689,6 +1689,7 @@ extern int bdev_write_page(struct block_device *, sector_t, struct page *,
 						struct writeback_control *);
 extern long bdev_direct_access(struct block_device *, struct blk_dax_ctl *);
 extern int bdev_dax_supported(struct super_block *, int);
+extern bool bdev_dax_capable(struct block_device *);
 #else /* CONFIG_BLOCK */
 
 struct block_device;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 70e61b5..8363a10 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2320,14 +2320,6 @@ extern struct super_block *freeze_bdev(struct block_device *);
 extern void emergency_thaw_all(void);
 extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
 extern int fsync_bdev(struct block_device *);
-#ifdef CONFIG_FS_DAX
-extern bool blkdev_dax_capable(struct block_device *bdev);
-#else
-static inline bool blkdev_dax_capable(struct block_device *bdev)
-{
-	return false;
-}
-#endif
 
 extern struct super_block *blockdev_superblock;
 

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
  2016-05-10 16:23   ` Toshi Kani
  (?)
@ 2016-05-10 19:49     ` Dan Williams
  -1 siblings, 0 replies; 71+ messages in thread
From: Dan Williams @ 2016-05-10 19:49 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Jan Kara, Christoph Hellwig, linux-block, linux-nvdimm, david,
	linux-kernel, micah.parrish, Jens Axboe, Andreas Dilger, Al Viro,
	linux-fsdevel, Theodore Ts'o

On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
>
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
>
> There is no change in the behavior.
>
> Link: https://lkml.org/lkml/2016/5/9/950
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Jens Axboe <axboe@fb.com>
> Cc: Andreas Dilger <adilger.kernel@dilger.ca>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Boaz Harrosh <boaz@plexistor.com>
> ---
>  block/ioctl.c          |   30 ------------------------------
>  fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
>  include/linux/blkdev.h |    1 +
>  include/linux/fs.h     |    8 --------
>  4 files changed, 38 insertions(+), 40 deletions(-)
>
> diff --git a/block/ioctl.c b/block/ioctl.c
> index 4ff1f92..7eeda07 100644
> --- a/block/ioctl.c
> +++ b/block/ioctl.c
> @@ -4,7 +4,6 @@
>  #include <linux/gfp.h>
>  #include <linux/blkpg.h>
>  #include <linux/hdreg.h>
> -#include <linux/badblocks.h>
>  #include <linux/backing-dev.h>
>  #include <linux/fs.h>
>  #include <linux/blktrace_api.h>
> @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
>                 ret == -ENOIOCTLCMD;
>  }
>
> -#ifdef CONFIG_FS_DAX
> -bool blkdev_dax_capable(struct block_device *bdev)
> -{
> -       struct gendisk *disk = bdev->bd_disk;
> -
> -       if (!disk->fops->direct_access)
> -               return false;
> -
> -       /*
> -        * If the partition is not aligned on a page boundary, we can't
> -        * do dax I/O to it.
> -        */
> -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
> -               return false;
> -
> -       /*
> -        * If the device has known bad blocks, force all I/O through the
> -        * driver / page cache.
> -        *
> -        * TODO: support finer grained dax error handling
> -        */
> -       if (disk->bb && disk->bb->count)
> -               return false;
> -
> -       return true;
> -}
> -#endif

This will collide with my pending change to revert raw block device
dax support, and also with Vishal's DAX error handling changes.  For
coordination purposes I'm thining this should all go on top of the
branch that Vishal is putting together with the dax zeroing changes
from Jan and Christoph as well.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-10 19:49     ` Dan Williams
  0 siblings, 0 replies; 71+ messages in thread
From: Dan Williams @ 2016-05-10 19:49 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Jan Kara, david, Al Viro, Jens Axboe, Christoph Hellwig,
	Boaz Harrosh, Theodore Ts'o, Andreas Dilger, Ross Zwisler,
	micah.parrish, linux-nvdimm, linux-fsdevel, linux-block,
	linux-kernel, Vishal L Verma

On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
>
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
>
> There is no change in the behavior.
>
> Link: https://lkml.org/lkml/2016/5/9/950
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Jens Axboe <axboe@fb.com>
> Cc: Andreas Dilger <adilger.kernel@dilger.ca>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Boaz Harrosh <boaz@plexistor.com>
> ---
>  block/ioctl.c          |   30 ------------------------------
>  fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
>  include/linux/blkdev.h |    1 +
>  include/linux/fs.h     |    8 --------
>  4 files changed, 38 insertions(+), 40 deletions(-)
>
> diff --git a/block/ioctl.c b/block/ioctl.c
> index 4ff1f92..7eeda07 100644
> --- a/block/ioctl.c
> +++ b/block/ioctl.c
> @@ -4,7 +4,6 @@
>  #include <linux/gfp.h>
>  #include <linux/blkpg.h>
>  #include <linux/hdreg.h>
> -#include <linux/badblocks.h>
>  #include <linux/backing-dev.h>
>  #include <linux/fs.h>
>  #include <linux/blktrace_api.h>
> @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
>                 ret == -ENOIOCTLCMD;
>  }
>
> -#ifdef CONFIG_FS_DAX
> -bool blkdev_dax_capable(struct block_device *bdev)
> -{
> -       struct gendisk *disk = bdev->bd_disk;
> -
> -       if (!disk->fops->direct_access)
> -               return false;
> -
> -       /*
> -        * If the partition is not aligned on a page boundary, we can't
> -        * do dax I/O to it.
> -        */
> -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
> -               return false;
> -
> -       /*
> -        * If the device has known bad blocks, force all I/O through the
> -        * driver / page cache.
> -        *
> -        * TODO: support finer grained dax error handling
> -        */
> -       if (disk->bb && disk->bb->count)
> -               return false;
> -
> -       return true;
> -}
> -#endif

This will collide with my pending change to revert raw block device
dax support, and also with Vishal's DAX error handling changes.  For
coordination purposes I'm thining this should all go on top of the
branch that Vishal is putting together with the dax zeroing changes
from Jan and Christoph as well.

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-10 19:49     ` Dan Williams
  0 siblings, 0 replies; 71+ messages in thread
From: Dan Williams @ 2016-05-10 19:49 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Jan Kara, david, Al Viro, Jens Axboe, Christoph Hellwig,
	Boaz Harrosh, Theodore Ts'o, Andreas Dilger, Ross Zwisler,
	micah.parrish, linux-nvdimm@lists.01.org, linux-fsdevel,
	linux-block, linux-kernel, Vishal L Verma

On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
>
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
>
> There is no change in the behavior.
>
> Link: https://lkml.org/lkml/2016/5/9/950
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Jens Axboe <axboe@fb.com>
> Cc: Andreas Dilger <adilger.kernel@dilger.ca>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Boaz Harrosh <boaz@plexistor.com>
> ---
>  block/ioctl.c          |   30 ------------------------------
>  fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
>  include/linux/blkdev.h |    1 +
>  include/linux/fs.h     |    8 --------
>  4 files changed, 38 insertions(+), 40 deletions(-)
>
> diff --git a/block/ioctl.c b/block/ioctl.c
> index 4ff1f92..7eeda07 100644
> --- a/block/ioctl.c
> +++ b/block/ioctl.c
> @@ -4,7 +4,6 @@
>  #include <linux/gfp.h>
>  #include <linux/blkpg.h>
>  #include <linux/hdreg.h>
> -#include <linux/badblocks.h>
>  #include <linux/backing-dev.h>
>  #include <linux/fs.h>
>  #include <linux/blktrace_api.h>
> @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
>                 ret == -ENOIOCTLCMD;
>  }
>
> -#ifdef CONFIG_FS_DAX
> -bool blkdev_dax_capable(struct block_device *bdev)
> -{
> -       struct gendisk *disk = bdev->bd_disk;
> -
> -       if (!disk->fops->direct_access)
> -               return false;
> -
> -       /*
> -        * If the partition is not aligned on a page boundary, we can't
> -        * do dax I/O to it.
> -        */
> -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
> -               return false;
> -
> -       /*
> -        * If the device has known bad blocks, force all I/O through the
> -        * driver / page cache.
> -        *
> -        * TODO: support finer grained dax error handling
> -        */
> -       if (disk->bb && disk->bb->count)
> -               return false;
> -
> -       return true;
> -}
> -#endif

This will collide with my pending change to revert raw block device
dax support, and also with Vishal's DAX error handling changes.  For
coordination purposes I'm thining this should all go on top of the
branch that Vishal is putting together with the dax zeroing changes
from Jan and Christoph as well.

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
  2016-05-10 19:49     ` Dan Williams
  (?)
@ 2016-05-10 21:36       ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 21:36 UTC (permalink / raw)
  To: Dan Williams
  Cc: Jan Kara, Christoph Hellwig, linux-block, linux-nvdimm, david,
	linux-kernel, micah.parrish, Jens Axboe, Andreas Dilger, Al Viro,
	linux-fsdevel, Theodore Ts'o

On Tue, 2016-05-10 at 12:49 -0700, Dan Williams wrote:
> On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> > 
> > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > to remain as a separate interface for checking dax capability of
> > a raw block device.
> > 
> > Rename and relocate blkdev_dax_capable() to keep them maintained
> > consistently, and call bdev_direct_access() for the dax capability
> > check.
> > 
> > There is no change in the behavior.
 :
> > diff --git a/block/ioctl.c b/block/ioctl.c
> > index 4ff1f92..7eeda07 100644
> > --- a/block/ioctl.c
> > +++ b/block/ioctl.c
> > @@ -4,7 +4,6 @@
> >  #include <linux/gfp.h>
> >  #include <linux/blkpg.h>
> >  #include <linux/hdreg.h>
> > -#include <linux/badblocks.h>
> >  #include <linux/backing-dev.h>
> >  #include <linux/fs.h>
> >  #include <linux/blktrace_api.h>
> > @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
> >                 ret == -ENOIOCTLCMD;
> >  }
> > 
> > -#ifdef CONFIG_FS_DAX
> > -bool blkdev_dax_capable(struct block_device *bdev)
> > -{
> > -       struct gendisk *disk = bdev->bd_disk;
> > -
> > -       if (!disk->fops->direct_access)
> > -               return false;
> > -
> > -       /*
> > -        * If the partition is not aligned on a page boundary, we can't
> > -        * do dax I/O to it.
> > -        */
> > -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> > -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE /
> > 512)))
> > -               return false;
> > -
> > -       /*
> > -        * If the device has known bad blocks, force all I/O through
> > the
> > -        * driver / page cache.
> > -        *
> > -        * TODO: support finer grained dax error handling
> > -        */
> > -       if (disk->bb && disk->bb->count)
> > -               return false;
> > -
> > -       return true;
> > -}
> > -#endif
>
> This will collide with my pending change to revert raw block device
> dax support, and also with Vishal's DAX error handling changes.  For
> coordination purposes I'm thining this should all go on top of the
> branch that Vishal is putting together with the dax zeroing changes
> from Jan and Christoph as well.

This patch does not depend on the rest of the series, so it can be handled
separately.  There is a minor conflict -- bdev_dax_capable() is put under
bdev_dax_supported() in the same file.  This should be easy to resolve, but
let me know if you need me to merge it up.

Thanks,
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-10 21:36       ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 21:36 UTC (permalink / raw)
  To: Dan Williams
  Cc: Jan Kara, david, Al Viro, Jens Axboe, Christoph Hellwig,
	Boaz Harrosh, Theodore Ts'o, Andreas Dilger, Ross Zwisler,
	micah.parrish, linux-nvdimm, linux-fsdevel, linux-block,
	linux-kernel, Vishal L Verma

On Tue, 2016-05-10 at 12:49 -0700, Dan Williams wrote:
> On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> > 
> > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > to remain as a separate interface for checking dax capability of
> > a raw block device.
> > 
> > Rename and relocate blkdev_dax_capable() to keep them maintained
> > consistently, and call bdev_direct_access() for the dax capability
> > check.
> > 
> > There is no change in the behavior.
 :
> > diff --git a/block/ioctl.c b/block/ioctl.c
> > index 4ff1f92..7eeda07 100644
> > --- a/block/ioctl.c
> > +++ b/block/ioctl.c
> > @@ -4,7 +4,6 @@
> >  #include <linux/gfp.h>
> >  #include <linux/blkpg.h>
> >  #include <linux/hdreg.h>
> > -#include <linux/badblocks.h>
> >  #include <linux/backing-dev.h>
> >  #include <linux/fs.h>
> >  #include <linux/blktrace_api.h>
> > @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
> >                 ret == -ENOIOCTLCMD;
> >  }
> > 
> > -#ifdef CONFIG_FS_DAX
> > -bool blkdev_dax_capable(struct block_device *bdev)
> > -{
> > -       struct gendisk *disk = bdev->bd_disk;
> > -
> > -       if (!disk->fops->direct_access)
> > -               return false;
> > -
> > -       /*
> > -        * If the partition is not aligned on a page boundary, we can't
> > -        * do dax I/O to it.
> > -        */
> > -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> > -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE /
> > 512)))
> > -               return false;
> > -
> > -       /*
> > -        * If the device has known bad blocks, force all I/O through
> > the
> > -        * driver / page cache.
> > -        *
> > -        * TODO: support finer grained dax error handling
> > -        */
> > -       if (disk->bb && disk->bb->count)
> > -               return false;
> > -
> > -       return true;
> > -}
> > -#endif
>
> This will collide with my pending change to revert raw block device
> dax support, and also with Vishal's DAX error handling changes.  For
> coordination purposes I'm thining this should all go on top of the
> branch that Vishal is putting together with the dax zeroing changes
> from Jan and Christoph as well.

This patch does not depend on the rest of the series, so it can be handled
separately.  There is a minor conflict -- bdev_dax_capable() is put under
bdev_dax_supported() in the same file.  This should be easy to resolve, but
let me know if you need me to merge it up.

Thanks,
-Toshi

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-10 21:36       ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-10 21:36 UTC (permalink / raw)
  To: Dan Williams
  Cc: Jan Kara, david, Al Viro, Jens Axboe, Christoph Hellwig,
	Boaz Harrosh, Theodore Ts'o, Andreas Dilger, Ross Zwisler,
	micah.parrish, linux-nvdimm@lists.01.org, linux-fsdevel,
	linux-block, linux-kernel, Vishal L Verma

On Tue, 2016-05-10 at 12:49 -0700, Dan Williams wrote:
> On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> > 
> > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > to remain as a separate interface for checking dax capability of
> > a raw block device.
> > 
> > Rename and relocate blkdev_dax_capable() to keep them maintained
> > consistently, and call bdev_direct_access() for the dax capability
> > check.
> > 
> > There is no change in the behavior.
 :
> > diff --git a/block/ioctl.c b/block/ioctl.c
> > index 4ff1f92..7eeda07 100644
> > --- a/block/ioctl.c
> > +++ b/block/ioctl.c
> > @@ -4,7 +4,6 @@
> >  #include <linux/gfp.h>
> >  #include <linux/blkpg.h>
> >  #include <linux/hdreg.h>
> > -#include <linux/badblocks.h>
> >  #include <linux/backing-dev.h>
> >  #include <linux/fs.h>
> >  #include <linux/blktrace_api.h>
> > @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
> >                 ret == -ENOIOCTLCMD;
> >  }
> > 
> > -#ifdef CONFIG_FS_DAX
> > -bool blkdev_dax_capable(struct block_device *bdev)
> > -{
> > -       struct gendisk *disk = bdev->bd_disk;
> > -
> > -       if (!disk->fops->direct_access)
> > -               return false;
> > -
> > -       /*
> > -        * If the partition is not aligned on a page boundary, we can't
> > -        * do dax I/O to it.
> > -        */
> > -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> > -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE /
> > 512)))
> > -               return false;
> > -
> > -       /*
> > -        * If the device has known bad blocks, force all I/O through
> > the
> > -        * driver / page cache.
> > -        *
> > -        * TODO: support finer grained dax error handling
> > -        */
> > -       if (disk->bb && disk->bb->count)
> > -               return false;
> > -
> > -       return true;
> > -}
> > -#endif
>
> This will collide with my pending change to revert raw block device
> dax support, and also with Vishal's DAX error handling changes.  For
> coordination purposes I'm thining this should all go on top of the
> branch that Vishal is putting together with the dax zeroing changes
> from Jan and Christoph as well.

This patch does not depend on the rest of the series, so it can be handled
separately.  There is a minor conflict -- bdev_dax_capable() is put under
bdev_dax_supported() in the same file.  This should be easy to resolve, but
let me know if you need me to merge it up.

Thanks,
-Toshi

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
  2016-05-10 16:23   ` Toshi Kani
  (?)
@ 2016-05-11  8:05     ` Jan Kara
  -1 siblings, 0 replies; 71+ messages in thread
From: Jan Kara @ 2016-05-11  8:05 UTC (permalink / raw)
  To: Toshi Kani
  Cc: hch, jack, linux-block, linux-nvdimm, david, linux-kernel,
	micah.parrish, axboe, adilger.kernel, viro, linux-fsdevel, tytso

On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
> 
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
...
> +bool bdev_dax_capable(struct block_device *bdev)
> +{
> +	struct gendisk *disk = bdev->bd_disk;
> +	struct blk_dax_ctl dax = {
> +		.size = PAGE_SIZE,
> +	};
> +
> +	if (!IS_ENABLED(CONFIG_FS_DAX))
> +		return false;

Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
when DAX is not enabled (like it was with blkdev_dax_capable()). That way we
don't grow the kernel for people who don't care about DAX.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-11  8:05     ` Jan Kara
  0 siblings, 0 replies; 71+ messages in thread
From: Jan Kara @ 2016-05-11  8:05 UTC (permalink / raw)
  To: Toshi Kani
  Cc: dan.j.williams, jack, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
> 
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
...
> +bool bdev_dax_capable(struct block_device *bdev)
> +{
> +	struct gendisk *disk = bdev->bd_disk;
> +	struct blk_dax_ctl dax = {
> +		.size = PAGE_SIZE,
> +	};
> +
> +	if (!IS_ENABLED(CONFIG_FS_DAX))
> +		return false;

Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
when DAX is not enabled (like it was with blkdev_dax_capable()). That way we
don't grow the kernel for people who don't care about DAX.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-11  8:05     ` Jan Kara
  0 siblings, 0 replies; 71+ messages in thread
From: Jan Kara @ 2016-05-11  8:05 UTC (permalink / raw)
  To: Toshi Kani
  Cc: dan.j.williams, jack, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
> 
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
...
> +bool bdev_dax_capable(struct block_device *bdev)
> +{
> +	struct gendisk *disk = bdev->bd_disk;
> +	struct blk_dax_ctl dax = {
> +		.size = PAGE_SIZE,
> +	};
> +
> +	if (!IS_ENABLED(CONFIG_FS_DAX))
> +		return false;

Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
when DAX is not enabled (like it was with blkdev_dax_capable()). That way we
don't grow the kernel for people who don't care about DAX.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
  2016-05-10 16:23 ` Toshi Kani
                   ` (7 preceding siblings ...)
  (?)
@ 2016-05-11 13:20 ` Carlos Maiolino
  -1 siblings, 0 replies; 71+ messages in thread
From: Carlos Maiolino @ 2016-05-11 13:20 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel

On Tue, May 10, 2016 at 10:23:51AM -0600, Toshi Kani wrote:
> When a partition is not aligned by 4KB, mount -o dax succeeds,
> but any read/write access to the filesystem fails, except for
> metadata update.  Add alignment check to ext4, ext2, and xfs.
> 
> - Patch 1-2 add bdev_dax_supported() which performs all the checks
>   necessary for dax mount.
> - Patch 3-5 change fillesystems to call bdev_dax_supported().
> - Patch 6 is a cleanup to keep dax capability checks consistent.
> 
> v4:
>  - blkdev_dax_capable() is similar to bdev_dax_supported().
>    Manage them consistently. (Dan Williams, Dave Chinner)
> 
> v3:
>  - Remove boilerplate code from filesytems (Christoph Hellwig)
>  - Add a helper function to perform all checks (Dave Chinner)
> 
> v2:
>  - Use a helper function via ->direct_access for the check.
>    (Christoph Hellwig)
>  - Call bdev_direct_access() with sector 0 for the check.
>    (Boaz Harrosh)
> 
> ---
> Toshi Kani (6):
>  1/6 block: Add vfs_msg() interface
>  2/6 block: Add bdev_dax_supported() for dax mount checks
>  3/6 ext4: Add alignment check for DAX mount
>  4/6 ext2: Add alignment check for DAX mount
>  5/6 xfs: Add alignment check for DAX mount
>  6/6 block: Update blkdev_dax_capable() for consistency
> 

Despite Jan's comment on patch 6, that I should agree, that checking DAX during
compile time is better than at run time, all patches looks good to me, the
conflicts with Dan's patches, also should not cause any semantics change of this
patchset, you can add:

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>


Cheers
> ---
>  block/ioctl.c          | 30 ----------------
>  fs/block_dev.c         | 96 ++++++++++++++++++++++++++++++++++++++++++++++++--
>  fs/ext2/super.c        | 11 ++----
>  fs/ext4/super.c        | 11 ++----
>  fs/xfs/xfs_super.c     | 12 +++----
>  include/linux/blkdev.h | 13 +++++++
>  include/linux/fs.h     |  8 -----
>  7 files changed, 116 insertions(+), 65 deletions(-)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Carlos

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
  2016-05-11  8:05     ` Jan Kara
  (?)
@ 2016-05-11 14:25       ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-11 14:25 UTC (permalink / raw)
  To: Jan Kara
  Cc: hch, tytso, linux-block, linux-nvdimm, david, linux-kernel,
	micah.parrish, axboe, adilger.kernel, viro, linux-fsdevel

On Wed, 2016-05-11 at 10:05 +0200, Jan Kara wrote:
> On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> > 
> > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > to remain as a separate interface for checking dax capability of
> > a raw block device.
> > 
> > Rename and relocate blkdev_dax_capable() to keep them maintained
> > consistently, and call bdev_direct_access() for the dax capability
> > check.
> ...
> > 
> > +bool bdev_dax_capable(struct block_device *bdev)
> > +{
> > +	struct gendisk *disk = bdev->bd_disk;
> > +	struct blk_dax_ctl dax = {
> > +		.size = PAGE_SIZE,
> > +	};
> > +
> > +	if (!IS_ENABLED(CONFIG_FS_DAX))
> > +		return false;
>
> Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
> when DAX is not enabled (like it was with blkdev_dax_capable()). That way
> we don't grow the kernel for people who don't care about DAX.

When CONFIG_FS_DAX is not set, the rest of the code is optimized out.  So,
I think the code size is the same.

(gdb) disas bdev_dax_capable
Dump of assembler code for function bdev_dax_capable:
   0xffffffff81260d20 <+0>:     callq  0xffffffff81813c30 <__fentry__>
   0xffffffff81260d25 <+5>:     push   %rbp
   0xffffffff81260d26 <+6>:     xor    %eax,%eax
   0xffffffff81260d28 <+8>:     mov    %rsp,%rbp
   0xffffffff81260d2b <+11>:    pop    %rbp
   0xffffffff81260d2c <+12>:    retq   
End of assembler dump.

Thanks,
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-11 14:25       ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-11 14:25 UTC (permalink / raw)
  To: Jan Kara
  Cc: dan.j.williams, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

On Wed, 2016-05-11 at 10:05 +0200, Jan Kara wrote:
> On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> > 
> > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > to remain as a separate interface for checking dax capability of
> > a raw block device.
> > 
> > Rename and relocate blkdev_dax_capable() to keep them maintained
> > consistently, and call bdev_direct_access() for the dax capability
> > check.
> ...
> > 
> > +bool bdev_dax_capable(struct block_device *bdev)
> > +{
> > +	struct gendisk *disk = bdev->bd_disk;
> > +	struct blk_dax_ctl dax = {
> > +		.size = PAGE_SIZE,
> > +	};
> > +
> > +	if (!IS_ENABLED(CONFIG_FS_DAX))
> > +		return false;
>
> Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
> when DAX is not enabled (like it was with blkdev_dax_capable()). That way
> we don't grow the kernel for people who don't care about DAX.

When CONFIG_FS_DAX is not set, the rest of the code is optimized out.  So,
I think the code size is the same.

(gdb) disas bdev_dax_capable
Dump of assembler code for function bdev_dax_capable:
   0xffffffff81260d20 <+0>:     callq  0xffffffff81813c30 <__fentry__>
   0xffffffff81260d25 <+5>:     push   %rbp
   0xffffffff81260d26 <+6>:     xor    %eax,%eax
   0xffffffff81260d28 <+8>:     mov    %rsp,%rbp
   0xffffffff81260d2b <+11>:    pop    %rbp
   0xffffffff81260d2c <+12>:    retq   
End of assembler dump.

Thanks,
-Toshi

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-11 14:25       ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-11 14:25 UTC (permalink / raw)
  To: Jan Kara
  Cc: dan.j.williams, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

On Wed, 2016-05-11 at 10:05 +0200, Jan Kara wrote:
> On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> > 
> > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > to remain as a separate interface for checking dax capability of
> > a raw block device.
> > 
> > Rename and relocate blkdev_dax_capable() to keep them maintained
> > consistently, and call bdev_direct_access() for the dax capability
> > check.
> ...
> > 
> > +bool bdev_dax_capable(struct block_device *bdev)
> > +{
> > +	struct gendisk *disk = bdev->bd_disk;
> > +	struct blk_dax_ctl dax = {
> > +		.size = PAGE_SIZE,
> > +	};
> > +
> > +	if (!IS_ENABLED(CONFIG_FS_DAX))
> > +		return false;
>
> Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
> when DAX is not enabled (like it was with blkdev_dax_capable()). That way
> we don't grow the kernel for people who don't care about DAX.

When CONFIG_FS_DAX is not set, the rest of the code is optimized out.  So,
I think the code size is the same.

(gdb) disas bdev_dax_capable
Dump of assembler code for function bdev_dax_capable:
   0xffffffff81260d20 <+0>:     callq  0xffffffff81813c30 <__fentry__>
   0xffffffff81260d25 <+5>:     push   %rbp
   0xffffffff81260d26 <+6>:     xor    %eax,%eax
   0xffffffff81260d28 <+8>:     mov    %rsp,%rbp
   0xffffffff81260d2b <+11>:    pop    %rbp
   0xffffffff81260d2c <+12>:    retq   
End of assembler dump.

Thanks,
-Toshi

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
  2016-05-11 14:25       ` Toshi Kani
  (?)
@ 2016-05-11 15:26         ` Jan Kara
  -1 siblings, 0 replies; 71+ messages in thread
From: Jan Kara @ 2016-05-11 15:26 UTC (permalink / raw)
  To: Toshi Kani
  Cc: hch, Jan Kara, linux-block, linux-nvdimm, david, linux-kernel,
	micah.parrish, axboe, adilger.kernel, viro, linux-fsdevel, tytso

On Wed 11-05-16 08:25:10, Toshi Kani wrote:
> On Wed, 2016-05-11 at 10:05 +0200, Jan Kara wrote:
> > On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> > > 
> > > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > > to remain as a separate interface for checking dax capability of
> > > a raw block device.
> > > 
> > > Rename and relocate blkdev_dax_capable() to keep them maintained
> > > consistently, and call bdev_direct_access() for the dax capability
> > > check.
> > ...
> > > 
> > > +bool bdev_dax_capable(struct block_device *bdev)
> > > +{
> > > +	struct gendisk *disk = bdev->bd_disk;
> > > +	struct blk_dax_ctl dax = {
> > > +		.size = PAGE_SIZE,
> > > +	};
> > > +
> > > +	if (!IS_ENABLED(CONFIG_FS_DAX))
> > > +		return false;
> >
> > Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
> > when DAX is not enabled (like it was with blkdev_dax_capable()). That way
> > we don't grow the kernel for people who don't care about DAX.
> 
> When CONFIG_FS_DAX is not set, the rest of the code is optimized out.  So,
> I think the code size is the same.
> 
> (gdb) disas bdev_dax_capable
> Dump of assembler code for function bdev_dax_capable:
>    0xffffffff81260d20 <+0>:     callq  0xffffffff81813c30 <__fentry__>
>    0xffffffff81260d25 <+5>:     push   %rbp
>    0xffffffff81260d26 <+6>:     xor    %eax,%eax
>    0xffffffff81260d28 <+8>:     mov    %rsp,%rbp
>    0xffffffff81260d2b <+11>:    pop    %rbp
>    0xffffffff81260d2c <+12>:    retq   
> End of assembler dump.

Ah, good. So feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-11 15:26         ` Jan Kara
  0 siblings, 0 replies; 71+ messages in thread
From: Jan Kara @ 2016-05-11 15:26 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Jan Kara, dan.j.williams, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

On Wed 11-05-16 08:25:10, Toshi Kani wrote:
> On Wed, 2016-05-11 at 10:05 +0200, Jan Kara wrote:
> > On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> > > 
> > > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > > to remain as a separate interface for checking dax capability of
> > > a raw block device.
> > > 
> > > Rename and relocate blkdev_dax_capable() to keep them maintained
> > > consistently, and call bdev_direct_access() for the dax capability
> > > check.
> > ...
> > > 
> > > +bool bdev_dax_capable(struct block_device *bdev)
> > > +{
> > > +	struct gendisk *disk = bdev->bd_disk;
> > > +	struct blk_dax_ctl dax = {
> > > +		.size = PAGE_SIZE,
> > > +	};
> > > +
> > > +	if (!IS_ENABLED(CONFIG_FS_DAX))
> > > +		return false;
> >
> > Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
> > when DAX is not enabled (like it was with blkdev_dax_capable()). That way
> > we don't grow the kernel for people who don't care about DAX.
> 
> When CONFIG_FS_DAX is not set, the rest of the code is optimized out. �So,
> I think the code size is the same.
> 
> (gdb) disas bdev_dax_capable
> Dump of assembler code for function bdev_dax_capable:
> ���0xffffffff81260d20 <+0>:�����callq��0xffffffff81813c30 <__fentry__>
> ���0xffffffff81260d25 <+5>:�����push���%rbp
> ���0xffffffff81260d26 <+6>:�����xor����%eax,%eax
> ���0xffffffff81260d28 <+8>:�����mov����%rsp,%rbp
> ���0xffffffff81260d2b <+11>:����pop����%rbp
> ���0xffffffff81260d2c <+12>:����retq���
> End of assembler dump.

Ah, good. So feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-11 15:26         ` Jan Kara
  0 siblings, 0 replies; 71+ messages in thread
From: Jan Kara @ 2016-05-11 15:26 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Jan Kara, dan.j.williams, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

On Wed 11-05-16 08:25:10, Toshi Kani wrote:
> On Wed, 2016-05-11 at 10:05 +0200, Jan Kara wrote:
> > On Tue 10-05-16 10:23:57, Toshi Kani wrote:
> > > 
> > > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > > to remain as a separate interface for checking dax capability of
> > > a raw block device.
> > > 
> > > Rename and relocate blkdev_dax_capable() to keep them maintained
> > > consistently, and call bdev_direct_access() for the dax capability
> > > check.
> > ...
> > > 
> > > +bool bdev_dax_capable(struct block_device *bdev)
> > > +{
> > > +	struct gendisk *disk = bdev->bd_disk;
> > > +	struct blk_dax_ctl dax = {
> > > +		.size = PAGE_SIZE,
> > > +	};
> > > +
> > > +	if (!IS_ENABLED(CONFIG_FS_DAX))
> > > +		return false;
> >
> > Frankly, I prefer the #ifdef CONFIG_FS_DAX and just compile the code out
> > when DAX is not enabled (like it was with blkdev_dax_capable()). That way
> > we don't grow the kernel for people who don't care about DAX.
> 
> When CONFIG_FS_DAX is not set, the rest of the code is optimized out.  So,
> I think the code size is the same.
> 
> (gdb) disas bdev_dax_capable
> Dump of assembler code for function bdev_dax_capable:
>    0xffffffff81260d20 <+0>:     callq  0xffffffff81813c30 <__fentry__>
>    0xffffffff81260d25 <+5>:     push   %rbp
>    0xffffffff81260d26 <+6>:     xor    %eax,%eax
>    0xffffffff81260d28 <+8>:     mov    %rsp,%rbp
>    0xffffffff81260d2b <+11>:    pop    %rbp
>    0xffffffff81260d2c <+12>:    retq   
> End of assembler dump.

Ah, good. So feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
  2016-05-10 16:23   ` Toshi Kani
  (?)
@ 2016-05-17 22:07     ` Dan Williams
  -1 siblings, 0 replies; 71+ messages in thread
From: Dan Williams @ 2016-05-17 22:07 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Jan Kara, Christoph Hellwig, linux-block, linux-nvdimm, david,
	linux-kernel, micah.parrish, Jens Axboe, Andreas Dilger, Al Viro,
	linux-fsdevel, Theodore Ts'o

On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
>
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
>
> There is no change in the behavior.
>
> Link: https://lkml.org/lkml/2016/5/9/950
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Jens Axboe <axboe@fb.com>
> Cc: Andreas Dilger <adilger.kernel@dilger.ca>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Boaz Harrosh <boaz@plexistor.com>
> ---
>  block/ioctl.c          |   30 ------------------------------
>  fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
>  include/linux/blkdev.h |    1 +
>  include/linux/fs.h     |    8 --------
>  4 files changed, 38 insertions(+), 40 deletions(-)
>
> diff --git a/block/ioctl.c b/block/ioctl.c
> index 4ff1f92..7eeda07 100644
> --- a/block/ioctl.c
> +++ b/block/ioctl.c
> @@ -4,7 +4,6 @@
>  #include <linux/gfp.h>
>  #include <linux/blkpg.h>
>  #include <linux/hdreg.h>
> -#include <linux/badblocks.h>
>  #include <linux/backing-dev.h>
>  #include <linux/fs.h>
>  #include <linux/blktrace_api.h>
> @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
>                 ret == -ENOIOCTLCMD;
>  }
>
> -#ifdef CONFIG_FS_DAX
> -bool blkdev_dax_capable(struct block_device *bdev)
> -{
> -       struct gendisk *disk = bdev->bd_disk;
> -
> -       if (!disk->fops->direct_access)
> -               return false;
> -
> -       /*
> -        * If the partition is not aligned on a page boundary, we can't
> -        * do dax I/O to it.
> -        */
> -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
> -               return false;
> -
> -       /*
> -        * If the device has known bad blocks, force all I/O through the
> -        * driver / page cache.
> -        *
> -        * TODO: support finer grained dax error handling
> -        */
> -       if (disk->bb && disk->bb->count)
> -               return false;
> -
> -       return true;
> -}
> -#endif
> -
>  static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
>                 unsigned cmd, unsigned long arg)
>  {
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index db55638..5d79093 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -29,6 +29,7 @@
>  #include <linux/log2.h>
>  #include <linux/cleancache.h>
>  #include <linux/dax.h>
> +#include <linux/badblocks.h>
>  #include <asm/uaccess.h>
>  #include "internal.h"
>
> @@ -554,6 +555,40 @@ int bdev_dax_supported(struct super_block *sb, int blocksize)
>  }
>  EXPORT_SYMBOL_GPL(bdev_dax_supported);
>
> +/**
> + * bdev_dax_capable() - Return if the raw device is capable for dax
> + * @bdev: The device for raw block device access
> + */
> +bool bdev_dax_capable(struct block_device *bdev)
> +{
> +       struct gendisk *disk = bdev->bd_disk;
> +       struct blk_dax_ctl dax = {
> +               .size = PAGE_SIZE,
> +       };
> +
> +       if (!IS_ENABLED(CONFIG_FS_DAX))
> +               return false;
> +
> +       dax.sector = 0;
> +       if (bdev_direct_access(bdev, &dax) < 0)
> +               return false;
> +
> +       dax.sector = bdev->bd_part->nr_sects - (PAGE_SIZE / 512);
> +       if (bdev_direct_access(bdev, &dax) < 0)
> +               return false;

So I just noticed that this new implementation of bdev_dax_capable()
prevents us from enabling DAX in the presence of errors, which was the
goal of Vishal's pending patches for 4.7.

I like the goal of centralizing checks, but this collides the base DAX
capability with the ability to perform an actual accesses at a given
address.

All the immediate solutions that come to mind right now are pretty
ugly, like an ignore errors flag...

Hmm, what about explicitly returning -EBADBLOCK and updating size to
return the offset of the error?  That might be useful information to
have in general...
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-17 22:07     ` Dan Williams
  0 siblings, 0 replies; 71+ messages in thread
From: Dan Williams @ 2016-05-17 22:07 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Jan Kara, david, Al Viro, Jens Axboe, Christoph Hellwig,
	Boaz Harrosh, Theodore Ts'o, Andreas Dilger, Ross Zwisler,
	micah.parrish, linux-nvdimm, linux-fsdevel, linux-block,
	linux-kernel

On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
>
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
>
> There is no change in the behavior.
>
> Link: https://lkml.org/lkml/2016/5/9/950
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Jens Axboe <axboe@fb.com>
> Cc: Andreas Dilger <adilger.kernel@dilger.ca>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Boaz Harrosh <boaz@plexistor.com>
> ---
>  block/ioctl.c          |   30 ------------------------------
>  fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
>  include/linux/blkdev.h |    1 +
>  include/linux/fs.h     |    8 --------
>  4 files changed, 38 insertions(+), 40 deletions(-)
>
> diff --git a/block/ioctl.c b/block/ioctl.c
> index 4ff1f92..7eeda07 100644
> --- a/block/ioctl.c
> +++ b/block/ioctl.c
> @@ -4,7 +4,6 @@
>  #include <linux/gfp.h>
>  #include <linux/blkpg.h>
>  #include <linux/hdreg.h>
> -#include <linux/badblocks.h>
>  #include <linux/backing-dev.h>
>  #include <linux/fs.h>
>  #include <linux/blktrace_api.h>
> @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
>                 ret == -ENOIOCTLCMD;
>  }
>
> -#ifdef CONFIG_FS_DAX
> -bool blkdev_dax_capable(struct block_device *bdev)
> -{
> -       struct gendisk *disk = bdev->bd_disk;
> -
> -       if (!disk->fops->direct_access)
> -               return false;
> -
> -       /*
> -        * If the partition is not aligned on a page boundary, we can't
> -        * do dax I/O to it.
> -        */
> -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
> -               return false;
> -
> -       /*
> -        * If the device has known bad blocks, force all I/O through the
> -        * driver / page cache.
> -        *
> -        * TODO: support finer grained dax error handling
> -        */
> -       if (disk->bb && disk->bb->count)
> -               return false;
> -
> -       return true;
> -}
> -#endif
> -
>  static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
>                 unsigned cmd, unsigned long arg)
>  {
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index db55638..5d79093 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -29,6 +29,7 @@
>  #include <linux/log2.h>
>  #include <linux/cleancache.h>
>  #include <linux/dax.h>
> +#include <linux/badblocks.h>
>  #include <asm/uaccess.h>
>  #include "internal.h"
>
> @@ -554,6 +555,40 @@ int bdev_dax_supported(struct super_block *sb, int blocksize)
>  }
>  EXPORT_SYMBOL_GPL(bdev_dax_supported);
>
> +/**
> + * bdev_dax_capable() - Return if the raw device is capable for dax
> + * @bdev: The device for raw block device access
> + */
> +bool bdev_dax_capable(struct block_device *bdev)
> +{
> +       struct gendisk *disk = bdev->bd_disk;
> +       struct blk_dax_ctl dax = {
> +               .size = PAGE_SIZE,
> +       };
> +
> +       if (!IS_ENABLED(CONFIG_FS_DAX))
> +               return false;
> +
> +       dax.sector = 0;
> +       if (bdev_direct_access(bdev, &dax) < 0)
> +               return false;
> +
> +       dax.sector = bdev->bd_part->nr_sects - (PAGE_SIZE / 512);
> +       if (bdev_direct_access(bdev, &dax) < 0)
> +               return false;

So I just noticed that this new implementation of bdev_dax_capable()
prevents us from enabling DAX in the presence of errors, which was the
goal of Vishal's pending patches for 4.7.

I like the goal of centralizing checks, but this collides the base DAX
capability with the ability to perform an actual accesses at a given
address.

All the immediate solutions that come to mind right now are pretty
ugly, like an ignore errors flag...

Hmm, what about explicitly returning -EBADBLOCK and updating size to
return the offset of the error?  That might be useful information to
have in general...

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
@ 2016-05-17 22:07     ` Dan Williams
  0 siblings, 0 replies; 71+ messages in thread
From: Dan Williams @ 2016-05-17 22:07 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Jan Kara, david, Al Viro, Jens Axboe, Christoph Hellwig,
	Boaz Harrosh, Theodore Ts'o, Andreas Dilger, Ross Zwisler,
	micah.parrish, linux-nvdimm@lists.01.org, linux-fsdevel,
	linux-block, linux-kernel

On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> to remain as a separate interface for checking dax capability of
> a raw block device.
>
> Rename and relocate blkdev_dax_capable() to keep them maintained
> consistently, and call bdev_direct_access() for the dax capability
> check.
>
> There is no change in the behavior.
>
> Link: https://lkml.org/lkml/2016/5/9/950
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Jens Axboe <axboe@fb.com>
> Cc: Andreas Dilger <adilger.kernel@dilger.ca>
> Cc: Jan Kara <jack@suse.cz>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Ross Zwisler <ross.zwisler@linux.intel.com>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Boaz Harrosh <boaz@plexistor.com>
> ---
>  block/ioctl.c          |   30 ------------------------------
>  fs/block_dev.c         |   39 +++++++++++++++++++++++++++++++++++++--
>  include/linux/blkdev.h |    1 +
>  include/linux/fs.h     |    8 --------
>  4 files changed, 38 insertions(+), 40 deletions(-)
>
> diff --git a/block/ioctl.c b/block/ioctl.c
> index 4ff1f92..7eeda07 100644
> --- a/block/ioctl.c
> +++ b/block/ioctl.c
> @@ -4,7 +4,6 @@
>  #include <linux/gfp.h>
>  #include <linux/blkpg.h>
>  #include <linux/hdreg.h>
> -#include <linux/badblocks.h>
>  #include <linux/backing-dev.h>
>  #include <linux/fs.h>
>  #include <linux/blktrace_api.h>
> @@ -407,35 +406,6 @@ static inline int is_unrecognized_ioctl(int ret)
>                 ret == -ENOIOCTLCMD;
>  }
>
> -#ifdef CONFIG_FS_DAX
> -bool blkdev_dax_capable(struct block_device *bdev)
> -{
> -       struct gendisk *disk = bdev->bd_disk;
> -
> -       if (!disk->fops->direct_access)
> -               return false;
> -
> -       /*
> -        * If the partition is not aligned on a page boundary, we can't
> -        * do dax I/O to it.
> -        */
> -       if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
> -                       || (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
> -               return false;
> -
> -       /*
> -        * If the device has known bad blocks, force all I/O through the
> -        * driver / page cache.
> -        *
> -        * TODO: support finer grained dax error handling
> -        */
> -       if (disk->bb && disk->bb->count)
> -               return false;
> -
> -       return true;
> -}
> -#endif
> -
>  static int blkdev_flushbuf(struct block_device *bdev, fmode_t mode,
>                 unsigned cmd, unsigned long arg)
>  {
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index db55638..5d79093 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -29,6 +29,7 @@
>  #include <linux/log2.h>
>  #include <linux/cleancache.h>
>  #include <linux/dax.h>
> +#include <linux/badblocks.h>
>  #include <asm/uaccess.h>
>  #include "internal.h"
>
> @@ -554,6 +555,40 @@ int bdev_dax_supported(struct super_block *sb, int blocksize)
>  }
>  EXPORT_SYMBOL_GPL(bdev_dax_supported);
>
> +/**
> + * bdev_dax_capable() - Return if the raw device is capable for dax
> + * @bdev: The device for raw block device access
> + */
> +bool bdev_dax_capable(struct block_device *bdev)
> +{
> +       struct gendisk *disk = bdev->bd_disk;
> +       struct blk_dax_ctl dax = {
> +               .size = PAGE_SIZE,
> +       };
> +
> +       if (!IS_ENABLED(CONFIG_FS_DAX))
> +               return false;
> +
> +       dax.sector = 0;
> +       if (bdev_direct_access(bdev, &dax) < 0)
> +               return false;
> +
> +       dax.sector = bdev->bd_part->nr_sects - (PAGE_SIZE / 512);
> +       if (bdev_direct_access(bdev, &dax) < 0)
> +               return false;

So I just noticed that this new implementation of bdev_dax_capable()
prevents us from enabling DAX in the presence of errors, which was the
goal of Vishal's pending patches for 4.7.

I like the goal of centralizing checks, but this collides the base DAX
capability with the ability to perform an actual accesses at a given
address.

All the immediate solutions that come to mind right now are pretty
ugly, like an ignore errors flag...

Hmm, what about explicitly returning -EBADBLOCK and updating size to
return the offset of the error?  That might be useful information to
have in general...

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

* Re: [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency
  2016-05-17 22:07     ` Dan Williams
  (?)
  (?)
@ 2016-05-17 23:02     ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-17 23:02 UTC (permalink / raw)
  To: Dan Williams
  Cc: Jan Kara, Christoph Hellwig, linux-block, linux-nvdimm, david,
	linux-kernel, micah.parrish, Jens Axboe, Andreas Dilger, Al Viro,
	linux-fsdevel, Theodore Ts'o

On Tue, 2016-05-17 at 15:07 -0700, Dan Williams wrote:
> On Tue, May 10, 2016 at 9:23 AM, Toshi Kani <toshi.kani@hpe.com> wrote:
> > 
> > blkdev_dax_capable() is similar to bdev_dax_supported(), but needs
> > to remain as a separate interface for checking dax capability of
> > a raw block device.
> > 
> > Rename and relocate blkdev_dax_capable() to keep them maintained
> > consistently, and call bdev_direct_access() for the dax capability
> > check.
> > 
> > There is no change in the behavior.
> > 
 :
> > +/**
> > + * bdev_dax_capable() - Return if the raw device is capable for dax
> > + * @bdev: The device for raw block device access
> > + */
> > +bool bdev_dax_capable(struct block_device *bdev)
> > +{
> > +       struct gendisk *disk = bdev->bd_disk;
> > +       struct blk_dax_ctl dax = {
> > +               .size = PAGE_SIZE,
> > +       };
> > +
> > +       if (!IS_ENABLED(CONFIG_FS_DAX))
> > +               return false;
> > +
> > +       dax.sector = 0;
> > +       if (bdev_direct_access(bdev, &dax) < 0)
> > +               return false;
> > +
> > +       dax.sector = bdev->bd_part->nr_sects - (PAGE_SIZE / 512);
> > +       if (bdev_direct_access(bdev, &dax) < 0)
> > +               return false;
>
> So I just noticed that this new implementation of bdev_dax_capable()
> prevents us from enabling DAX in the presence of errors, which was the
> goal of Vishal's pending patches for 4.7.
> 
> I like the goal of centralizing checks, but this collides the base DAX
> capability with the ability to perform an actual accesses at a given
> address.
> 
> All the immediate solutions that come to mind right now are pretty
> ugly, like an ignore errors flag...
> 
> Hmm, what about explicitly returning -EBADBLOCK and updating size to
> return the offset of the error?  That might be useful information to
> have in general...

The function only checks a PAGE_SIZE range at the start and the end, but I
agree that it can handle -EBADBLOCK (or -EIO) from bdev_direct_access() as
an error but the device is DAX-capable.  bdev_dax_supported() may need the
same change as well (although I wonder how a bad block at the start is
handled).  Shall I send you a patch for this change?  (BTW, do we have a
patch that defines EBADBLOCK already?)  I think the error offset would be
useful, but that change can be made when we use it.

Thanks,
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* [PATCH] remove unused blkdev_dax_capable() function
  2016-05-10 16:23   ` Toshi Kani
@ 2016-05-18  7:54     ` Arnd Bergmann
  -1 siblings, 0 replies; 71+ messages in thread
From: Arnd Bergmann @ 2016-05-18  7:54 UTC (permalink / raw)
  To: Toshi Kani
  Cc: dan.j.williams, jack, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

The change from blkdev_dax_capable() to bdev_dax_capable() removed the only user
of the former, so we now get a build warning:

fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used [-Werror=unused-function]
 static bool blkdev_dax_capable(struct block_device *bdev)

This removes the now-unused function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for consistency")
---
On Tuesday 10 May 2016 10:23:57 Toshi Kani wrote:
> @@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
>  
>                         if (!ret) {
>                                 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> -                               if (!blkdev_dax_capable(bdev))
> +                               if (!bdev_dax_capable(bdev))
>                                         bdev->bd_inode->i_flags &= ~S_DAX;
> 

It's not entirely from the patch description what the intention was here
in keeping two slightly different implementations of the same function
in one file, my best guess is that it was not intentional and we should
just remove this.

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 97f324642b5f..dad77225a721 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1241,33 +1241,6 @@ void bd_set_size(struct block_device *bdev, loff_t size)
 }
 EXPORT_SYMBOL(bd_set_size);
 
-static bool blkdev_dax_capable(struct block_device *bdev)
-{
-	struct gendisk *disk = bdev->bd_disk;
-
-	if (!disk->fops->direct_access || !IS_ENABLED(CONFIG_FS_DAX))
-		return false;
-
-	/*
-	 * If the partition is not aligned on a page boundary, we can't
-	 * do dax I/O to it.
-	 */
-	if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
-			|| (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
-		return false;
-
-	/*
-	 * If the device has known bad blocks, force all I/O through the
-	 * driver / page cache.
-	 *
-	 * TODO: support finer grained dax error handling
-	 */
-	if (disk->bb && disk->bb->count)
-		return false;
-
-	return true;
-}
-
 static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
 
 /*

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

* [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-18  7:54     ` Arnd Bergmann
  0 siblings, 0 replies; 71+ messages in thread
From: Arnd Bergmann @ 2016-05-18  7:54 UTC (permalink / raw)
  To: Toshi Kani
  Cc: dan.j.williams, jack, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

The change from blkdev_dax_capable() to bdev_dax_capable() removed the only user
of the former, so we now get a build warning:

fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used [-Werror=unused-function]
 static bool blkdev_dax_capable(struct block_device *bdev)

This removes the now-unused function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for consistency")
---
On Tuesday 10 May 2016 10:23:57 Toshi Kani wrote:
> @@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
>  
>                         if (!ret) {
>                                 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> -                               if (!blkdev_dax_capable(bdev))
> +                               if (!bdev_dax_capable(bdev))
>                                         bdev->bd_inode->i_flags &= ~S_DAX;
> 

It's not entirely from the patch description what the intention was here
in keeping two slightly different implementations of the same function
in one file, my best guess is that it was not intentional and we should
just remove this.

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 97f324642b5f..dad77225a721 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1241,33 +1241,6 @@ void bd_set_size(struct block_device *bdev, loff_t size)
 }
 EXPORT_SYMBOL(bd_set_size);
 
-static bool blkdev_dax_capable(struct block_device *bdev)
-{
-	struct gendisk *disk = bdev->bd_disk;
-
-	if (!disk->fops->direct_access || !IS_ENABLED(CONFIG_FS_DAX))
-		return false;
-
-	/*
-	 * If the partition is not aligned on a page boundary, we can't
-	 * do dax I/O to it.
-	 */
-	if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512))
-			|| (bdev->bd_part->nr_sects % (PAGE_SIZE / 512)))
-		return false;
-
-	/*
-	 * If the device has known bad blocks, force all I/O through the
-	 * driver / page cache.
-	 *
-	 * TODO: support finer grained dax error handling
-	 */
-	if (disk->bb && disk->bb->count)
-		return false;
-
-	return true;
-}
-
 static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
 
 /*

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
  2016-05-18  7:54     ` Arnd Bergmann
  (?)
@ 2016-05-18 14:01       ` Toshi Kani
  -1 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-18 14:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: hch, jack, linux-block, linux-nvdimm, david, linux-kernel,
	micah.parrish, axboe, adilger.kernel, viro, linux-fsdevel, tytso

On Wed, 2016-05-18 at 09:54 +0200, Arnd Bergmann wrote:
> The change from blkdev_dax_capable() to bdev_dax_capable() removed the
> only user of the former, so we now get a build warning:
> 
> fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used
> [-Werror=unused-function]
>  static bool blkdev_dax_capable(struct block_device *bdev)
> 
> This removes the now-unused function.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for
> consistency")
 :
> It's not entirely from the patch description what the intention was here
> in keeping two slightly different implementations of the same function
> in one file, my best guess is that it was not intentional and we should
> just remove this.

Thanks for the build fix.  Looks like there was a conflict
between 8044aae6f374 and a8078b1fc616d, which resulted this build error.
Both patches moved blkdev_dax_capable() from block/ioctl.c
to fs/block_dev.c.

Acked-by: Toshi Kani <toshi.kani@hpe.com>

Thanks,
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-18 14:01       ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-18 14:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: dan.j.williams, jack, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

On Wed, 2016-05-18 at 09:54 +0200, Arnd Bergmann wrote:
> The change from blkdev_dax_capable() to bdev_dax_capable() removed the
> only user of the former, so we now get a build warning:
> 
> fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used
> [-Werror=unused-function]
>  static bool blkdev_dax_capable(struct block_device *bdev)
> 
> This removes the now-unused function.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for
> consistency")
 :
> It's not entirely from the patch description what the intention was here
> in keeping two slightly different implementations of the same function
> in one file, my best guess is that it was not intentional and we should
> just remove this.

Thanks for the build fix.  Looks like there was a conflict
between 8044aae6f374 and a8078b1fc616d, which resulted this build error.
Both patches moved blkdev_dax_capable() from block/ioctl.c
to fs/block_dev.c.

Acked-by: Toshi Kani <toshi.kani@hpe.com>

Thanks,
-Toshi

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-18 14:01       ` Toshi Kani
  0 siblings, 0 replies; 71+ messages in thread
From: Toshi Kani @ 2016-05-18 14:01 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: dan.j.williams, jack, david, viro, axboe, hch, boaz, tytso,
	adilger.kernel, ross.zwisler, micah.parrish, linux-nvdimm,
	linux-fsdevel, linux-block, linux-kernel

On Wed, 2016-05-18 at 09:54 +0200, Arnd Bergmann wrote:
> The change from blkdev_dax_capable() to bdev_dax_capable() removed the
> only user of the former, so we now get a build warning:
> 
> fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used
> [-Werror=unused-function]
>  static bool blkdev_dax_capable(struct block_device *bdev)
> 
> This removes the now-unused function.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for
> consistency")
 :
> It's not entirely from the patch description what the intention was here
> in keeping two slightly different implementations of the same function
> in one file, my best guess is that it was not intentional and we should
> just remove this.

Thanks for the build fix.  Looks like there was a conflict
between 8044aae6f374 and a8078b1fc616d, which resulted this build error.
Both patches moved blkdev_dax_capable() from block/ioctl.c
to fs/block_dev.c.

Acked-by: Toshi Kani <toshi.kani@hpe.com>

Thanks,
-Toshi

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
  2016-05-18  7:54     ` Arnd Bergmann
  (?)
@ 2016-05-18 19:30       ` Vishal Verma
  -1 siblings, 0 replies; 71+ messages in thread
From: Vishal Verma @ 2016-05-18 19:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-block, jack, linux-nvdimm, axboe, david, linux-kernel,
	micah.parrish, hch, adilger.kernel, viro, linux-fsdevel, tytso,
	sfr

On Wed, May 18, 2016 at 09:54:08AM +0200, Arnd Bergmann wrote:
> The change from blkdev_dax_capable() to bdev_dax_capable() removed the only user
> of the former, so we now get a build warning:
> 
> fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used [-Werror=unused-function]
>  static bool blkdev_dax_capable(struct block_device *bdev)
> 
> This removes the now-unused function.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for consistency")
> ---
> On Tuesday 10 May 2016 10:23:57 Toshi Kani wrote:
> > @@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
> >  
> >                         if (!ret) {
> >                                 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> > -                               if (!blkdev_dax_capable(bdev))
> > +                               if (!bdev_dax_capable(bdev))
> >                                         bdev->bd_inode->i_flags &= ~S_DAX;
> > 
> 
> It's not entirely from the patch description what the intention was here
> in keeping two slightly different implementations of the same function
> in one file, my best guess is that it was not intentional and we should
> just remove this.
> 

Good catch - like Toshi said, this was indeed a mis-merge.

Stephen, for reference, I've added a branch with the expected conflict
resolution at:

https://git.kernel.org/cgit/linux/kernel/git/nvdimm/nvdimm.git/ libnvdimm-for-4.7-merge

Thanks,
	-Vishal
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-18 19:30       ` Vishal Verma
  0 siblings, 0 replies; 71+ messages in thread
From: Vishal Verma @ 2016-05-18 19:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Toshi Kani, hch, jack, linux-block, linux-nvdimm, david,
	linux-kernel, micah.parrish, axboe, adilger.kernel, viro,
	linux-fsdevel, tytso, sfr

On Wed, May 18, 2016 at 09:54:08AM +0200, Arnd Bergmann wrote:
> The change from blkdev_dax_capable() to bdev_dax_capable() removed the only user
> of the former, so we now get a build warning:
> 
> fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used [-Werror=unused-function]
>  static bool blkdev_dax_capable(struct block_device *bdev)
> 
> This removes the now-unused function.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for consistency")
> ---
> On Tuesday 10 May 2016 10:23:57 Toshi Kani wrote:
> > @@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
> >  
> >                         if (!ret) {
> >                                 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> > -                               if (!blkdev_dax_capable(bdev))
> > +                               if (!bdev_dax_capable(bdev))
> >                                         bdev->bd_inode->i_flags &= ~S_DAX;
> > 
> 
> It's not entirely from the patch description what the intention was here
> in keeping two slightly different implementations of the same function
> in one file, my best guess is that it was not intentional and we should
> just remove this.
> 

Good catch - like Toshi said, this was indeed a mis-merge.

Stephen, for reference, I've added a branch with the expected conflict
resolution at:

https://git.kernel.org/cgit/linux/kernel/git/nvdimm/nvdimm.git/ libnvdimm-for-4.7-merge

Thanks,
	-Vishal

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-18 19:30       ` Vishal Verma
  0 siblings, 0 replies; 71+ messages in thread
From: Vishal Verma @ 2016-05-18 19:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Toshi Kani, hch, jack, linux-block, linux-nvdimm, david,
	linux-kernel, micah.parrish, axboe, adilger.kernel, viro,
	linux-fsdevel, tytso, sfr

On Wed, May 18, 2016 at 09:54:08AM +0200, Arnd Bergmann wrote:
> The change from blkdev_dax_capable() to bdev_dax_capable() removed the only user
> of the former, so we now get a build warning:
> 
> fs/block_dev.c:1244:13: error: 'blkdev_dax_capable' defined but not used [-Werror=unused-function]
>  static bool blkdev_dax_capable(struct block_device *bdev)
> 
> This removes the now-unused function.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a8078b1fc616 ("block: Update blkdev_dax_capable() for consistency")
> ---
> On Tuesday 10 May 2016 10:23:57 Toshi Kani wrote:
> > @@ -1295,7 +1330,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
> >  
> >                         if (!ret) {
> >                                 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> > -                               if (!blkdev_dax_capable(bdev))
> > +                               if (!bdev_dax_capable(bdev))
> >                                         bdev->bd_inode->i_flags &= ~S_DAX;
> > 
> 
> It's not entirely from the patch description what the intention was here
> in keeping two slightly different implementations of the same function
> in one file, my best guess is that it was not intentional and we should
> just remove this.
> 

Good catch - like Toshi said, this was indeed a mis-merge.

Stephen, for reference, I've added a branch with the expected conflict
resolution at:

https://git.kernel.org/cgit/linux/kernel/git/nvdimm/nvdimm.git/ libnvdimm-for-4.7-merge

Thanks,
	-Vishal

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
  2016-05-10 16:23 ` Toshi Kani
  (?)
@ 2016-05-19 23:37   ` Eric Sandeen
  -1 siblings, 0 replies; 71+ messages in thread
From: Eric Sandeen @ 2016-05-19 23:37 UTC (permalink / raw)
  To: Toshi Kani, dan.j.williams, jack, david, viro
  Cc: hch, tytso, linux-nvdimm, linux-block, linux-kernel,
	micah.parrish, axboe, adilger.kernel, linux-fsdevel

On 5/10/16 11:23 AM, Toshi Kani wrote:
> When a partition is not aligned by 4KB, mount -o dax succeeds,

Sorry for being late, but -

Shouldn't this and all subsequent patch commits refer to
PAGE_SIZE, rather than "4kB?"

-Eric

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-19 23:37   ` Eric Sandeen
  0 siblings, 0 replies; 71+ messages in thread
From: Eric Sandeen @ 2016-05-19 23:37 UTC (permalink / raw)
  To: Toshi Kani, dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	micah.parrish, linux-nvdimm, linux-fsdevel, linux-block,
	linux-kernel

On 5/10/16 11:23 AM, Toshi Kani wrote:
> When a partition is not aligned by 4KB, mount -o dax succeeds,

Sorry for being late, but -

Shouldn't this and all subsequent patch commits refer to
PAGE_SIZE, rather than "4kB?"

-Eric


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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-19 23:37   ` Eric Sandeen
  0 siblings, 0 replies; 71+ messages in thread
From: Eric Sandeen @ 2016-05-19 23:37 UTC (permalink / raw)
  To: Toshi Kani, dan.j.williams, jack, david, viro
  Cc: axboe, hch, boaz, tytso, adilger.kernel, ross.zwisler,
	micah.parrish, linux-nvdimm, linux-fsdevel, linux-block,
	linux-kernel

On 5/10/16 11:23 AM, Toshi Kani wrote:
> When a partition is not aligned by 4KB, mount -o dax succeeds,

Sorry for being late, but -

Shouldn't this and all subsequent patch commits refer to
PAGE_SIZE, rather than "4kB?"

-Eric

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
  2016-05-18  7:54     ` Arnd Bergmann
  (?)
@ 2016-05-20 11:32       ` kbuild test robot
  -1 siblings, 0 replies; 71+ messages in thread
From: kbuild test robot @ 2016-05-20 11:32 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: hch, jack, linux-block, linux-nvdimm, david, linux-kernel,
	micah.parrish, axboe, adilger.kernel, kbuild-all, linux-fsdevel,
	tytso, viro

Hi,

[auto build test ERROR on next-20160517]
[cannot apply to v4.6-rc7 v4.6-rc6 v4.6-rc5 v4.6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/remove-unused-blkdev_dax_capable-function/20160518-155729
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=m68k 

All errors (new ones prefixed by >>):

   fs/block_dev.c: In function '__blkdev_get':
>> fs/block_dev.c:1242:5: error: implicit declaration of function 'blkdev_dax_capable' [-Werror=implicit-function-declaration]
        if (!blkdev_dax_capable(bdev))
        ^
   cc1: some warnings being treated as errors

vim +/blkdev_dax_capable +1242 fs/block_dev.c

d3374825 NeilBrown    2009-01-09  1236  					goto restart;
d3374825 NeilBrown    2009-01-09  1237  				}
1196f8b8 Tejun Heo    2011-04-21  1238  			}
7e69723f Tejun Heo    2011-05-23  1239  
5a023cdb Dan Williams 2015-11-30  1240  			if (!ret) {
7e69723f Tejun Heo    2011-05-23  1241  				bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
5a023cdb Dan Williams 2015-11-30 @1242  				if (!blkdev_dax_capable(bdev))
5a023cdb Dan Williams 2015-11-30  1243  					bdev->bd_inode->i_flags &= ~S_DAX;
5a023cdb Dan Williams 2015-11-30  1244  			}
7e69723f Tejun Heo    2011-05-23  1245  

:::::: The code at line 1242 was first introduced by commit
:::::: 5a023cdba50c5f5f2bc351783b3131699deb3937 block: enable dax for raw block devices

:::::: TO: Dan Williams <dan.j.williams@intel.com>
:::::: CC: Dan Williams <dan.j.williams@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-20 11:32       ` kbuild test robot
  0 siblings, 0 replies; 71+ messages in thread
From: kbuild test robot @ 2016-05-20 11:32 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild-all, Toshi Kani, dan.j.williams, jack, david, viro, axboe,
	hch, boaz, tytso, adilger.kernel, ross.zwisler, micah.parrish,
	linux-nvdimm, linux-fsdevel, linux-block, linux-kernel

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

Hi,

[auto build test ERROR on next-20160517]
[cannot apply to v4.6-rc7 v4.6-rc6 v4.6-rc5 v4.6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/remove-unused-blkdev_dax_capable-function/20160518-155729
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=m68k 

All errors (new ones prefixed by >>):

   fs/block_dev.c: In function '__blkdev_get':
>> fs/block_dev.c:1242:5: error: implicit declaration of function 'blkdev_dax_capable' [-Werror=implicit-function-declaration]
        if (!blkdev_dax_capable(bdev))
        ^
   cc1: some warnings being treated as errors

vim +/blkdev_dax_capable +1242 fs/block_dev.c

d3374825 NeilBrown    2009-01-09  1236  					goto restart;
d3374825 NeilBrown    2009-01-09  1237  				}
1196f8b8 Tejun Heo    2011-04-21  1238  			}
7e69723f Tejun Heo    2011-05-23  1239  
5a023cdb Dan Williams 2015-11-30  1240  			if (!ret) {
7e69723f Tejun Heo    2011-05-23  1241  				bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
5a023cdb Dan Williams 2015-11-30 @1242  				if (!blkdev_dax_capable(bdev))
5a023cdb Dan Williams 2015-11-30  1243  					bdev->bd_inode->i_flags &= ~S_DAX;
5a023cdb Dan Williams 2015-11-30  1244  			}
7e69723f Tejun Heo    2011-05-23  1245  

:::::: The code at line 1242 was first introduced by commit
:::::: 5a023cdba50c5f5f2bc351783b3131699deb3937 block: enable dax for raw block devices

:::::: TO: Dan Williams <dan.j.williams@intel.com>
:::::: CC: Dan Williams <dan.j.williams@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 37213 bytes --]

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-20 11:32       ` kbuild test robot
  0 siblings, 0 replies; 71+ messages in thread
From: kbuild test robot @ 2016-05-20 11:32 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kbuild-all, Toshi Kani, dan.j.williams, jack, david, viro, axboe,
	hch, boaz, tytso, adilger.kernel, ross.zwisler, micah.parrish,
	linux-nvdimm, linux-fsdevel, linux-block, linux-kernel

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

Hi,

[auto build test ERROR on next-20160517]
[cannot apply to v4.6-rc7 v4.6-rc6 v4.6-rc5 v4.6]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/remove-unused-blkdev_dax_capable-function/20160518-155729
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=m68k 

All errors (new ones prefixed by >>):

   fs/block_dev.c: In function '__blkdev_get':
>> fs/block_dev.c:1242:5: error: implicit declaration of function 'blkdev_dax_capable' [-Werror=implicit-function-declaration]
        if (!blkdev_dax_capable(bdev))
        ^
   cc1: some warnings being treated as errors

vim +/blkdev_dax_capable +1242 fs/block_dev.c

d3374825 NeilBrown    2009-01-09  1236  					goto restart;
d3374825 NeilBrown    2009-01-09  1237  				}
1196f8b8 Tejun Heo    2011-04-21  1238  			}
7e69723f Tejun Heo    2011-05-23  1239  
5a023cdb Dan Williams 2015-11-30  1240  			if (!ret) {
7e69723f Tejun Heo    2011-05-23  1241  				bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
5a023cdb Dan Williams 2015-11-30 @1242  				if (!blkdev_dax_capable(bdev))
5a023cdb Dan Williams 2015-11-30  1243  					bdev->bd_inode->i_flags &= ~S_DAX;
5a023cdb Dan Williams 2015-11-30  1244  			}
7e69723f Tejun Heo    2011-05-23  1245  

:::::: The code at line 1242 was first introduced by commit
:::::: 5a023cdba50c5f5f2bc351783b3131699deb3937 block: enable dax for raw block devices

:::::: TO: Dan Williams <dan.j.williams@intel.com>
:::::: CC: Dan Williams <dan.j.williams@intel.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 37213 bytes --]

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
  2016-05-19 23:37   ` Eric Sandeen
  (?)
  (?)
@ 2016-05-20 14:50     ` Kani, Toshimitsu
  -1 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 14:50 UTC (permalink / raw)
  To: dan.j.williams, viro, jack, david, sandeen, vishal.l.verma
  Cc: hch, tytso, linux-nvdimm, axboe, linux-kernel, Parrish,
	Micah \ linux-block@vger.kernel.org (HP Servers Linux
	R&D)" <micah.parrish@hpe.com>,),
	adilger.kernel, linux-fsdevel

On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> On 5/10/16 11:23 AM, Toshi Kani wrote:
> > 
> > When a partition is not aligned by 4KB, mount -o dax succeeds,
>
> Sorry for being late, but -
> 
> Shouldn't this and all subsequent patch commits refer to
> PAGE_SIZE, rather than "4kB?"

Right, the patch commits should refer to PAGE_SIZE to match with the code
changes.  I am afraid it may be a bit too late to update, though...

Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?

Thanks,
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 14:50     ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 14:50 UTC (permalink / raw)
  To: dan.j.williams, viro, jack, david, sandeen, vishal.l.verma
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, axboe,
	linux-nvdimm, linux-fsdevel, ross.zwisler, tytso, boaz

T24gVGh1LCAyMDE2LTA1LTE5IGF0IDE4OjM3IC0wNTAwLCBFcmljIFNhbmRlZW4gd3JvdGU6DQo+
IE9uIDUvMTAvMTYgMTE6MjMgQU0sIFRvc2hpIEthbmkgd3JvdGU6DQo+ID4gDQo+ID4gV2hlbiBh
IHBhcnRpdGlvbiBpcyBub3QgYWxpZ25lZCBieSA0S0IsIG1vdW50IC1vIGRheCBzdWNjZWVkcywN
Cj4NCj4gU29ycnkgZm9yIGJlaW5nIGxhdGUsIGJ1dCAtDQo+IA0KPiBTaG91bGRuJ3QgdGhpcyBh
bmQgYWxsIHN1YnNlcXVlbnQgcGF0Y2ggY29tbWl0cyByZWZlciB0bw0KPiBQQUdFX1NJWkUsIHJh
dGhlciB0aGFuICI0a0I/Ig0KDQpSaWdodCwgdGhlIHBhdGNoIGNvbW1pdHMgc2hvdWxkIHJlZmVy
IHRvIFBBR0VfU0laRSB0byBtYXRjaCB3aXRoIHRoZSBjb2RlDQpjaGFuZ2VzLiDCoEkgYW0gYWZy
YWlkIGl0IG1heSBiZSBhIGJpdCB0b28gbGF0ZSB0byB1cGRhdGUsIHRob3VnaC4uLg0KDQpWaXNo
YWwsIGRvIHlvdSB0aGluayB5b3UgY2FuIHR3ZWFrIHRoZSBsb2dzLCAiNEtCIiB0byAiUEFHRV9T
SVpFIj8NCg0KVGhhbmtzLA0KLVRvc2hpDQo=

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 14:50     ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 14:50 UTC (permalink / raw)
  To: dan.j.williams, viro, jack, david, sandeen, vishal.l.verma
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, axboe,
	linux-nvdimm@lists.01.org, linux-fsdevel, ross.zwisler, tytso,
	boaz

On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> On 5/10/16 11:23 AM, Toshi Kani wrote:
> > 
> > When a partition is not aligned by 4KB, mount -o dax succeeds,
>
> Sorry for being late, but -
> 
> Shouldn't this and all subsequent patch commits refer to
> PAGE_SIZE, rather than "4kB?"

Right, the patch commits should refer to PAGE_SIZE to match with the code
changes.  I am afraid it may be a bit too late to update, though...

Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?

Thanks,
-Toshi

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 14:50     ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 14:50 UTC (permalink / raw)
  To: dan.j.williams, viro, jack, david, sandeen, vishal.l.verma
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, axboe,
	linux-nvdimm, linux-fsdevel, ross.zwisler, tytso, boaz

On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> On 5/10/16 11:23 AM, Toshi Kani wrote:
> > 
> > When a partition is not aligned by 4KB, mount -o dax succeeds,
>
> Sorry for being late, but -
> 
> Shouldn't this and all subsequent patch commits refer to
> PAGE_SIZE, rather than "4kB?"

Right, the patch commits should refer to PAGE_SIZE to match with the code
changes.  I am afraid it may be a bit too late to update, though...

Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?

Thanks,
-Toshi

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
  2016-05-20 11:32       ` kbuild test robot
  (?)
  (?)
@ 2016-05-20 15:48         ` Kani, Toshimitsu
  -1 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 15:48 UTC (permalink / raw)
  To: lkp, arnd
  Cc: hch, tytso, linux-nvdimm, axboe, david, linux-kernel, Parrish,
	Micah \ linux-block@vger.kernel.org (HP Servers Linux
	R&D)" <micah.parrish@hpe.com>,),
	adilger.kernel, viro, linux-fsdevel, jack, kbuild-all

FYI, fs/block_dev.c has multiple updates since then including the code in
question. I just built tot -next m64 kernel with the attached config file,
and confirmed no compile error on the file.
-Toshi

On Fri, 2016-05-20 at 19:32 +0800, kbuild test robot wrote:
> Hi,
> 
> [auto build test ERROR on next-20160517]
> [cannot apply to v4.6-rc7 v4.6-rc6 v4.6-rc5 v4.6]
> [if your patch is applied to the wrong git tree, please drop us a note to
> help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/remove-unu
> sed-blkdev_dax_capable-function/20160518-155729
> config: m68k-allyesconfig (attached as .config)
> compiler: m68k-linux-gcc (GCC) 4.9.0
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.g
> it/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=m68k 
> 
> All errors (new ones prefixed by >>):
> 
>    fs/block_dev.c: In function '__blkdev_get':
> > 
> > > 
> > > fs/block_dev.c:1242:5: error: implicit declaration of function
> > > 'blkdev_dax_capable' [-Werror=implicit-function-declaration]
>         if (!blkdev_dax_capable(bdev))
>         ^
>    cc1: some warnings being treated as errors
> 
> vim +/blkdev_dax_capable +1242 fs/block_dev.c
> 
> d3374825 NeilBrown    2009-01-09  1236  					
> goto restart;
> d3374825 NeilBrown    2009-01-09  1237  				}
> 1196f8b8 Tejun Heo    2011-04-21  1238  			}
> 7e69723f Tejun Heo    2011-05-23  1239  
> 5a023cdb Dan Williams 2015-11-30  1240  			if (!ret)
> {
> 7e69723f Tejun Heo    2011-05-23  1241  				b
> d_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> 5a023cdb Dan Williams 2015-11-30 @1242  				i
> f (!blkdev_dax_capable(bdev))
> 5a023cdb Dan Williams 2015-11-30  1243  					
> bdev->bd_inode->i_flags &= ~S_DAX;
> 5a023cdb Dan Williams 2015-11-30  1244  			}
> 7e69723f Tejun Heo    2011-05-23  1245  
> 
> :::::: The code at line 1242 was first introduced by commit
> :::::: 5a023cdba50c5f5f2bc351783b3131699deb3937 block: enable dax for raw
> block devices
> 
> :::::: TO: Dan Williams <dan.j.williams@intel.com>
> :::::: CC: Dan Williams <dan.j.williams@intel.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology
> Center
> https://lists.01.org/pipermail/kbuild-all                   Intel
> Corporation
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-20 15:48         ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 15:48 UTC (permalink / raw)
  To: lkp, arnd
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, viro,
	dan.j.williams, axboe, linux-nvdimm, kbuild-all, linux-fsdevel,
	ross.zwisler, tytso, boaz, david, jack

RllJLCBmcy9ibG9ja19kZXYuYyBoYXMgbXVsdGlwbGUgdXBkYXRlcyBzaW5jZSB0aGVuIGluY2x1
ZGluZyB0aGUgY29kZSBpbg0KcXVlc3Rpb24uIEkganVzdCBidWlsdCB0b3QgLW5leHQgbTY0IGtl
cm5lbCB3aXRoIHRoZSBhdHRhY2hlZCBjb25maWcgZmlsZSwNCmFuZCBjb25maXJtZWQgbm8gY29t
cGlsZSBlcnJvciBvbiB0aGUgZmlsZS4NCi1Ub3NoaQ0KDQpPbiBGcmksIDIwMTYtMDUtMjAgYXQg
MTk6MzIgKzA4MDAsIGtidWlsZCB0ZXN0IHJvYm90IHdyb3RlOg0KPiBIaSwNCj4gDQo+IFthdXRv
IGJ1aWxkIHRlc3QgRVJST1Igb24gbmV4dC0yMDE2MDUxN10NCj4gW2Nhbm5vdCBhcHBseSB0byB2
NC42LXJjNyB2NC42LXJjNiB2NC42LXJjNSB2NC42XQ0KPiBbaWYgeW91ciBwYXRjaCBpcyBhcHBs
aWVkIHRvIHRoZSB3cm9uZyBnaXQgdHJlZSwgcGxlYXNlIGRyb3AgdXMgYSBub3RlIHRvDQo+IGhl
bHAgaW1wcm92ZSB0aGUgc3lzdGVtXQ0KPiANCj4gdXJsOsKgwqDCoMKgaHR0cHM6Ly9naXRodWIu
Y29tLzBkYXktY2kvbGludXgvY29tbWl0cy9Bcm5kLUJlcmdtYW5uL3JlbW92ZS11bnUNCj4gc2Vk
LWJsa2Rldl9kYXhfY2FwYWJsZS1mdW5jdGlvbi8yMDE2MDUxOC0xNTU3MjkNCj4gY29uZmlnOiBt
NjhrLWFsbHllc2NvbmZpZyAoYXR0YWNoZWQgYXMgLmNvbmZpZykNCj4gY29tcGlsZXI6IG02OGst
bGludXgtZ2NjIChHQ0MpIDQuOS4wDQo+IHJlcHJvZHVjZToNCj4gwqDCoMKgwqDCoMKgwqDCoHdn
ZXQgaHR0cHM6Ly9naXQua2VybmVsLm9yZy9jZ2l0L2xpbnV4L2tlcm5lbC9naXQvd2ZnL2xrcC10
ZXN0cy5nDQo+IGl0L3BsYWluL3NiaW4vbWFrZS5jcm9zcyAtTyB+L2Jpbi9tYWtlLmNyb3NzDQo+
IMKgwqDCoMKgwqDCoMKgwqBjaG1vZCAreCB+L2Jpbi9tYWtlLmNyb3NzDQo+IMKgwqDCoMKgwqDC
oMKgwqAjIHNhdmUgdGhlIGF0dGFjaGVkIC5jb25maWcgdG8gbGludXggYnVpbGQgdHJlZQ0KPiDC
oMKgwqDCoMKgwqDCoMKgbWFrZS5jcm9zcyBBUkNIPW02OGvCoA0KPiANCj4gQWxsIGVycm9ycyAo
bmV3IG9uZXMgcHJlZml4ZWQgYnkgPj4pOg0KPiANCj4gwqDCoMKgZnMvYmxvY2tfZGV2LmM6IElu
IGZ1bmN0aW9uICdfX2Jsa2Rldl9nZXQnOg0KPiA+IA0KPiA+ID4gDQo+ID4gPiBmcy9ibG9ja19k
ZXYuYzoxMjQyOjU6IGVycm9yOiBpbXBsaWNpdCBkZWNsYXJhdGlvbiBvZiBmdW5jdGlvbg0KPiA+
ID4gJ2Jsa2Rldl9kYXhfY2FwYWJsZScgWy1XZXJyb3I9aW1wbGljaXQtZnVuY3Rpb24tZGVjbGFy
YXRpb25dDQo+IMKgwqDCoMKgwqDCoMKgwqBpZiAoIWJsa2Rldl9kYXhfY2FwYWJsZShiZGV2KSkN
Cj4gwqDCoMKgwqDCoMKgwqDCoF4NCj4gwqDCoMKgY2MxOiBzb21lIHdhcm5pbmdzIGJlaW5nIHRy
ZWF0ZWQgYXMgZXJyb3JzDQo+IA0KPiB2aW0gKy9ibGtkZXZfZGF4X2NhcGFibGUgKzEyNDIgZnMv
YmxvY2tfZGV2LmMNCj4gDQo+IGQzMzc0ODI1IE5laWxCcm93bsKgwqDCoMKgMjAwOS0wMS0wOcKg
wqAxMjM2wqDCoAkJCQkJDQo+IGdvdG8gcmVzdGFydDsNCj4gZDMzNzQ4MjUgTmVpbEJyb3duwqDC
oMKgwqAyMDA5LTAxLTA5wqDCoDEyMzfCoMKgCQkJCX0NCj4gMTE5NmY4YjggVGVqdW4gSGVvwqDC
oMKgwqAyMDExLTA0LTIxwqDCoDEyMzjCoMKgCQkJfQ0KPiA3ZTY5NzIzZiBUZWp1biBIZW/CoMKg
wqDCoDIwMTEtMDUtMjPCoMKgMTIzOcKgwqANCj4gNWEwMjNjZGIgRGFuIFdpbGxpYW1zIDIwMTUt
MTEtMzDCoMKgMTI0MMKgwqAJCQlpZiAoIXJldCkNCj4gew0KPiA3ZTY5NzIzZiBUZWp1biBIZW/C
oMKgwqDCoDIwMTEtMDUtMjPCoMKgMTI0McKgwqAJCQkJYg0KPiBkX3NldF9zaXplKGJkZXYsKGxv
ZmZfdClnZXRfY2FwYWNpdHkoZGlzayk8PDkpOw0KPiA1YTAyM2NkYiBEYW4gV2lsbGlhbXMgMjAx
NS0xMS0zMCBAMTI0MsKgwqAJCQkJaQ0KPiBmICghYmxrZGV2X2RheF9jYXBhYmxlKGJkZXYpKQ0K
PiA1YTAyM2NkYiBEYW4gV2lsbGlhbXMgMjAxNS0xMS0zMMKgwqAxMjQzwqDCoAkJCQkJDQo+IGJk
ZXYtPmJkX2lub2RlLT5pX2ZsYWdzICY9IH5TX0RBWDsNCj4gNWEwMjNjZGIgRGFuIFdpbGxpYW1z
IDIwMTUtMTEtMzDCoMKgMTI0NMKgwqAJCQl9DQo+IDdlNjk3MjNmIFRlanVuIEhlb8KgwqDCoMKg
MjAxMS0wNS0yM8KgwqAxMjQ1wqDCoA0KPiANCj4gOjo6Ojo6IFRoZSBjb2RlIGF0IGxpbmUgMTI0
MiB3YXMgZmlyc3QgaW50cm9kdWNlZCBieSBjb21taXQNCj4gOjo6Ojo6IDVhMDIzY2RiYTUwYzVm
NWYyYmMzNTE3ODNiMzEzMTY5OWRlYjM5MzcgYmxvY2s6IGVuYWJsZSBkYXggZm9yIHJhdw0KPiBi
bG9jayBkZXZpY2VzDQo+IA0KPiA6Ojo6OjogVE86IERhbiBXaWxsaWFtcyA8ZGFuLmoud2lsbGlh
bXNAaW50ZWwuY29tPg0KPiA6Ojo6OjogQ0M6IERhbiBXaWxsaWFtcyA8ZGFuLmoud2lsbGlhbXNA
aW50ZWwuY29tPg0KPiANCj4gLS0tDQo+IDAtREFZIGtlcm5lbCB0ZXN0IGluZnJhc3RydWN0dXJl
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqBPcGVuIFNvdXJjZSBUZWNobm9sb2d5DQo+
IENlbnRlcg0KPiBodHRwczovL2xpc3RzLjAxLm9yZy9waXBlcm1haWwva2J1aWxkLWFsbMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgSW50ZWwNCj4gQ29ycG9yYXRpb24=

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-20 15:48         ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 15:48 UTC (permalink / raw)
  To: lkp, arnd
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, viro,
	dan.j.williams, axboe, linux-nvdimm@lists.01.org, kbuild-all,
	linux-fsdevel, ross.zwisler, tytso, boaz, david, jack

FYI, fs/block_dev.c has multiple updates since then including the code in
question. I just built tot -next m64 kernel with the attached config file,
and confirmed no compile error on the file.
-Toshi

On Fri, 2016-05-20 at 19:32 +0800, kbuild test robot wrote:
> Hi,
> 
> [auto build test ERROR on next-20160517]
> [cannot apply to v4.6-rc7 v4.6-rc6 v4.6-rc5 v4.6]
> [if your patch is applied to the wrong git tree, please drop us a note to
> help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/remove-unu
> sed-blkdev_dax_capable-function/20160518-155729
> config: m68k-allyesconfig (attached as .config)
> compiler: m68k-linux-gcc (GCC) 4.9.0
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.g
> it/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=m68k 
> 
> All errors (new ones prefixed by >>):
> 
>    fs/block_dev.c: In function '__blkdev_get':
> > 
> > > 
> > > fs/block_dev.c:1242:5: error: implicit declaration of function
> > > 'blkdev_dax_capable' [-Werror=implicit-function-declaration]
>         if (!blkdev_dax_capable(bdev))
>         ^
>    cc1: some warnings being treated as errors
> 
> vim +/blkdev_dax_capable +1242 fs/block_dev.c
> 
> d3374825 NeilBrown    2009-01-09  1236  					
> goto restart;
> d3374825 NeilBrown    2009-01-09  1237  				}
> 1196f8b8 Tejun Heo    2011-04-21  1238  			}
> 7e69723f Tejun Heo    2011-05-23  1239  
> 5a023cdb Dan Williams 2015-11-30  1240  			if (!ret)
> {
> 7e69723f Tejun Heo    2011-05-23  1241  				b
> d_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> 5a023cdb Dan Williams 2015-11-30 @1242  				i
> f (!blkdev_dax_capable(bdev))
> 5a023cdb Dan Williams 2015-11-30  1243  					
> bdev->bd_inode->i_flags &= ~S_DAX;
> 5a023cdb Dan Williams 2015-11-30  1244  			}
> 7e69723f Tejun Heo    2011-05-23  1245  
> 
> :::::: The code at line 1242 was first introduced by commit
> :::::: 5a023cdba50c5f5f2bc351783b3131699deb3937 block: enable dax for raw
> block devices
> 
> :::::: TO: Dan Williams <dan.j.williams@intel.com>
> :::::: CC: Dan Williams <dan.j.williams@intel.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology
> Center
> https://lists.01.org/pipermail/kbuild-all                   Intel
> Corporation

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

* Re: [PATCH] remove unused blkdev_dax_capable() function
@ 2016-05-20 15:48         ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 15:48 UTC (permalink / raw)
  To: lkp, arnd
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, viro,
	dan.j.williams, axboe, linux-nvdimm, kbuild-all, linux-fsdevel,
	ross.zwisler, tytso, boaz, david, jack

FYI, fs/block_dev.c has multiple updates since then including the code in
question. I just built tot -next m64 kernel with the attached config file,
and confirmed no compile error on the file.
-Toshi

On Fri, 2016-05-20 at 19:32 +0800, kbuild test robot wrote:
> Hi,
> 
> [auto build test ERROR on next-20160517]
> [cannot apply to v4.6-rc7 v4.6-rc6 v4.6-rc5 v4.6]
> [if your patch is applied to the wrong git tree, please drop us a note to
> help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Arnd-Bergmann/remove-unu
> sed-blkdev_dax_capable-function/20160518-155729
> config: m68k-allyesconfig (attached as .config)
> compiler: m68k-linux-gcc (GCC) 4.9.0
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.g
> it/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=m68k 
> 
> All errors (new ones prefixed by >>):
> 
>    fs/block_dev.c: In function '__blkdev_get':
> > 
> > > 
> > > fs/block_dev.c:1242:5: error: implicit declaration of function
> > > 'blkdev_dax_capable' [-Werror=implicit-function-declaration]
>         if (!blkdev_dax_capable(bdev))
>         ^
>    cc1: some warnings being treated as errors
> 
> vim +/blkdev_dax_capable +1242 fs/block_dev.c
> 
> d3374825 NeilBrown    2009-01-09  1236  					
> goto restart;
> d3374825 NeilBrown    2009-01-09  1237  				}
> 1196f8b8 Tejun Heo    2011-04-21  1238  			}
> 7e69723f Tejun Heo    2011-05-23  1239  
> 5a023cdb Dan Williams 2015-11-30  1240  			if (!ret)
> {
> 7e69723f Tejun Heo    2011-05-23  1241  				b
> d_set_size(bdev,(loff_t)get_capacity(disk)<<9);
> 5a023cdb Dan Williams 2015-11-30 @1242  				i
> f (!blkdev_dax_capable(bdev))
> 5a023cdb Dan Williams 2015-11-30  1243  					
> bdev->bd_inode->i_flags &= ~S_DAX;
> 5a023cdb Dan Williams 2015-11-30  1244  			}
> 7e69723f Tejun Heo    2011-05-23  1245  
> 
> :::::: The code at line 1242 was first introduced by commit
> :::::: 5a023cdba50c5f5f2bc351783b3131699deb3937 block: enable dax for raw
> block devices
> 
> :::::: TO: Dan Williams <dan.j.williams@intel.com>
> :::::: CC: Dan Williams <dan.j.williams@intel.com>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology
> Center
> https://lists.01.org/pipermail/kbuild-all                   Intel
> Corporation

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
  2016-05-20 14:50     ` Kani, Toshimitsu
  (?)
  (?)
@ 2016-05-20 17:34       ` Verma, Vishal L
  -1 siblings, 0 replies; 71+ messages in thread
From: Verma, Vishal L @ 2016-05-20 17:34 UTC (permalink / raw)
  To: Williams, Dan J, viro, toshi.kani, jack, sandeen, david
  Cc: hch, tytso, linux-nvdimm, axboe, linux-kernel, micah.parrish,
	linux-block, adilger.kernel, linux-fsdevel

On Fri, 2016-05-20 at 14:50 +0000, Kani, Toshimitsu wrote:
> On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> > 
> > On 5/10/16 11:23 AM, Toshi Kani wrote:
> > > 
> > > 
> > > When a partition is not aligned by 4KB, mount -o dax succeeds,
> > Sorry for being late, but -
> > 
> > Shouldn't this and all subsequent patch commits refer to
> > PAGE_SIZE, rather than "4kB?"
> Right, the patch commits should refer to PAGE_SIZE to match with the
> code
> changes.  I am afraid it may be a bit too late to update, though...
> 
> Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?
> 
> Thanks,
> -Toshi

Hi Toshi,

Is it just commit message changes? If so I'm not sure it is worthwhile
to rebase everything for that - i.e. my dax error handling series and
Ross' dax-locking branch would both have to be rebased..

If there are and fixes for code, we can do them as an add-on patch
though.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 17:34       ` Verma, Vishal L
  0 siblings, 0 replies; 71+ messages in thread
From: Verma, Vishal L @ 2016-05-20 17:34 UTC (permalink / raw)
  To: Williams, Dan J, viro, toshi.kani, jack, sandeen, david
  Cc: micah.parrish, linux-kernel, linux-block, hch, adilger.kernel,
	axboe, linux-nvdimm, linux-fsdevel, ross.zwisler, tytso, boaz

T24gRnJpLCAyMDE2LTA1LTIwIGF0IDE0OjUwICswMDAwLCBLYW5pLCBUb3NoaW1pdHN1IHdyb3Rl
Og0KPiBPbiBUaHUsIDIwMTYtMDUtMTkgYXQgMTg6MzcgLTA1MDAsIEVyaWMgU2FuZGVlbiB3cm90
ZToNCj4gPiANCj4gPiBPbiA1LzEwLzE2IDExOjIzIEFNLCBUb3NoaSBLYW5pIHdyb3RlOg0KPiA+
ID4gDQo+ID4gPiANCj4gPiA+IFdoZW4gYSBwYXJ0aXRpb24gaXMgbm90IGFsaWduZWQgYnkgNEtC
LCBtb3VudCAtbyBkYXggc3VjY2VlZHMsDQo+ID4gU29ycnkgZm9yIGJlaW5nIGxhdGUsIGJ1dCAt
DQo+ID4gDQo+ID4gU2hvdWxkbid0IHRoaXMgYW5kIGFsbCBzdWJzZXF1ZW50IHBhdGNoIGNvbW1p
dHMgcmVmZXIgdG8NCj4gPiBQQUdFX1NJWkUsIHJhdGhlciB0aGFuICI0a0I/Ig0KPiBSaWdodCwg
dGhlIHBhdGNoIGNvbW1pdHMgc2hvdWxkIHJlZmVyIHRvIFBBR0VfU0laRSB0byBtYXRjaCB3aXRo
IHRoZQ0KPiBjb2RlDQo+IGNoYW5nZXMuwqDCoEkgYW0gYWZyYWlkIGl0IG1heSBiZSBhIGJpdCB0
b28gbGF0ZSB0byB1cGRhdGUsIHRob3VnaC4uLg0KPiANCj4gVmlzaGFsLCBkbyB5b3UgdGhpbmsg
eW91IGNhbiB0d2VhayB0aGUgbG9ncywgIjRLQiIgdG8gIlBBR0VfU0laRSI/DQo+IA0KPiBUaGFu
a3MsDQo+IC1Ub3NoaQ0KDQpIaSBUb3NoaSwNCg0KSXMgaXQganVzdCBjb21taXQgbWVzc2FnZSBj
aGFuZ2VzPyBJZiBzbyBJJ20gbm90IHN1cmUgaXQgaXMgd29ydGh3aGlsZQ0KdG8gcmViYXNlIGV2
ZXJ5dGhpbmcgZm9yIHRoYXQgLSBpLmUuIG15IGRheCBlcnJvciBoYW5kbGluZyBzZXJpZXMgYW5k
DQpSb3NzJyBkYXgtbG9ja2luZyBicmFuY2ggd291bGQgYm90aCBoYXZlIHRvIGJlIHJlYmFzZWQu
Lg0KDQpJZiB0aGVyZSBhcmUgYW5kIGZpeGVzIGZvciBjb2RlLCB3ZSBjYW4gZG8gdGhlbSBhcyBh
biBhZGQtb24gcGF0Y2gNCnRob3VnaC4=

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 17:34       ` Verma, Vishal L
  0 siblings, 0 replies; 71+ messages in thread
From: Verma, Vishal L @ 2016-05-20 17:34 UTC (permalink / raw)
  To: Williams, Dan J, viro, toshi.kani, jack, sandeen, david
  Cc: micah.parrish, linux-kernel, linux-block, hch, adilger.kernel,
	axboe, linux-nvdimm@lists.01.org, linux-fsdevel, ross.zwisler,
	tytso, boaz

On Fri, 2016-05-20 at 14:50 +0000, Kani, Toshimitsu wrote:
> On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> > 
> > On 5/10/16 11:23 AM, Toshi Kani wrote:
> > > 
> > > 
> > > When a partition is not aligned by 4KB, mount -o dax succeeds,
> > Sorry for being late, but -
> > 
> > Shouldn't this and all subsequent patch commits refer to
> > PAGE_SIZE, rather than "4kB?"
> Right, the patch commits should refer to PAGE_SIZE to match with the
> code
> changes.  I am afraid it may be a bit too late to update, though...
> 
> Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?
> 
> Thanks,
> -Toshi

Hi Toshi,

Is it just commit message changes? If so I'm not sure it is worthwhile
to rebase everything for that - i.e. my dax error handling series and
Ross' dax-locking branch would both have to be rebased..

If there are and fixes for code, we can do them as an add-on patch
though.

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 17:34       ` Verma, Vishal L
  0 siblings, 0 replies; 71+ messages in thread
From: Verma, Vishal L @ 2016-05-20 17:34 UTC (permalink / raw)
  To: Williams, Dan J, viro, toshi.kani, jack, sandeen, david
  Cc: micah.parrish, linux-kernel, linux-block, hch, adilger.kernel,
	axboe, linux-nvdimm, linux-fsdevel, ross.zwisler, tytso, boaz

On Fri, 2016-05-20 at 14:50 +0000, Kani, Toshimitsu wrote:
> On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> > 
> > On 5/10/16 11:23 AM, Toshi Kani wrote:
> > > 
> > > 
> > > When a partition is not aligned by 4KB, mount -o dax succeeds,
> > Sorry for being late, but -
> > 
> > Shouldn't this and all subsequent patch commits refer to
> > PAGE_SIZE, rather than "4kB?"
> Right, the patch commits should refer to PAGE_SIZE to match with the
> code
> changes.  I am afraid it may be a bit too late to update, though...
> 
> Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?
> 
> Thanks,
> -Toshi

Hi Toshi,

Is it just commit message changes? If so I'm not sure it is worthwhile
to rebase everything for that - i.e. my dax error handling series and
Ross' dax-locking branch would both have to be rebased..

If there are and fixes for code, we can do them as an add-on patch
though.

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
  2016-05-20 17:34       ` Verma, Vishal L
  (?)
  (?)
@ 2016-05-20 17:49         ` Kani, Toshimitsu
  -1 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 17:49 UTC (permalink / raw)
  To: dan.j.williams, viro, jack, david, sandeen, vishal.l.verma
  Cc: hch, tytso, linux-nvdimm, axboe, linux-kernel, Parrish,
	Micah \ linux-block@vger.kernel.org (HP Servers Linux
	R&D)" <micah.parrish@hpe.com>,),
	adilger.kernel, linux-fsdevel

On Fri, 2016-05-20 at 17:34 +0000, Verma, Vishal L wrote:
> On Fri, 2016-05-20 at 14:50 +0000, Kani, Toshimitsu wrote:
> > On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> > > On 5/10/16 11:23 AM, Toshi Kani wrote:
> > > > 
> > > > When a partition is not aligned by 4KB, mount -o dax succeeds,
> > >
> > > Sorry for being late, but -
> > > 
> > > Shouldn't this and all subsequent patch commits refer to
> > > PAGE_SIZE, rather than "4kB?"
> >
> > Right, the patch commits should refer to PAGE_SIZE to match with the
> > code changes.  I am afraid it may be a bit too late to update,
> > though...
> > 
> > Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?
> > 
> > Thanks,
> > -Toshi
>
> Hi Toshi,
> 
> Is it just commit message changes? If so I'm not sure it is worthwhile
> to rebase everything for that - i.e. my dax error handling series and
> Ross' dax-locking branch would both have to be rebased..
> 
> If there are and fixes for code, we can do them as an add-on patch
> though.

Hi Vishal,

Yes, it is just commit messages, and it's OK not to make this change.

Thanks,
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 17:49         ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 17:49 UTC (permalink / raw)
  To: dan.j.williams, viro, jack, david, sandeen, vishal.l.verma
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, axboe,
	linux-nvdimm, linux-fsdevel, ross.zwisler, tytso, boaz

T24gRnJpLCAyMDE2LTA1LTIwIGF0IDE3OjM0ICswMDAwLCBWZXJtYSwgVmlzaGFsIEwgd3JvdGU6
DQo+IE9uIEZyaSwgMjAxNi0wNS0yMCBhdCAxNDo1MCArMDAwMCwgS2FuaSwgVG9zaGltaXRzdSB3
cm90ZToNCj4gPiBPbiBUaHUsIDIwMTYtMDUtMTkgYXQgMTg6MzcgLTA1MDAsIEVyaWMgU2FuZGVl
biB3cm90ZToNCj4gPiA+IE9uIDUvMTAvMTYgMTE6MjMgQU0sIFRvc2hpIEthbmkgd3JvdGU6DQo+
ID4gPiA+wqANCj4gPiA+ID4gV2hlbiBhIHBhcnRpdGlvbiBpcyBub3QgYWxpZ25lZCBieSA0S0Is
IG1vdW50IC1vIGRheCBzdWNjZWVkcywNCj4gPiA+DQo+ID4gPiBTb3JyeSBmb3IgYmVpbmcgbGF0
ZSwgYnV0IC0NCj4gPiA+IA0KPiA+ID4gU2hvdWxkbid0IHRoaXMgYW5kIGFsbCBzdWJzZXF1ZW50
IHBhdGNoIGNvbW1pdHMgcmVmZXIgdG8NCj4gPiA+IFBBR0VfU0laRSwgcmF0aGVyIHRoYW4gIjRr
Qj8iDQo+ID4NCj4gPiBSaWdodCwgdGhlIHBhdGNoIGNvbW1pdHMgc2hvdWxkIHJlZmVyIHRvIFBB
R0VfU0laRSB0byBtYXRjaCB3aXRoIHRoZQ0KPiA+IGNvZGUgY2hhbmdlcy7CoMKgSSBhbSBhZnJh
aWQgaXQgbWF5IGJlIGEgYml0IHRvbyBsYXRlIHRvIHVwZGF0ZSwNCj4gPiB0aG91Z2guLi4NCj4g
PiANCj4gPiBWaXNoYWwsIGRvIHlvdSB0aGluayB5b3UgY2FuIHR3ZWFrIHRoZSBsb2dzLCAiNEtC
IiB0byAiUEFHRV9TSVpFIj8NCj4gPiANCj4gPiBUaGFua3MsDQo+ID4gLVRvc2hpDQo+DQo+IEhp
IFRvc2hpLA0KPiANCj4gSXMgaXQganVzdCBjb21taXQgbWVzc2FnZSBjaGFuZ2VzPyBJZiBzbyBJ
J20gbm90IHN1cmUgaXQgaXMgd29ydGh3aGlsZQ0KPiB0byByZWJhc2UgZXZlcnl0aGluZyBmb3Ig
dGhhdCAtIGkuZS4gbXkgZGF4IGVycm9yIGhhbmRsaW5nIHNlcmllcyBhbmQNCj4gUm9zcycgZGF4
LWxvY2tpbmcgYnJhbmNoIHdvdWxkIGJvdGggaGF2ZSB0byBiZSByZWJhc2VkLi4NCj4gDQo+IElm
IHRoZXJlIGFyZSBhbmQgZml4ZXMgZm9yIGNvZGUsIHdlIGNhbiBkbyB0aGVtIGFzIGFuIGFkZC1v
biBwYXRjaA0KPiB0aG91Z2guDQoNCkhpIFZpc2hhbCwNCg0KWWVzLCBpdCBpcyBqdXN0IGNvbW1p
dCBtZXNzYWdlcywgYW5kIGl0J3MgT0sgbm90IHRvIG1ha2UgdGhpcyBjaGFuZ2UuDQoNClRoYW5r
cywNCi1Ub3NoaQ==

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 17:49         ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 17:49 UTC (permalink / raw)
  To: dan.j.williams, viro, jack, david, sandeen, vishal.l.verma
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, axboe,
	linux-nvdimm@lists.01.org, linux-fsdevel, ross.zwisler, tytso,
	boaz

On Fri, 2016-05-20 at 17:34 +0000, Verma, Vishal L wrote:
> On Fri, 2016-05-20 at 14:50 +0000, Kani, Toshimitsu wrote:
> > On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> > > On 5/10/16 11:23 AM, Toshi Kani wrote:
> > > > 
> > > > When a partition is not aligned by 4KB, mount -o dax succeeds,
> > >
> > > Sorry for being late, but -
> > > 
> > > Shouldn't this and all subsequent patch commits refer to
> > > PAGE_SIZE, rather than "4kB?"
> >
> > Right, the patch commits should refer to PAGE_SIZE to match with the
> > code changes.  I am afraid it may be a bit too late to update,
> > though...
> > 
> > Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?
> > 
> > Thanks,
> > -Toshi
>
> Hi Toshi,
> 
> Is it just commit message changes? If so I'm not sure it is worthwhile
> to rebase everything for that - i.e. my dax error handling series and
> Ross' dax-locking branch would both have to be rebased..
> 
> If there are and fixes for code, we can do them as an add-on patch
> though.

Hi Vishal,

Yes, it is just commit messages, and it's OK not to make this change.

Thanks,
-Toshi

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

* Re: [PATCH v4 0/6] Add alignment check for DAX mount
@ 2016-05-20 17:49         ` Kani, Toshimitsu
  0 siblings, 0 replies; 71+ messages in thread
From: Kani, Toshimitsu @ 2016-05-20 17:49 UTC (permalink / raw)
  To: dan.j.williams, viro, jack, david, sandeen, vishal.l.verma
  Cc: Parrish, Micah (HP Servers Linux R&D),
	linux-kernel, linux-block, hch, adilger.kernel, axboe,
	linux-nvdimm, linux-fsdevel, ross.zwisler, tytso, boaz

On Fri, 2016-05-20 at 17:34 +0000, Verma, Vishal L wrote:
> On Fri, 2016-05-20 at 14:50 +0000, Kani, Toshimitsu wrote:
> > On Thu, 2016-05-19 at 18:37 -0500, Eric Sandeen wrote:
> > > On 5/10/16 11:23 AM, Toshi Kani wrote:
> > > > 
> > > > When a partition is not aligned by 4KB, mount -o dax succeeds,
> > >
> > > Sorry for being late, but -
> > > 
> > > Shouldn't this and all subsequent patch commits refer to
> > > PAGE_SIZE, rather than "4kB?"
> >
> > Right, the patch commits should refer to PAGE_SIZE to match with the
> > code changes.  I am afraid it may be a bit too late to update,
> > though...
> > 
> > Vishal, do you think you can tweak the logs, "4KB" to "PAGE_SIZE"?
> > 
> > Thanks,
> > -Toshi
>
> Hi Toshi,
> 
> Is it just commit message changes? If so I'm not sure it is worthwhile
> to rebase everything for that - i.e. my dax error handling series and
> Ross' dax-locking branch would both have to be rebased..
> 
> If there are and fixes for code, we can do them as an add-on patch
> though.

Hi Vishal,

Yes, it is just commit messages, and it's OK not to make this change.

Thanks,
-Toshi

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

end of thread, other threads:[~2016-05-20 17:50 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10 16:23 [PATCH v4 0/6] Add alignment check for DAX mount Toshi Kani
2016-05-10 16:23 ` Toshi Kani
2016-05-10 16:23 ` Toshi Kani
2016-05-10 16:23 ` [PATCH v4 1/6] block: Add vfs_msg() interface Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23 ` [PATCH v4 2/6] block: Add bdev_dax_supported() for dax mount checks Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23 ` [PATCH v4 3/6] ext4: Add alignment check for DAX mount Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23 ` [PATCH v4 4/6] ext2: " Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23 ` [PATCH v4 5/6] xfs: " Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23 ` [PATCH v4 6/6] block: Update blkdev_dax_capable() for consistency Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 16:23   ` Toshi Kani
2016-05-10 19:49   ` Dan Williams
2016-05-10 19:49     ` Dan Williams
2016-05-10 19:49     ` Dan Williams
2016-05-10 21:36     ` Toshi Kani
2016-05-10 21:36       ` Toshi Kani
2016-05-10 21:36       ` Toshi Kani
2016-05-11  8:05   ` Jan Kara
2016-05-11  8:05     ` Jan Kara
2016-05-11  8:05     ` Jan Kara
2016-05-11 14:25     ` Toshi Kani
2016-05-11 14:25       ` Toshi Kani
2016-05-11 14:25       ` Toshi Kani
2016-05-11 15:26       ` Jan Kara
2016-05-11 15:26         ` Jan Kara
2016-05-11 15:26         ` Jan Kara
2016-05-17 22:07   ` Dan Williams
2016-05-17 22:07     ` Dan Williams
2016-05-17 22:07     ` Dan Williams
2016-05-17 23:02     ` Toshi Kani
2016-05-18  7:54   ` [PATCH] remove unused blkdev_dax_capable() function Arnd Bergmann
2016-05-18  7:54     ` Arnd Bergmann
2016-05-18 14:01     ` Toshi Kani
2016-05-18 14:01       ` Toshi Kani
2016-05-18 14:01       ` Toshi Kani
2016-05-18 19:30     ` Vishal Verma
2016-05-18 19:30       ` Vishal Verma
2016-05-18 19:30       ` Vishal Verma
2016-05-20 11:32     ` kbuild test robot
2016-05-20 11:32       ` kbuild test robot
2016-05-20 11:32       ` kbuild test robot
2016-05-20 15:48       ` Kani, Toshimitsu
2016-05-20 15:48         ` Kani, Toshimitsu
2016-05-20 15:48         ` Kani, Toshimitsu
2016-05-20 15:48         ` Kani, Toshimitsu
2016-05-11 13:20 ` [PATCH v4 0/6] Add alignment check for DAX mount Carlos Maiolino
2016-05-19 23:37 ` Eric Sandeen
2016-05-19 23:37   ` Eric Sandeen
2016-05-19 23:37   ` Eric Sandeen
2016-05-20 14:50   ` Kani, Toshimitsu
2016-05-20 14:50     ` Kani, Toshimitsu
2016-05-20 14:50     ` Kani, Toshimitsu
2016-05-20 14:50     ` Kani, Toshimitsu
2016-05-20 17:34     ` Verma, Vishal L
2016-05-20 17:34       ` Verma, Vishal L
2016-05-20 17:34       ` Verma, Vishal L
2016-05-20 17:34       ` Verma, Vishal L
2016-05-20 17:49       ` Kani, Toshimitsu
2016-05-20 17:49         ` Kani, Toshimitsu
2016-05-20 17:49         ` Kani, Toshimitsu
2016-05-20 17:49         ` Kani, Toshimitsu

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.