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
  
  #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
@@@ -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
@@@ -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