浏览代码

ceph: check unsupported fallocate mode

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Yan, Zheng 11 年之前
父节点
当前提交
494d77bf8f
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      fs/ceph/file.c

+ 3 - 0
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;