diff mbox series

[v16,51/68] ceph: disable fallocate for encrypted inodes

Message ID 20230227032813.337906-52-xiubli@redhat.com
State Superseded
Headers show
Series ceph+fscrypt: full support | expand

Commit Message

Xiubo Li Feb. 27, 2023, 3:27 a.m. UTC
From: Jeff Layton <jlayton@kernel.org>

...hopefully, just for now.

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/file.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 0b1206eeb3b1..a9d4e4492420 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -2199,6 +2199,9 @@  static long ceph_fallocate(struct file *file, int mode,
 	if (!S_ISREG(inode->i_mode))
 		return -EOPNOTSUPP;
 
+	if (IS_ENCRYPTED(inode))
+		return -EOPNOTSUPP;
+
 	prealloc_cf = ceph_alloc_cap_flush();
 	if (!prealloc_cf)
 		return -ENOMEM;