Re: [fstests PATCH v3] generic: add test for DAX MAP_SYNC support

2017-11-16 Thread Ross Zwisler
On Thu, Oct 26, 2017 at 08:56:38AM +1100, Dave Chinner wrote: > On Wed, Oct 25, 2017 at 02:47:04PM -0600, Ross Zwisler wrote: > > Add a test that exercises DAX's new MAP_SYNC flag. > > > > This test creates a file and writes to it via an mmap(), but never syncs > > via

Re: [patch] dax: fix PMD faults on zero-length files

2017-11-15 Thread Ross Zwisler
ed that SIGBUS was > > received where expected. > > > > I assume this needs: > >Fixes: 642261ac995e ("dax: add struct iomap based DAX PMD support") >Cc: <sta...@vger.kernel.org> > > ...otherwise looks good to me. Yep, this fix looks good, tha

Re: [PATCH 17/17] xfs: support for synchronous DAX faults

2017-10-31 Thread Ross Zwisler
On Tue, Oct 31, 2017 at 02:50:01PM -0700, Dan Williams wrote: > On Tue, Oct 31, 2017 at 8:19 AM, Jan Kara wrote: > > On Fri 27-10-17 12:08:34, Jan Kara wrote: > >> On Fri 27-10-17 08:16:11, Dave Chinner wrote: > >> > On Thu, Oct 26, 2017 at 05:48:04PM +0200, Jan Kara wrote: > >> > >

Re: [PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-26 Thread Ross Zwisler
On Thu, Oct 26, 2017 at 03:24:02PM +0200, Jan Kara wrote: > On Tue 24-10-17 15:10:07, Ross Zwisler wrote: > > On Tue, Oct 24, 2017 at 05:24:15PM +0200, Jan Kara wrote: > > > Signed-off-by: Jan Kara <j...@suse.cz> > > > > This looks unchanged since t

[fstests PATCH v3] generic: add test for DAX MAP_SYNC support

2017-10-25 Thread Ross Zwisler
the mmap(), so we can't do any data integrity checking. We can only verify that the metadata writes for the page faults happened. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- Changes since v2: - Fixed _require_log_writes() so that DAX will be disallowed if the v

Re: [fstests PATCH v2] generic: add test for DAX MAP_SYNC support

2017-10-25 Thread Ross Zwisler
On Wed, Oct 25, 2017 at 03:19:22PM +0300, Amir Goldstein wrote: > On Sun, Oct 22, 2017 at 9:56 AM, Amir Goldstein <amir7...@gmail.com> wrote: > > On Sat, Oct 21, 2017 at 12:25 AM, Ross Zwisler > > <ross.zwis...@linux.intel.com> wrote: > >> Add a test th

Re: [PATCH 17/17] xfs: support for synchronous DAX faults

2017-10-24 Thread Ross Zwisler
; > Signed-off-by: Jan Kara <j...@suse.cz> I don't know enough about XFS dirty inode handling to be able to comment on the changes in xfs_file_iomap_begin(), but the rest looks good. Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> __

Re: [PATCH 01/17] mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags

2017-10-24 Thread Ross Zwisler
Hellwig <h...@lst.de> > Suggested-by: Linus Torvalds <torva...@linux-foundation.org> > Signed-off-by: Dan Williams <dan.j.willi...@intel.com> > Signed-off-by: Jan Kara <j...@suse.cz> Looks great. Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 05:24:15PM +0200, Jan Kara wrote: > Signed-off-by: Jan Kara This looks unchanged since the previous version? > --- > man2/mmap.2 | 30 ++ > 1 file changed, 30 insertions(+) > > diff --git a/man2/mmap.2 b/man2/mmap.2 > index

Re: [PATCH 2/2] dm log writes: add support for DAX

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 03:22:23PM -0400, Mike Snitzer wrote: > On Fri, Oct 20 2017 at 1:24am -0400, > Ross Zwisler <ross.zwis...@linux.intel.com> wrote: > > > Now that we have the ability log filesystem writes using a flat buffer, add > > support for DAX. Unfortun

Re: [PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-24 Thread Ross Zwisler
On Tue, Oct 24, 2017 at 03:27:13PM +0200, Jan Kara wrote: > On Fri 20-10-17 15:47:53, Ross Zwisler wrote: > > On Thu, Oct 19, 2017 at 02:58:17PM +0200, Jan Kara wrote: > > > Signed-off-by: Jan Kara <j...@suse.cz> > > > --- > > > man2/mmap.2 | 30 ++

Re: [PATCH 2/2] dm log writes: add support for DAX

2017-10-23 Thread Ross Zwisler
On Mon, Oct 23, 2017 at 01:34:09PM -0400, Josef Bacik wrote: > On Thu, Oct 19, 2017 at 11:24:04PM -0600, Ross Zwisler wrote: > > Now that we have the ability log filesystem writes using a flat buffer, add > > support for DAX. Unfortunately we can't easily track data that has been

Re: [PATCH] mmap.2: Add description of MAP_SHARED_VALIDATE and MAP_SYNC

2017-10-20 Thread Ross Zwisler
On Thu, Oct 19, 2017 at 02:58:17PM +0200, Jan Kara wrote: > Signed-off-by: Jan Kara > --- > man2/mmap.2 | 30 ++ > 1 file changed, 30 insertions(+) > > diff --git a/man2/mmap.2 b/man2/mmap.2 > index 47c3148653be..598ff0c64f7f 100644 > --- a/man2/mmap.2

[fstests PATCH] generic: add test for DAX MAP_SYNC support

2017-10-19 Thread Ross Zwisler
the mmap(), so we can't do any data integrity checking. We can only verify that the metadata writes for the page faults happened. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- For this test to run successfully you'll need both Jan's MAP_SYNC series: https://www.spinics.net

[PATCH 2/2] dm log writes: add support for DAX

2017-10-19 Thread Ross Zwisler
that can test the new MAP_SYNC DAX flag. By logging the filesystem activity with dm-log-writes we can show that the MAP_SYNC page faults are writing out their metadata as they happen, instead of requiring an explicit msync/fsync. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com>

[PATCH 1/2] dm log writes: Add support for inline data buffers

2017-10-19 Thread Ross Zwisler
() which allows us to write filesystem data using a flat buffer as a source, and wire it up in log_one_block(). Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- drivers/md/dm-log-writes.c | 90 +++--- 1 file changed, 86 insertions

[PATCH v2] dev/dax: fix uninitialized variable build warning

2017-10-18 Thread Ross Zwisler
Fix this build warning: warning: 'phys' may be used uninitialized in this function [-Wuninitialized] As reported here: https://lkml.org/lkml/2017/10/16/152 http://kisskb.ellerman.id.au/kisskb/buildresult/13181373/log/ Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- drive

[PATCH 1/2] dev/dax: fix uninitialized variable build warning

2017-10-18 Thread Ross Zwisler
'phys' being uninitialized if you broke out early in the above loop, in which case 'phys' will be set. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- drivers/dax/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dax/device.c b/drivers/dax/de

nfit test deadlock

2017-10-11 Thread Ross Zwisler
Hey Dan, I was getting the ndctl unit tests working again in my setup today, and on the first run of ndctl's "make check" hit a deadlock. This seems to be very easy to reproduce, all you have to do is specify a number of jobs to make that is larger than 1 (which I was accidentally doing via an

Re: [PATCH v2 0/5] ext4: DAX data corruption fixes

2017-09-29 Thread Ross Zwisler
On Mon, Sep 11, 2017 at 11:05:21PM -0600, Ross Zwisler wrote: > This series prevents a pair of data corruptions with ext4 + DAX. The first > such corruption happens when combining the inline data feature with DAX, > and the second happens when combining data journaling with DAX. >

Re: [PATCH 1/7] xfs: always use DAX if mount option is used

2017-09-27 Thread Ross Zwisler
On Tue, Sep 26, 2017 at 11:40:01PM -0700, Christoph Hellwig wrote: > On Tue, Sep 26, 2017 at 11:30:57AM -0600, Ross Zwisler wrote: > > I agree that Christoph's idea about having the system intelligently adjust > > to > > use DAX based on performance information it gathers

Re: [PATCH 6/7] mm, fs: introduce file_operations->post_mmap()

2017-09-27 Thread Ross Zwisler
On Wed, Sep 27, 2017 at 01:35:27PM +0200, Jan Kara wrote: > On Tue 26-09-17 14:41:53, Dan Williams wrote: > > On Tue, Sep 26, 2017 at 2:06 PM, Ross Zwisler > > <ross.zwis...@linux.intel.com> wrote: > > > On Tue, Sep 26, 2017 at 12:19:21PM -0700, Dan Williams wrot

Re: [PATCH 6/7] mm, fs: introduce file_operations->post_mmap()

2017-09-26 Thread Ross Zwisler
On Tue, Sep 26, 2017 at 12:19:21PM -0700, Dan Williams wrote: > On Tue, Sep 26, 2017 at 11:57 AM, Ross Zwisler <> > > This decision can only be made (in this > > proposed scheme) *after* the inode->i_mapping->i_mmap tree has been > > populated, which means we need

Re: [PATCH 7/7] xfs: re-enable XFS per-inode DAX

2017-09-26 Thread Ross Zwisler
On Tue, Sep 26, 2017 at 08:36:11AM +0200, Christoph Hellwig wrote: > On Mon, Sep 25, 2017 at 05:14:04PM -0600, Ross Zwisler wrote: > > Re-enable the XFS per-inode DAX flag, preventing S_DAX from changing when > > any mappings are present. > > Before we re-enable it please co

Re: [PATCH 6/7] mm, fs: introduce file_operations->post_mmap()

2017-09-26 Thread Ross Zwisler
On Mon, Sep 25, 2017 at 04:38:45PM -0700, Dan Williams wrote: > On Mon, Sep 25, 2017 at 4:14 PM, Ross Zwisler > <ross.zwis...@linux.intel.com> wrote: > > When mappings are created the vma->vm_flags that they use vary based on > > whether the inode being mapped is us

Re: [PATCH 1/7] xfs: always use DAX if mount option is used

2017-09-26 Thread Ross Zwisler
On Tue, Sep 26, 2017 at 09:38:12AM +1000, Dave Chinner wrote: > On Mon, Sep 25, 2017 at 05:13:58PM -0600, Ross Zwisler wrote: > > Before support for the per-inode DAX flag was disabled the XFS the code had > > an issue where the user couldn't reliably tell whether or not DAX was

Re: [PATCH 1/7] xfs: always use DAX if mount option is used

2017-09-26 Thread Ross Zwisler
On Tue, Sep 26, 2017 at 04:37:43PM +0200, Christoph Hellwig wrote: > On Tue, Sep 26, 2017 at 09:09:57PM +1000, Dave Chinner wrote: > > Well, quite frankly, I never wanted the mount option for XFS. It was > > supposed to be for initial testing only, then we'd /always/ use the > > the inode flags.

Re: [PATCH 2/7] xfs: validate bdev support for DAX inode flag

2017-09-26 Thread Ross Zwisler
On Tue, Sep 26, 2017 at 08:36:50AM +0200, Christoph Hellwig wrote: > On Mon, Sep 25, 2017 at 05:13:59PM -0600, Ross Zwisler wrote: > > Currently only the blocksize is checked, but we should really be calling > > bdev_dax_supported() which also tests to make sure we can get a > &

[PATCH 6/7] mm, fs: introduce file_operations->post_mmap()

2017-09-25 Thread Ross Zwisler
is post_mmap() op now happens at a time when we can be sure whether the mapping will use DAX or not, and we can set up the vma->vm_flags appropriately. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/xfs/xfs_file.c | 15 ++- include/linux/fs.h | 1 + mm/mm

[PATCH 2/7] xfs: validate bdev support for DAX inode flag

2017-09-25 Thread Ross Zwisler
fill_super(). Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> Reviewed-by: Christoph Hellwig <h...@lst.de> --- fs/xfs/xfs_ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 26faeb9..0433aef 100644 --- a/fs/xf

[PATCH 7/7] xfs: re-enable XFS per-inode DAX

2017-09-25 Thread Ross Zwisler
Re-enable the XFS per-inode DAX flag, preventing S_DAX from changing when any mappings are present. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/xfs/xfs_ioctl.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_ioctl.c b/

[PATCH 5/7] xfs: introduce xfs_is_dax_state_changing

2017-09-25 Thread Ross Zwisler
Pull this code out of xfs_ioctl_setattr_dax_invalidate() as it will be used in multiple places soon. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/xfs/xfs_ioctl.c | 34 +++--- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/

[PATCH 4/7] xfs: protect S_DAX transitions in XFS write path

2017-09-25 Thread Ross Zwisler
APLOCK|XFS_IOLOCK) sets S_DAX releases XFS_MMAPLOCK and XFS_IOLOCK xfs_file_buffered_aio_write() does buffered I/O to DAX inode, death Fix this by ensuring that we only check S_DAX when we hold the XFS_IOLOCK in the write path. Signed-off-by

[PATCH 1/7] xfs: always use DAX if mount option is used

2017-09-25 Thread Ross Zwisler
s that DAX will always be used for all inodes on a filesystem mounted with -o dax, making the usage reliable and detectable. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> Reviewed-by: Christoph Hellwig <h...@lst.de> --- fs/xfs/xfs_ioctl.c | 11 +-- 1 file changed, 9 inse

[PATCH 3/7] xfs: protect S_DAX transitions in XFS read path

2017-09-25 Thread Ross Zwisler
d path. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/xfs/xfs_file.c | 42 +- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index ebdd0bd..ca4c8fd 100644 --- a/fs/xfs/xfs_file.c

Re: [fstests PATCH v2] xfs: add regression test for DAX mount option usage

2017-09-15 Thread Ross Zwisler
On Thu, Sep 14, 2017 at 02:57:41PM +0800, Eryu Guan wrote: > Hi Ross, > > On Mon, Sep 11, 2017 at 02:01:03PM -0600, Ross Zwisler wrote: > > This adds a regression test for the following kernel patch: > > > > xfs: always use DAX if mount option is used > &

Re: DAX enabled. Warning: EXPERIMENTAL, use at your own risk

2017-09-13 Thread Ross Zwisler
On Wed, Sep 13, 2017 at 06:26:10PM +, Soccer Liu wrote: > > Hi: > During my debugging, I kept seeing this message from the DAX enabled mount > operation. > > [    0.757990] EXT4-fs (pmem0): DAX enabled. Warning: EXPERIMENTAL, use at > your own risk > > I am wondering how far this DAX

Re: [PATCH] xfs: add regression test for DAX mount option usage

2017-09-13 Thread Ross Zwisler
On Wed, Sep 13, 2017 at 09:47:29AM +1000, Dave Chinner wrote: <> > I think similar concerns exist with using perf, too I though that using perf addressed both concerns? > > > So what happens when the user is already tracing the test to > > > find a bug and the test turns all their tracing

Re: [PATCH] xfs: add regression test for DAX mount option usage

2017-09-12 Thread Ross Zwisler
On Tue, Sep 12, 2017 at 04:44:11PM +1000, Dave Chinner wrote: > On Fri, Sep 08, 2017 at 03:21:53PM -0600, Ross Zwisler wrote: > > This adds a regression test for the following kernel patch: > > > > xfs: always use DAX if mount option is used > > > > This test

[PATCH v2 4/5] ext4: add ext4_should_use_dax()

2017-09-11 Thread Ross Zwisler
This helper, in the spirit of ext4_should_dioread_nolock() et al., replaces the complex conditional in ext4_set_inode_flags(). Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/ext4/inode.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff

[PATCH v2 5/5] ext4: remove duplicate extended attributes defs

2017-09-11 Thread Ross Zwisler
get merged for project quota... */ Those uapi changes were merged by this commit: commit 334e580a6f97 ("fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion") so all the definitions needed by ext4 are available in include/uapi/linux/fs.h. Remove the duplicates from ext4.h. Signed-

[PATCH v2 3/5] ext4: add sanity check for encryption + DAX

2017-09-11 Thread Ross Zwisler
that already has data, in which case we need to add code to safely transition S_DAX. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> CC: sta...@vger.kernel.org --- fs/ext4/super.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 4

[PATCH v2 1/5] ext4: prevent data corruption with inline data + DAX

2017-09-11 Thread Ross Zwisler
to mkfs.ext4. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> CC: sta...@vger.kernel.org --- fs/ext4/inline.c | 10 -- fs/ext4/super.c | 5 + 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 28c5c3a..fd95019

[PATCH v2 0/5] ext4: DAX data corruption fixes

2017-09-11 Thread Ross Zwisler
://patchwork.kernel.org/patch/9948377/ https://patchwork.kernel.org/patch/9948381/ My opinion is that the first three patches in this series should be applied to the v4.14 RC series and backported to stable. The last two patches in this series are just cleanup and can probably wait until v4.15. Ross

[PATCH v2 2/5] ext4: prevent data corruption with journaling + DAX

2017-09-11 Thread Ross Zwisler
. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> Suggested-by: Jan Kara <j...@suse.cz> --- fs/ext4/inode.c | 5 - fs/ext4/ioctl.c | 16 +--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index e963508..32

[PATCH 2/3] ext4: test for DAX + journaling corruption

2017-09-11 Thread Ross Zwisler
on or off journaling. The latter is how we prevent this issue in the kernel. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- .gitignore | 1 + src/Makefile| 2 +- src/t_ext4_dax_journal_corruption.

[PATCH 3/3] ext4: test for inline data + DAX corruption

2017-09-11 Thread Ross Zwisler
-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- .gitignore | 1 + src/Makefile | 3 +- src/t_ext4_dax_inline_corruption.c | 70 +++ tests/ext4/031 | 84 ++ tests/ex

[PATCH 1/3] .gitignore: ignore cscope files

2017-09-11 Thread Ross Zwisler
Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- .gitignore | 4 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 28fe84d..2accc37 100644 --- a/.gitignore +++ b/.gitignore @@ -238,3 +238,7 @@ /tests/xfs/033.out /tests/xfs/071.out /tests/xfs/0

[fstests PATCH v2] xfs: add regression test for DAX mount option usage

2017-09-11 Thread Ross Zwisler
ctually do anything. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> Suggested-by: Christoph Hellwig <h...@infradead.org> --- Changes since v1: - Use perf instead of tracepoints to detect whether DAX is used. (Dan) ---

Re: Unexpected writes seen on a Read-only, DAX enabled EXT4 fs

2017-09-11 Thread Ross Zwisler
On Sat, Sep 09, 2017 at 05:10:26PM +, Soccer Liu wrote: > Hi: >   I was surprised to see a few write operations called into > ext4_dax_huge_fault with FAULT_FLAG_WRITE set on vmf->flags > Are those writes expected at all? > static int ext4_dax_huge_fault(struct vm_fault *vmf, > enum

Re: [PATCH] xfs: add regression test for DAX mount option usage

2017-09-11 Thread Ross Zwisler
On Fri, Sep 08, 2017 at 03:21:53PM -0600, Ross Zwisler wrote: > This adds a regression test for the following kernel patch: > > xfs: always use DAX if mount option is used > > This test will also pass with kernel v4.14-rc1 and beyond because the XFS > DAX I/O mount option

[PATCH] xfs: add regression test for DAX mount option usage

2017-09-08 Thread Ross Zwisler
ctually do anything. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> Suggested-by: Christoph Hellwig <h...@infradead.org> --- tests/xfs/431 | 81 +++ tests/xfs/431.out | 3 +++ tests/xfs/group | 1 + 3 files changed, 85

Re: [PATCH 1/2] xfs: always use DAX if mount option is used

2017-09-08 Thread Ross Zwisler
On Fri, Sep 08, 2017 at 12:20:28AM -0700, Christoph Hellwig wrote: > On Thu, Sep 07, 2017 at 03:08:31PM -0600, Ross Zwisler wrote: > > Before support for the per-inode DAX flag was disabled the XFS the code had > > an issue where the user couldn't reliably tell whether or no

Re: [PATCH 0/9] add ext4 per-inode DAX flag

2017-09-07 Thread Ross Zwisler
On Fri, Sep 08, 2017 at 08:12:01AM +1000, Dave Chinner wrote: > On Thu, Sep 07, 2017 at 03:51:48PM -0600, Ross Zwisler wrote: > > On Thu, Sep 07, 2017 at 03:26:10PM -0600, Andreas Dilger wrote: > > > However, I wonder if this could > > > be prevented at runtime, and only

Re: [PATCH 0/9] add ext4 per-inode DAX flag

2017-09-07 Thread Ross Zwisler
On Thu, Sep 07, 2017 at 03:26:10PM -0600, Andreas Dilger wrote: > On Sep 7, 2017, at 3:13 PM, Ross Zwisler <ross.zwis...@linux.intel.com> wrote: > > > > On Thu, Sep 07, 2017 at 01:54:45PM -0700, Dan Williams wrote: > >> On Wed, Sep 6, 2017 at 10:07 AM

Re: [PATCH 0/9] add ext4 per-inode DAX flag

2017-09-07 Thread Ross Zwisler
On Thu, Sep 07, 2017 at 01:54:45PM -0700, Dan Williams wrote: > On Wed, Sep 6, 2017 at 10:07 AM, Ross Zwisler > <ross.zwis...@linux.intel.com> wrote: > > On Tue, Sep 05, 2017 at 09:12:35PM -0500, Eric Sandeen wrote: > >> On 9/5/17 5:35 PM, Ross Zwisler wrote:

[PATCH 0/2] xfs: some DAX fixes

2017-09-07 Thread Ross Zwisler
) and a series of ext4 bug fixes. Ross Zwisler (2): xfs: always use DAX if mount option is used xfs: validate bdev support for DAX inode flag fs/xfs/xfs_ioctl.c | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- 2.9.5 ___ Linux

[PATCH 1/2] xfs: always use DAX if mount option is used

2017-09-07 Thread Ross Zwisler
this issue to have been fixed. I also do think that we want to fix this in stable kernels. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> CC: sta...@vger.kernel.org --- fs/xfs/xfs_ioctl.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xf

Re: [PATCH 7/9] ext4: prevent data corruption with inline data + DAX

2017-09-06 Thread Ross Zwisler
On Wed, Sep 06, 2017 at 02:55:31PM -0600, Andreas Dilger wrote: > On Sep 5, 2017, at 4:35 PM, Ross Zwisler <ross.zwis...@linux.intel.com> wrote: > > > > If an inode has inline data it is currently prevented from using DAX by a > > check in ext4_should_use_dax(). When

Re: [PATCH 6/9] ext4: safely transition S_DAX on journaling changes

2017-09-06 Thread Ross Zwisler
On Wed, Sep 06, 2017 at 11:47:00AM +0200, Jan Kara wrote: > On Tue 05-09-17 16:35:38, Ross Zwisler wrote: > > The IOCTL path which switches the journaling mode for an inode is currently > > unsafe because it doesn't properly do a writeback and invalidation on the > > inode.

Re: [PATCH 0/9] add ext4 per-inode DAX flag

2017-09-06 Thread Ross Zwisler
On Tue, Sep 05, 2017 at 09:12:35PM -0500, Eric Sandeen wrote: > On 9/5/17 5:35 PM, Ross Zwisler wrote: > > The original intent of this series was to add a per-inode DAX flag to ext4 > > so that it would be consistent with XFS. In my travels I found and fixed > > several r

[PATCH 4/9] ext4: add ext4_should_use_dax()

2017-09-05 Thread Ross Zwisler
This helper, in the spirit of ext4_should_dioread_nolock() et al., replaces the complex conditional in ext4_set_inode_flags() and will soon be called in multiple places. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/ext4/ext4_jbd2.h | 15 +++ fs/ext4/i

[PATCH 8/9] ext4: add sanity check for encryption + DAX

2017-09-05 Thread Ross Zwisler
a WARN_ON_ONCE() sanity check to make sure that we are notified if we ever encounter a case where we are encrypting an inode that already has data, in which case we need to add code to safely transition S_DAX. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> CC: sta...@vger.kernel.org -

[PATCH 6/9] ext4: safely transition S_DAX on journaling changes

2017-09-05 Thread Ross Zwisler
of an active journal handle. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> CC: sta...@vger.kernel.org --- Please let me know if my "context of an active journal handle" terminology makes sense, or if some other phrasing is more common. I'll work on an xfstest which shows t

[PATCH 5/9] ext4: ext4_change_inode_journal_flag error handling

2017-09-05 Thread Ross Zwisler
-by: Ross Zwisler <ross.zwis...@linux.intel.com> CC: sta...@vger.kernel.org --- fs/ext4/inode.c | 24 +--- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 864fb94..d218991 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/i

[PATCH 9/9] ext4: add per-inode DAX flag

2017-09-05 Thread Ross Zwisler
DAX inode flag will fail with -EINVAL for filesystems that can contain inline data. 3) If you try and use DAX on an encrypted inode, the inode will accept the DAX inode flag but DAX will never be used. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- The behavior of th

[PATCH 7/9] ext4: prevent data corruption with inline data + DAX

2017-09-05 Thread Ross Zwisler
writeback and invalidate, unlock and restart the journal handle. These both seem too complex, and I don't know if we have a valid use case where we need to combine a filesystem with inline data and DAX, so just prevent them from being used together. Signed-off-by: Ross Zwisler <ross.zwis...@lin

[PATCH 3/9] xfs: validate bdev support for DAX inode flag

2017-09-05 Thread Ross Zwisler
fill_super(). Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> CC: sta...@vger.kernel.org --- fs/xfs/xfs_ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 8155ddc..dac195d 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs

[PATCH 1/9] ext4: remove duplicate extended attributes defs

2017-09-05 Thread Ross Zwisler
get merged for project quota... */ Those uapi changes were merged by this commit: commit 334e580a6f97 ("fs: XFS_IOC_FS[SG]SETXATTR to FS_IOC_FS[SG]ETXATTR promotion") so all the definitions needed by ext4 are available in include/uapi/linux/fs.h. Remove the duplicates from ext4.h. Signed-

[PATCH 0/9] add ext4 per-inode DAX flag

2017-09-05 Thread Ross Zwisler
data and encryption). My goal with this series was to make all these interactions as consistent as possilble, and of course to make them safe. If anyone has ideas for improvements, I'm very open. Ross Zwisler (9): ext4: remove duplicate extended attributes defs xfs: always use DAX if mount

[PATCH 2/9] xfs: always use DAX if mount option is used

2017-09-05 Thread Ross Zwisler
dax, making the usage reliable and detectable. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> CC: sta...@vger.kernel.org --- fs/xfs/xfs_ioctl.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 9c0c7a9..8155ddc 1006

[fstests v2] generic: add test for executables on read-only DAX mounts

2017-08-30 Thread Ross Zwisler
not appear to be present in ext2 or XFS, as they both pass the test. I've also confirmed outside of the test that they are both indeed able to execute binaries on read-only DAX mounts. Thanks to Randy Dodgen for the bug report and reproduction steps. Signed-off-by: Ross Zwisler <ross.zwis...@linux.

Re: [fstests PATCH] generic: add test for executables on read-only DAX mounts

2017-08-30 Thread Ross Zwisler
On Wed, Aug 30, 2017 at 07:51:03AM -0700, Christoph Hellwig wrote: > > The above patch fixes an issue with ext4 where executables cannot be run on > > read-only filesystems mounted with the DAX option. > > > > This issue does not appear to be present in ext2 or XFS, as they both pass > > the

Re: [fstests PATCH] generic: add test for executables on read-only DAX mounts

2017-08-30 Thread Ross Zwisler
On Wed, Aug 30, 2017 at 06:59:30PM +0800, Eryu Guan wrote: > On Tue, Aug 29, 2017 at 04:37:15PM -0600, Ross Zwisler wrote: > > This adds a regression test for the following kernel patch: > > > > commit 42d4a99b09cb ("ext4: fix fault handling when mounted with -o dax,ro&

[fstests PATCH] generic: add test for executables on read-only DAX mounts

2017-08-29 Thread Ross Zwisler
not appear to be present in ext2 or XFS, as they both pass the test. I've also confirmed outside of the test that they are both indeed able to execute binaries on read-only DAX mounts. Thanks to Randy Dodgen for the bug report and reproduction steps. Signed-off-by: Ross Zwisler <ross.zwis...@linux.

Re: [PATCH v3] Fix ext4 fault handling when mounted with -o dax,ro

2017-08-29 Thread Ross Zwisler
On Tue, Aug 29, 2017 at 02:20:02PM -0700, Christoph Hellwig wrote: > Randy, any chance yto at least share a test script so that others > can wire it up for the test suite? I made a reproducer for my testing. I'll make an xfstest if Randy isn't able to.

Re: [PATCH 2/3] xfs: consolidate the various page fault handlers

2017-08-28 Thread Ross Zwisler
On Mon, Aug 28, 2017 at 07:52:57PM +0200, Christoph Hellwig wrote: > On Mon, Aug 28, 2017 at 11:50:14AM -0600, Ross Zwisler wrote: > > Yep - I'm doing that in include/trace/events/fs_dax.h if you want to just > > copy > > & paste. > > Oh, nice. But maybe we need

Re: [PATCH 3/3] xfs: support for synchronous DAX faults

2017-08-24 Thread Ross Zwisler
this case and __xfs_filemap_fault() Otherwise this looks good to me: Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 1/3] iomap: return VM_FAULT_* codes from iomap_page_mkwrite

2017-08-24 Thread Ross Zwisler
returning VM_FAULT_* codes? Is this just cleanup so you can hide the block_page_mkwrite_return() call inside of iomap_page_mkwrite()? I think it's the former, so the logic in __xfs_filemap_fault() is simpler? Anyway, the code is correct, so you can add: Reviewed-by: Ross Zwisler <ross.zwis...@lin

Re: [PATCH v3] ndctl: daxctl: Adding io option for daxctl

2017-08-24 Thread Ross Zwisler
On Wed, Aug 23, 2017 at 11:20:40AM -0700, Dave Jiang wrote: > The daxctl io option allows I/Os to be performed between file descriptor to > and from device dax files. It also provides a way to zero a device dax > device. > > i.e. daxctl io --input=/home/myfile --output=/dev/dax1.0 > >

Re: [PATCH v3] Fix ext4 fault handling when mounted with -o dax,ro

2017-08-24 Thread Ross Zwisler
lready (e.g. grabbing journal > handles). > > Signed-off-by: Randy Dodgen <dod...@google.com> Cool, looks good from the DAX point of view. You can add: Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH v2] ndctl: daxctl: Adding io option for daxctl

2017-08-23 Thread Ross Zwisler
On Tue, Aug 22, 2017 at 05:06:15PM -0700, Dave Jiang wrote: > The daxctl io option allows I/Os to be performed between file descriptor to > and from device dax files. It also provides a way to zero a device dax > device. > > i.e. daxctl io --input=/home/myfile --output=/dev/dax1.0 > >

Re: [PATCH v2] Fix ext4 fault handling when mounted with -o dax,ro

2017-08-23 Thread Ross Zwisler
On Tue, Aug 22, 2017 at 08:37:04PM -0700, rdod...@gmail.com wrote: > From: Randy Dodgen > > If an ext4 filesystem is mounted with both the DAX and read-only > options, executables on that filesystem will fail to start (claiming > 'Segmentation fault') due to the fault handler

Re: [PATCH v2 1/2] dax: fix deadlock due to misaligned PMD faults

2017-08-23 Thread Ross Zwisler
On Wed, Aug 23, 2017 at 11:57:33AM +0200, Jan Kara wrote: > On Tue 22-08-17 16:24:35, Ross Zwisler wrote: > > In DAX there are two separate places where the 2MiB range of a PMD is > > defined. > > > > The first is in the page tables, where a PMD mapping inserted for a g

[PATCH v2 2/2] dax: use PG_PMD_COLOUR instead of open coding

2017-08-22 Thread Ross Zwisler
Use ~PG_PMD_COLOUR in dax_entry_waitqueue() instead of open coding an equivalent page offset mask. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/dax.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 865d42c..0

[PATCH v2 1/2] dax: fix deadlock due to misaligned PMD faults

2017-08-22 Thread Ross Zwisler
s faults that would have mapped to storage as well as faults to holes. I left the COLOUR check in dax_pmd_insert_mapping() in place in case we ever hit the insanity condition where the alignment of the pfn we get from the driver doesn't match the alignment of the userspace address. Signed-off-by:

[PATCH 1/2] dax: fallback on misaligned PMD faults

2017-08-22 Thread Ross Zwisler
dix tree entries that could possibly be dirty) correctly detect this misalignment and would fall back to 4k entries, I don't *think* that this situation can result in data corruption, but the fix is simple and unlikely to have a negative impact so I think it's worth applying to stable. Si

[PATCH 2/2] dax: use PG_PMD_COLOUR instead of open coding

2017-08-22 Thread Ross Zwisler
Use ~PG_PMD_COLOUR in dax_entry_waitqueue() instead of open coding an equivalent page offset mask. Signed-off-by: Ross Zwisler <ross.zwis...@linux.intel.com> --- fs/dax.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 865d42c..0

Re: [PATCH 10/13] mm: Wire up MAP_SYNC

2017-08-21 Thread Ross Zwisler
On Thu, Aug 17, 2017 at 06:08:12PM +0200, Jan Kara wrote: > Pretty crude for now... > > Signed-off-by: Jan Kara One other thing that should probably be wired up before this is all said and done is the VmFlag string in /proc//smaps. Right now when we set this flag it ends up as

Re: [PATCH 10/13] mm: Wire up MAP_SYNC

2017-08-21 Thread Ross Zwisler
On Thu, Aug 17, 2017 at 06:08:12PM +0200, Jan Kara wrote: > Pretty crude for now... > > Signed-off-by: Jan Kara > --- > fs/ext4/file.c | 2 ++ > include/linux/mm.h | 1 + > include/linux/mman.h| 3 ++- > include/uapi/asm-generic/mman.h | 1

Re: [PATCH 11/13] dax, iomap: Add support for synchronous faults

2017-08-21 Thread Ross Zwisler
On Thu, Aug 17, 2017 at 06:08:13PM +0200, Jan Kara wrote: > Add a flag to iomap interface informing the caller that inode needs > fdstasync(2) for returned extent to become persistent and use it in DAX > fault code so that we map such extents only read only. We propagate the > information that the

Re: [RFC PATCH 0/7] dax, ext4: Synchronous page faults

2017-08-21 Thread Ross Zwisler
On Mon, Aug 14, 2017 at 09:03:59AM -0700, Dan Williams wrote: > On Mon, Aug 14, 2017 at 7:04 AM, Boaz Harrosh wrote: > > > > Thank you Jan, I'm patiently waiting for this MAP_SYNC flag since I asked > > for > > it in 2014. I'm so glad its time is finally do. > > > > Thank you

Re: [PATCH 13/13] ext4: Support for synchronous DAX faults

2017-08-21 Thread Ross Zwisler
On Thu, Aug 17, 2017 at 06:08:15PM +0200, Jan Kara wrote: > We return IOMAP_F_NEEDDSYNC flag from ext4_iomap_begin() for a > synchronous write fault when inode has some uncommitted metadata > changes. In the fault handler ext4_dax_fault() we then detect this case, > call vfs_fsync_range() to make

Re: [PATCH 12/13] dax: Implement dax_insert_pfn_mkwrite()

2017-08-21 Thread Ross Zwisler
a <j...@suse.cz> Yep, this looks great. Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 11/13] dax, iomap: Add support for synchronous faults

2017-08-21 Thread Ross Zwisler
to check for 'write' here. The fact that IOMAP_F_NEEDDSYNC is set tells us that we are doing a write. if ((flags & IOMAP_WRITE) && !jbd2_transaction_committed(EXT4_SB(inode->i_sb)->s_journal, EXT4_I(inode)->i_datasync_tid)) i

Re: [PATCH 09/13] dax: Allow dax_iomap_fault() to return pfn

2017-08-21 Thread Ross Zwisler
a <j...@suse.cz> Yep, this seems like a nice, straightforward way of doing things. I like this better than the vmf->orig_pte solution from the previous RFC. Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> ___ Linux-nvdimm mailing

Re: [PATCH 08/13] dax: Fix comment describing dax_iomap_fault()

2017-08-18 Thread Ross Zwisler
On Thu, Aug 17, 2017 at 06:08:10PM +0200, Jan Kara wrote: > Add missing argument description. > > Signed-off-by: Jan Kara <j...@suse.cz> Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> ___ Linux-nvdimm mailing list Linu

Re: [PATCH 07/13] dax: Inline dax_pmd_insert_mapping() into the callsite

2017-08-18 Thread Ross Zwisler
ned-off-by: Jan Kara <j...@suse.cz> Sure, looks good. Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 06/13] dax: Inline dax_insert_mapping() into the callsite

2017-08-18 Thread Ross Zwisler
by: Jan Kara <j...@suse.cz> Looks good. Reviewed-by: Ross Zwisler <ross.zwis...@linux.intel.com> ___ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm

Re: [PATCH 05/13] dax: Create local variable for vmf->flags & FAULT_FLAG_WRITE test

2017-08-18 Thread Ross Zwisler
On Thu, Aug 17, 2017 at 06:08:07PM +0200, Jan Kara wrote: > There are already two users and more are coming. > > Signed-off-by: Jan Kara <j...@suse.cz> Sure, and this is much nicer to read. Reviewed-by: Ross Zwisler <ross.zwis.

<    1   2   3   4   5   6   7   8   >