[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220322141316.41325-31-jlayton@kernel.org>
Date: Tue, 22 Mar 2022 10:12:55 -0400
From: Jeff Layton <jlayton@...nel.org>
To: idryomov@...il.com, xiubli@...hat.com
Cc: ceph-devel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-fscrypt@...r.kernel.org, linux-kernel@...r.kernel.org,
lhenriques@...e.de
Subject: [RFC PATCH v11 30/51] ceph: don't allow changing layout on encrypted files/directories
From: Luis Henriques <lhenriques@...e.de>
Encryption is currently only supported on files/directories with layouts
where stripe_count=1. Forbid changing layouts when encryption is involved.
Signed-off-by: Luis Henriques <lhenriques@...e.de>
Signed-off-by: Jeff Layton <jlayton@...nel.org>
---
fs/ceph/ioctl.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index b9f0f4e460ab..9675ef3a6c47 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -294,6 +294,10 @@ static long ceph_set_encryption_policy(struct file *file, unsigned long arg)
struct inode *inode = file_inode(file);
struct ceph_inode_info *ci = ceph_inode(inode);
+ /* encrypted directories can't have striped layout */
+ if (ci->i_layout.stripe_count > 1)
+ return -EINVAL;
+
ret = vet_mds_for_fscrypt(file);
if (ret)
return ret;
--
2.35.1
Powered by blists - more mailing lists