Skip to contentSkip to conversation

ceph: fix compilation error when building kernel without FS_ENCRYPT

PATCH In review Luís Henriques 2 participants 2 messages Apr 19, 2022 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: fix compilation error when building kernel without FS_ENCRYPT

When compiling without FS_ENCRYPTION config, the kernel will fail to build with:

fs/ceph/inode.c:196:7: error: no member named 'fscrypt_auth' in 'struct ceph_inode_info'

Enclose the code within an #ifdef CONFIG_FS_ENCRYPTION to fix it.

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

Jeff, feel free to squash this patch into one of the previous patches from the snapshot names encryption series.

fs/ceph/inode.c +2 -0
index 636e4e0a9dc6..5de7bb9048b7 100644
@@ -189,6 +189,7 @@ struct inode *ceph_get_snapdir(struct inode *parent)
 	ci->i_rbytes = 0;
 	ci->i_btime = ceph_inode(parent)->i_btime;
 
+#ifdef CONFIG_FS_ENCRYPTION
 	/* if encrypted, just borrow fscrypt_auth from parent */
 	if (IS_ENCRYPTED(parent)) {
 		struct ceph_inode_info *pci = ceph_inode(parent);
@@ -205,6 +206,7 @@ struct inode *ceph_get_snapdir(struct inode *parent)
 			goto err;
 		}
 	}
+#endif
 	if (inode->i_state & I_NEW) {
 		inode->i_op = &ceph_snapdir_iops;
 		inode->i_fop = &ceph_snapdir_fops;
#1 lore raw
Quoted 29 lines · Luís Henriques

When compiling without FS_ENCRYPTION config, the kernel will fail to build with:

fs/ceph/inode.c:196:7: error: no member named 'fscrypt_auth' in 'struct ceph_inode_info'

Enclose the code within an #ifdef CONFIG_FS_ENCRYPTION to fix it.

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

Jeff, feel free to squash this patch into one of the previous patches from the snapshot names encryption series.

fs/ceph/inode.c +1 -0
index 636e4e0a9dc6..5de7bb9048b7 100644
@@ -189,6 +189,7 @@ struct inode *ceph_get_snapdir(struct inode *parent)
 	ci->i_rbytes = 0;
 	ci->i_btime = ceph_inode(parent)->i_btime;
 
+#ifdef CONFIG_FS_ENCRYPTION
 	/* if encrypted, just borrow fscrypt_auth from parent */
 	if (IS_ENCRYPTED(parent)) {
 		struct ceph_inode_info *pci = ceph_inode(parent);

fs/ceph/inode.c struct inode *ceph_get_snapdir(struct inode *parent) · line 212

Quoted 7 lines
fs/ceph/inode.c +1 -0
@@ -205,6 +206,7 @@ struct inode *ceph_get_snapdir(struct inode *parent)
 			goto err;
 		}
 	}
+#endif
 	if (inode->i_state & I_NEW) {
 		inode->i_op = &ceph_snapdir_iops;
 		inode->i_fop = &ceph_snapdir_fops;

Thanks, I folded this one into this patch:

ceph: add support for encrypted snapshot names

Cheers,

Signature · 1 line
Jeff Layton <[email protected]>