summaryrefslogtreecommitdiff
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2020-09-08 09:47:40 -0400
committerIlya Dryomov <idryomov@gmail.com>2023-08-22 09:01:48 +0200
commit6b5717bd30ab7f35792d20b71211055bdb43e6de (patch)
treec6463f5f7545dbe23fcd03b0ab497d5d5e27308b /fs/ceph/inode.c
parent2d332d5bc424404911540006a8bb450fbb96b178 (diff)
ceph: implement -o test_dummy_encryption mount option
Add support for the test_dummy_encryption mount option. This allows us to test the encrypted codepaths in ceph without having to manually set keys, etc. [ lhenriques: fix potential fsc->fsc_dummy_enc_policy memory leak in ceph_real_mount() ] Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Xiubo Li <xiubli@redhat.com> Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de> Reviewed-by: Milind Changire <mchangir@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index a3aa7870a6a2..50ff641865e0 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -83,12 +83,17 @@ struct inode *ceph_new_inode(struct inode *dir, struct dentry *dentry,
goto out_err;
}
+ inode->i_state = 0;
+ inode->i_mode = *mode;
+
err = ceph_security_init_secctx(dentry, *mode, as_ctx);
if (err < 0)
goto out_err;
- inode->i_state = 0;
- inode->i_mode = *mode;
+ err = ceph_fscrypt_prepare_context(dir, inode, as_ctx);
+ if (err)
+ goto out_err;
+
return inode;
out_err:
iput(inode);
@@ -102,6 +107,7 @@ void ceph_as_ctx_to_req(struct ceph_mds_request *req,
req->r_pagelist = as_ctx->pagelist;
as_ctx->pagelist = NULL;
}
+ ceph_fscrypt_as_ctx_to_req(req, as_ctx);
}
/**