Skip to contentSkip to conversation

ceph: report STATX_ATTR_ENCRYPTED on encrypted inodes

PATCH In review Jeff Layton 2 participants 2 messages May 4, 2022 – May 5, 2022 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: report STATX_ATTR_ENCRYPTED on encrypted inodes

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

...another minor patch for the fscrypt pile.

fs/ceph/inode.c +4 -0
index ae9afc149da1..f7d56aaea27d 100644
@@ -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;
 }
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Jeff Layton
---
  fs/ceph/inode.c | 4 ++++
  1 file changed, 4 insertions(+)

...another minor patch for the fscrypt pile.

fs/ceph/inode.c +0 -0
index ae9afc149da1..f7d56aaea27d 100644

fs/ceph/inode.c int ceph_getattr(struct user_namespace *mnt_userns, const struct path *path, · line 2988

Quoted 10 lines
fs/ceph/inode.c +4 -0
@@ -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;
  }