LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [fscrypt][RFC PATCH v2] ceph: don't allow changing layout on encrypted files/directories
@ 2021-08-17 14:04 Luis Henriques
  2021-08-18 12:20 ` Jeff Layton
  0 siblings, 1 reply; 2+ messages in thread
From: Luis Henriques @ 2021-08-17 14:04 UTC (permalink / raw)
  To: Jeff Layton; +Cc: ceph-devel, linux-kernel, Luis Henriques

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@suse.de>
---
Changes since v1:
- dropped changes to ceph_sync_setxattr(), MDS shall be responsible for
  preventing layout changes on encrypted dirs/files

 fs/ceph/ioctl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index 477ecc667aee..480d18bb2ff0 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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [fscrypt][RFC PATCH v2] ceph: don't allow changing layout on encrypted files/directories
  2021-08-17 14:04 [fscrypt][RFC PATCH v2] ceph: don't allow changing layout on encrypted files/directories Luis Henriques
@ 2021-08-18 12:20 ` Jeff Layton
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2021-08-18 12:20 UTC (permalink / raw)
  To: Luis Henriques; +Cc: ceph-devel, linux-kernel

On Tue, 2021-08-17 at 15:04 +0100, Luis Henriques wrote:
> 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@suse.de>
> ---
> Changes since v1:
> - dropped changes to ceph_sync_setxattr(), MDS shall be responsible for
>   preventing layout changes on encrypted dirs/files
> 
>  fs/ceph/ioctl.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
> index 477ecc667aee..480d18bb2ff0 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;

Thanks Luis. I've gone ahead and merged this into my fscrypt pile.
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-18 12:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 14:04 [fscrypt][RFC PATCH v2] ceph: don't allow changing layout on encrypted files/directories Luis Henriques
2021-08-18 12:20 ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).