diff mbox series

[RFC,v11,42/51] ceph: disable fallocate for encrypted inodes

Message ID 20220322141316.41325-43-jlayton@kernel.org (mailing list archive)
State Superseded
Headers show
Series ceph+fscrypt : full support | expand

Commit Message

Jeff Layton March 22, 2022, 2:13 p.m. UTC
...hopefully, just for now.

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 1985e3102533..00e6a5bc37c8 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -2203,6 +2203,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;