diff mbox series

ceph: report STATX_ATTR_ENCRYPTED on encrypted inodes

Message ID 20220504110536.13418-1-jlayton@kernel.org (mailing list archive)
State New, archived
Headers show
Series ceph: report STATX_ATTR_ENCRYPTED on encrypted inodes | expand

Commit Message

Jeff Layton May 4, 2022, 11:05 a.m. UTC
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/inode.c | 4 ++++
 1 file changed, 4 insertions(+)

...another minor patch for the fscrypt pile.

Comments

Xiubo Li May 5, 2022, 12:14 a.m. UTC | #1
On 5/4/22 7:05 PM, Jeff Layton wrote:
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>   fs/ceph/inode.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> ...another minor patch for the fscrypt pile.
>
> diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
> index ae9afc149da1..f7d56aaea27d 100644
> --- a/fs/ceph/inode.c
> +++ b/fs/ceph/inode.c
> @@ -2979,6 +2979,10 @@ int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path,
>   			stat->nlink = 1 + 1 + ci->i_subdirs;
>   	}
>   
> +	if (IS_ENCRYPTED(inode))
> +		stat->attributes |= STATX_ATTR_ENCRYPTED;
> +	stat->attributes_mask |= STATX_ATTR_ENCRYPTED;
> +
>   	stat->result_mask = request_mask & valid_mask;
>   	return err;
>   }
Reviewed-by: Xiubo Li <xiubli@redhat.com>
diff mbox series

Patch

diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index ae9afc149da1..f7d56aaea27d 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -2979,6 +2979,10 @@  int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path,
 			stat->nlink = 1 + 1 + ci->i_subdirs;
 	}
 
+	if (IS_ENCRYPTED(inode))
+		stat->attributes |= STATX_ATTR_ENCRYPTED;
+	stat->attributes_mask |= STATX_ATTR_ENCRYPTED;
+
 	stat->result_mask = request_mask & valid_mask;
 	return err;
 }