From dc57965cca4c6820f65e69b1b9c9bf94a38218e6 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Thu, 25 Feb 2016 18:27:09 +0530 Subject: features/shard: Return ENOTSUP for unsupported fallocate flags Backport of: http://review.gluster.org/13523 Basis: http://lists.gnu.org/archive/html/qemu-devel/2016-02/msg05101.html Change-Id: I681eb4d0c43c635cf96a2deab0996dec7a255fe5 BUG: 1299712 Signed-off-by: Krutika Dhananjay Reviewed-on: http://review.gluster.org/13652 Smoke: Gluster Build System Reviewed-by: Ravishankar N NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/features/shard/src/shard.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators/features') diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 857578fde2c..c7cced664ee 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -4590,9 +4590,17 @@ int shard_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t keep_size, off_t offset, size_t len, dict_t *xdata) { + if ((keep_size != 0) && (keep_size != FALLOC_FL_ZERO_RANGE) && + (keep_size != (FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))) + goto out; + shard_common_inode_write_begin (frame, this, GF_FOP_FALLOCATE, fd, NULL, 0, offset, keep_size, len, NULL, xdata); return 0; + +out: + SHARD_STACK_UNWIND (fallocate, frame, -1, ENOTSUP, NULL, NULL, NULL); + return 0; } int -- cgit