Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Dec 2016 17:17:42 +0000 (09:17 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Dec 2016 17:17:42 +0000 (09:17 -0800)
Pull ext4 updates from Ted Ts'o:
 "This merge request includes the dax-4.0-iomap-pmd branch which is
  needed for both ext4 and xfs dax changes to use iomap for DAX. It also
  includes the fscrypt branch which is needed for ubifs encryption work
  as well as ext4 encryption and fscrypt cleanups.

  Lots of cleanups and bug fixes, especially making sure ext4 is robust
  against maliciously corrupted file systems --- especially maliciously
  corrupted xattr blocks and a maliciously corrupted superblock. Also
  fix ext4 support for 64k block sizes so it works well on ppcle. Fixed
  mbcache so we don't miss some common xattr blocks that can be merged"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (86 commits)
  dax: Fix sleep in atomic contex in grab_mapping_entry()
  fscrypt: Rename FS_WRITE_PATH_FL to FS_CTX_HAS_BOUNCE_BUFFER_FL
  fscrypt: Delay bounce page pool allocation until needed
  fscrypt: Cleanup page locking requirements for fscrypt_{decrypt,encrypt}_page()
  fscrypt: Cleanup fscrypt_{decrypt,encrypt}_page()
  fscrypt: Never allocate fscrypt_ctx on in-place encryption
  fscrypt: Use correct index in decrypt path.
  fscrypt: move the policy flags and encryption mode definitions to uapi header
  fscrypt: move non-public structures and constants to fscrypt_private.h
  fscrypt: unexport fscrypt_initialize()
  fscrypt: rename get_crypt_info() to fscrypt_get_crypt_info()
  fscrypto: move ioctl processing more fully into common code
  fscrypto: remove unneeded Kconfig dependencies
  MAINTAINERS: fscrypto: recommend linux-fsdevel for fscrypto patches
  ext4: do not perform data journaling when data is encrypted
  ext4: return -ENOMEM instead of success
  ext4: reject inodes with negative size
  ext4: remove another test in ext4_alloc_file_blocks()
  Documentation: fix description of ext4's block_validity mount option
  ext4: fix checks for data=ordered and journal_async_commit options
  ...

1  2 
MAINTAINERS
fs/dax.c
fs/ext4/page-io.c
fs/ext4/super.c
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/xfs/xfs_aops.c
include/uapi/linux/fs.h
mm/filemap.c

diff --cc MAINTAINERS
Simple merge
diff --cc fs/dax.c
index 6916ed37d4631846a7478cfa3e3dd14c8808d373,5bfd27b4a69c684346a7cd9d755178b7cbdf6228..5ae8e11ad78677ef3103fc569d0959742a380370
+++ b/fs/dax.c
@@@ -642,8 -579,15 +579,16 @@@ static void *dax_insert_mapping_entry(s
                        goto unlock;
                }
                mapping->nrexceptional++;
-       } else {
+       } else if (dax_is_zero_entry(entry) || dax_is_empty_entry(entry)) {
+               /*
+                * Only swap our new entry into the radix tree if the current
+                * entry is a zero page or an empty entry.  If a normal PTE or
+                * PMD entry is already in the tree, we leave it alone.  This
+                * means that if we are trying to insert a PTE and the
+                * existing entry is a PMD, we will just leave the PMD in the
+                * tree and dirty it if necessary.
+                */
 +              struct radix_tree_node *node;
                void **slot;
                void *ret;
  
Simple merge
diff --cc fs/ext4/super.c
index caa4147cda47b599e84a301f0acc13aa006f519c,79af71d4fccd8870f866706777d4d66034df1795..dfc8309d7755d55a6e7e73814ede13f204d60cae
@@@ -4566,10 -4613,10 +4613,10 @@@ static int ext4_commit_super(struct sup
                set_buffer_uptodate(sbh);
        }
        mark_buffer_dirty(sbh);
-       unlock_buffer(sbh);
        if (sync) {
+               unlock_buffer(sbh);
                error = __sync_dirty_buffer(sbh,
 -                      test_opt(sb, BARRIER) ? WRITE_FUA : WRITE_SYNC);
 +                      test_opt(sb, BARRIER) ? REQ_FUA : REQ_SYNC);
                if (error)
                        return error;
  
diff --cc fs/f2fs/data.c
Simple merge
diff --cc fs/f2fs/f2fs.h
Simple merge
diff --cc fs/f2fs/file.c
Simple merge
Simple merge
Simple merge
diff --cc mm/filemap.c
index 5b4dd03130da33b91cca705e6d202fffed177b55,db26ebc6c62f0c9a966f5ab8033f6442527f0eb5..69568388c699493ac694a960ca7c24b90b13e080
@@@ -135,10 -135,14 +135,9 @@@ static int page_cache_tree_insert(struc
                } else {
                        /* DAX can replace empty locked entry with a hole */
                        WARN_ON_ONCE(p !=
-                               (void *)(RADIX_TREE_EXCEPTIONAL_ENTRY |
-                                        RADIX_DAX_ENTRY_LOCK));
+                               dax_radix_locked_entry(0, RADIX_DAX_EMPTY));
 -                      /* DAX accounts exceptional entries as normal pages */
 -                      if (node)
 -                              workingset_node_pages_dec(node);
                        /* Wakeup waiters for exceptional entry lock */
-                       dax_wake_mapping_entry_waiter(mapping, page->index,
+                       dax_wake_mapping_entry_waiter(mapping, page->index, p,
                                                      false);
                }
        }