public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add support to check for FALLOC_FL_COLLAPSE_RANGE  and FALLOC_FL_ZERO_RANGE crap modes
@ 2014-07-31 17:53 Nicholas Krause
  2014-07-31 19:09 ` Hugo Mills
  2014-08-01  1:49 ` Duncan
  0 siblings, 2 replies; 7+ messages in thread
From: Nicholas Krause @ 2014-07-31 17:53 UTC (permalink / raw)
  To: clm; +Cc: jbacik, linux-btrfs, linux-kernel

This adds checks for the stated modes as if they are crap we will return error
not supported.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 fs/btrfs/file.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 1f2b99c..599495a 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2490,7 +2490,8 @@ static long btrfs_fallocate(struct file *file, int mode,
 	alloc_end = round_up(offset + len, blocksize);
 
 	/* Make sure we aren't being give some crap mode */
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
+	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE|
+	FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE))
 		return -EOPNOTSUPP;
 
 	if (mode & FALLOC_FL_PUNCH_HOLE)
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-08-01 16:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31 17:53 [PATCH] Add support to check for FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_ZERO_RANGE crap modes Nicholas Krause
2014-07-31 19:09 ` Hugo Mills
2014-08-01  1:53   ` Nick Krause
2014-08-01  9:26     ` Hugo Mills
2014-08-01 12:21   ` Theodore Ts'o
2014-08-01 16:07     ` Nick Krause
2014-08-01  1:49 ` Duncan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox