Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 19 Apr 2015 21:26:31 +0000 (14:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 19 Apr 2015 21:26:31 +0000 (14:26 -0700)
Pull ext4 updates from Ted Ts'o:
 "A few bug fixes and add support for file-system level encryption in
  ext4"

* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (31 commits)
  ext4 crypto: enable encryption feature flag
  ext4 crypto: add symlink encryption
  ext4 crypto: enable filename encryption
  ext4 crypto: filename encryption modifications
  ext4 crypto: partial update to namei.c for fname crypto
  ext4 crypto: insert encrypted filenames into a leaf directory block
  ext4 crypto: teach ext4_htree_store_dirent() to store decrypted filenames
  ext4 crypto: filename encryption facilities
  ext4 crypto: implement the ext4 decryption read path
  ext4 crypto: implement the ext4 encryption write path
  ext4 crypto: inherit encryption policies on inode and directory create
  ext4 crypto: enforce context consistency
  ext4 crypto: add encryption key management facilities
  ext4 crypto: add ext4 encryption facilities
  ext4 crypto: add encryption policy and password salt support
  ext4 crypto: add encryption xattr support
  ext4 crypto: export ext4_empty_dir()
  ext4 crypto: add ext4 encryption Kconfig
  ext4 crypto: reserve codepoints used by the ext4 encryption feature
  ext4 crypto: add ext4_mpage_readpages()
  ...

1  2 
fs/ext4/ext4.h
fs/ext4/file.c
fs/ext4/inode.c
fs/ext4/namei.c
fs/ext4/page-io.c
fs/ext4/super.c

diff --cc fs/ext4/ext4.h
Simple merge
diff --cc fs/ext4/file.c
index e576d682b35323f324c9cdf698aac6a9f725488a,b132a3c6b6fb05c92fa2301a3e88e3c0d03ec383..0613c256c3441a208f51291dbc2691489cf4dd9c
  
  #include <linux/time.h>
  #include <linux/fs.h>
- #include <linux/jbd2.h>
  #include <linux/mount.h>
  #include <linux/path.h>
 -#include <linux/aio.h>
  #include <linux/quotaops.h>
  #include <linux/pagevec.h>
 +#include <linux/uio.h>
  #include "ext4.h"
  #include "ext4_jbd2.h"
  #include "xattr.h"
diff --cc fs/ext4/inode.c
index b49cf6e5995309a6c7d813512ad07731c3885853,f6b35d8a4a5b7aa9c2fed239fc943118bdeec727..366476e71e103aad678334577b38d64631f930ed
@@@ -36,7 -35,7 +35,6 @@@
  #include <linux/kernel.h>
  #include <linux/printk.h>
  #include <linux/slab.h>
- #include <linux/ratelimit.h>
 -#include <linux/aio.h>
  #include <linux/bitops.h>
  
  #include "ext4_jbd2.h"
@@@ -3033,11 -3134,14 +3133,14 @@@ static ssize_t ext4_ext_direct_IO(struc
                get_block_func = ext4_get_block_write;
                dio_flags = DIO_LOCKING;
        }
+ #ifdef CONFIG_EXT4_FS_ENCRYPTION
+       BUG_ON(ext4_encrypted_inode(inode) && S_ISREG(inode->i_mode));
+ #endif
        if (IS_DAX(inode))
 -              ret = dax_do_io(rw, iocb, inode, iter, offset, get_block_func,
 +              ret = dax_do_io(iocb, inode, iter, offset, get_block_func,
                                ext4_end_io_dio, dio_flags);
        else
 -              ret = __blockdev_direct_IO(rw, iocb, inode,
 +              ret = __blockdev_direct_IO(iocb, inode,
                                           inode->i_sb->s_bdev, iter, offset,
                                           get_block_func,
                                           ext4_end_io_dio, NULL, dio_flags);
diff --cc fs/ext4/namei.c
index 2291923dae4e6c4cf351dcdb7d88d59f9314590d,4f87127f781f4e5eb062eb9459901e5f46a4f08a..ef22cd951c0c31cb58b10f368753f8c08f5af98a
@@@ -2235,9 -2575,25 +2575,22 @@@ retry
        err = PTR_ERR(inode);
        if (!IS_ERR(inode)) {
                inode->i_op = &ext4_file_inode_operations;
 -              if (test_opt(inode->i_sb, DAX))
 -                      inode->i_fop = &ext4_dax_file_operations;
 -              else
 -                      inode->i_fop = &ext4_file_operations;
 +              inode->i_fop = &ext4_file_operations;
                ext4_set_aops(inode);
-               err = ext4_add_nondir(handle, dentry, inode);
+               err = 0;
+ #ifdef CONFIG_EXT4_FS_ENCRYPTION
+               if (!err && (ext4_encrypted_inode(dir) ||
+                            DUMMY_ENCRYPTION_ENABLED(EXT4_SB(dir->i_sb)))) {
+                       err = ext4_inherit_context(dir, inode);
+                       if (err) {
+                               clear_nlink(inode);
+                               unlock_new_inode(inode);
+                               iput(inode);
+                       }
+               }
+ #endif
+               if (!err)
+                       err = ext4_add_nondir(handle, dentry, inode);
                if (!err && IS_DIRSYNC(dir))
                        ext4_handle_sync(handle);
        }
Simple merge
diff --cc fs/ext4/super.c
Simple merge