Merge tag 'fscrypt_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 9 Jul 2017 16:03:31 +0000 (09:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 9 Jul 2017 16:03:31 +0000 (09:03 -0700)
Pull fscrypt updates from Ted Ts'o:
 "Add support for 128-bit AES and some cleanups to fscrypt"

* tag 'fscrypt_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt:
  fscrypt: make ->dummy_context() return bool
  fscrypt: add support for AES-128-CBC
  fscrypt: inline fscrypt_free_filename()

1  2 
fs/ext4/super.c
include/uapi/linux/fs.h

diff --combined fs/ext4/super.c
index 9006cb5857b802e301fa5923feafb8a3e87db884,f01d2c5bc3fada87638ab699995b3be8f8b485c2..18f68f09d3935bb3f6e14dd7088f4dbade390f3a
@@@ -848,9 -848,14 +848,9 @@@ static inline void ext4_quota_off_umoun
  {
        int type;
  
 -      if (ext4_has_feature_quota(sb)) {
 -              dquot_disable(sb, -1,
 -                            DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
 -      } else {
 -              /* Use our quota_off function to clear inode flags etc. */
 -              for (type = 0; type < EXT4_MAXQUOTAS; type++)
 -                      ext4_quota_off(sb, type);
 -      }
 +      /* Use our quota_off function to clear inode flags etc. */
 +      for (type = 0; type < EXT4_MAXQUOTAS; type++)
 +              ext4_quota_off(sb, type);
  }
  #else
  static inline void ext4_quota_off_umount(struct super_block *sb)
@@@ -1174,9 -1179,6 +1174,9 @@@ static int ext4_set_context(struct inod
                return res;
        }
  
 +      res = dquot_initialize(inode);
 +      if (res)
 +              return res;
  retry:
        handle = ext4_journal_start(inode, EXT4_HT_MISC,
                        ext4_jbd2_credits_xattr(inode));
        return res;
  }
  
- static int ext4_dummy_context(struct inode *inode)
+ static bool ext4_dummy_context(struct inode *inode)
  {
        return DUMMY_ENCRYPTION_ENABLED(EXT4_SB(inode->i_sb));
  }
@@@ -3950,7 -3952,7 +3950,7 @@@ static int ext4_fill_super(struct super
                sb->s_qcop = &ext4_qctl_operations;
        sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ;
  #endif
 -      memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid));
 +      memcpy(&sb->s_uuid, es->s_uuid, sizeof(es->s_uuid));
  
        INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */
        mutex_init(&sbi->s_orphan_lock);
@@@ -5483,7 -5485,7 +5483,7 @@@ static int ext4_quota_off(struct super_
                goto out;
  
        err = dquot_quota_off(sb, type);
 -      if (err)
 +      if (err || ext4_has_feature_quota(sb))
                goto out_put;
  
        inode_lock(inode);
  out_unlock:
        inode_unlock(inode);
  out_put:
 +      lockdep_set_quota_inode(inode, I_DATA_SEM_NORMAL);
        iput(inode);
        return err;
  out:
diff --combined include/uapi/linux/fs.h
index 27d8c36c04af89a29ea42c6b84f3602af3dd27ed,a2a3ffb06038f50f70bc42af1be789a64cc4a8d1..b7495d05e8de8db54f97fef83fbca0402329f11a
@@@ -272,6 -272,8 +272,8 @@@ struct fsxattr 
  #define FS_ENCRYPTION_MODE_AES_256_GCM                2
  #define FS_ENCRYPTION_MODE_AES_256_CBC                3
  #define FS_ENCRYPTION_MODE_AES_256_CTS                4
+ #define FS_ENCRYPTION_MODE_AES_128_CBC                5
+ #define FS_ENCRYPTION_MODE_AES_128_CTS                6
  
  struct fscrypt_policy {
        __u8 version;
@@@ -360,9 -362,5 +362,9 @@@ struct fscrypt_key 
  #define RWF_HIPRI                     0x00000001 /* high priority request, poll if possible */
  #define RWF_DSYNC                     0x00000002 /* per-IO O_DSYNC */
  #define RWF_SYNC                      0x00000004 /* per-IO O_SYNC */
 +#define RWF_NOWAIT                    0x00000008 /* per-IO, return -EAGAIN if operation would block */
 +
 +#define RWF_SUPPORTED                 (RWF_HIPRI | RWF_DSYNC | RWF_SYNC |\
 +                                       RWF_NOWAIT)
  
  #endif /* _UAPI_LINUX_FS_H */