diff options
author | Ross Zwisler <ross.zwisler@linux.intel.com> | 2016-01-22 18:10:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-22 20:02:18 -0500 |
commit | 5eb88dca9ce4546bdfca6e5defcd50fbe8ea8411 (patch) | |
tree | 938b34318b8d0fa5852bb0ebf7f7a8b1e15d5558 /fs | |
parent | d5be7a03b002a0faec136687ec03dbee6c579930 (diff) |
xfs: call dax_pfn_mkwrite() for DAX fsync/msync
To properly support the new DAX fsync/msync infrastructure filesystems
need to call dax_pfn_mkwrite() so that DAX can track when user pages are
dirtied.
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jan Kara <jack@suse.com>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: Matthew Wilcox <willy@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_file.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index ebe9b8290a70..55e16e2402a7 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -1610,9 +1610,8 @@ xfs_filemap_pmd_fault( | |||
1610 | /* | 1610 | /* |
1611 | * pfn_mkwrite was originally inteneded to ensure we capture time stamp | 1611 | * pfn_mkwrite was originally inteneded to ensure we capture time stamp |
1612 | * updates on write faults. In reality, it's need to serialise against | 1612 | * updates on write faults. In reality, it's need to serialise against |
1613 | * truncate similar to page_mkwrite. Hence we open-code dax_pfn_mkwrite() | 1613 | * truncate similar to page_mkwrite. Hence we cycle the XFS_MMAPLOCK_SHARED |
1614 | * here and cycle the XFS_MMAPLOCK_SHARED to ensure we serialise the fault | 1614 | * to ensure we serialise the fault barrier in place. |
1615 | * barrier in place. | ||
1616 | */ | 1615 | */ |
1617 | static int | 1616 | static int |
1618 | xfs_filemap_pfn_mkwrite( | 1617 | xfs_filemap_pfn_mkwrite( |
@@ -1635,6 +1634,8 @@ xfs_filemap_pfn_mkwrite( | |||
1635 | size = (i_size_read(inode) + PAGE_SIZE - 1) >> PAGE_SHIFT; | 1634 | size = (i_size_read(inode) + PAGE_SIZE - 1) >> PAGE_SHIFT; |
1636 | if (vmf->pgoff >= size) | 1635 | if (vmf->pgoff >= size) |
1637 | ret = VM_FAULT_SIGBUS; | 1636 | ret = VM_FAULT_SIGBUS; |
1637 | else if (IS_DAX(inode)) | ||
1638 | ret = dax_pfn_mkwrite(vma, vmf); | ||
1638 | xfs_iunlock(ip, XFS_MMAPLOCK_SHARED); | 1639 | xfs_iunlock(ip, XFS_MMAPLOCK_SHARED); |
1639 | sb_end_pagefault(inode->i_sb); | 1640 | sb_end_pagefault(inode->i_sb); |
1640 | return ret; | 1641 | return ret; |