From 494d77bf8fd732f164b91710bd522ee38acb4c2e Mon Sep 17 00:00:00 2001 From: Yan, Zheng Date: Thu, 26 Jun 2014 15:25:17 +0800 Subject: ceph: check unsupported fallocate mode Signed-off-by: Yan, Zheng --- fs/ceph/file.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs/ceph/file.c') diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 302085100c28..19af25dff644 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -1177,6 +1177,9 @@ static long ceph_fallocate(struct file *file, int mode, loff_t endoff = 0; loff_t size; + if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE)) + return -EOPNOTSUPP; + if (!S_ISREG(inode->i_mode)) return -EOPNOTSUPP; -- cgit v1.2.3-55-g7522