aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/ceph/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 828badfe62a8..9ec4ebe5ccaf 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -975,7 +975,8 @@ int ceph_fill_inode(struct inode *inode, struct page *locked_page,
__ceph_update_quota(ci, iinfo->max_bytes, iinfo->max_files);
#ifdef CONFIG_FS_ENCRYPTION
- if (iinfo->fscrypt_auth_len && (inode->i_state & I_NEW)) {
+ if (iinfo->fscrypt_auth_len &&
+ ((inode->i_state & I_NEW) || (ci->fscrypt_auth_len == 0))) {
kfree(ci->fscrypt_auth);
ci->fscrypt_auth_len = iinfo->fscrypt_auth_len;
ci->fscrypt_auth = iinfo->fscrypt_auth;