ext4: fix __ext4_new_inode() journal credits calculation
authorTahsin Erdogan <tahsin@google.com>
Thu, 6 Jul 2017 04:01:59 +0000 (00:01 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 6 Jul 2017 04:01:59 +0000 (00:01 -0400)
commitaf65207c76ce8e6263a3b097ea35365dde9913d0
tree222298b2f179736a158d83341511cd9c7a81eca0
parentad47f9533994d7e3d2dbfa4fffe85934a1627edc
ext4: fix __ext4_new_inode() journal credits calculation

ea_inode feature allows creating extended attributes that are up to
64k in size. Update __ext4_new_inode() to pick increased credit limits.

To avoid overallocating too many journal credits, update
__ext4_xattr_set_credits() to make a distinction between xattr create
vs update. This helps __ext4_new_inode() because all attributes are
known to be new, so we can save credits that are normally needed to
delete old values.

Also, have fscrypt specify its maximum context size so that we don't
end up allocating credits for 64k size.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/crypto/policy.c
fs/ext4/acl.c
fs/ext4/ialloc.c
fs/ext4/super.c
fs/ext4/xattr.c
fs/ext4/xattr.h
include/linux/fscrypt_common.h