diff mbox series

[v14,50/64] ceph: disable fallocate for encrypted inodes

Message ID 20220427191314.222867-51-jlayton@kernel.org
State Superseded
Headers show
Series [v14,01/64] libceph: add spinlock around osd->o_requests | expand

Commit Message

Jeff Layton April 27, 2022, 7: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 7168cf97924b..1024dc57898d 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -2217,6 +2217,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;