From: Nicholas Krause <xerofoify@gmail.com>
To: clm@fb.com
Cc: jbacik@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Add support to check for FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_ZERO_RANGE crap modes
Date: Thu, 31 Jul 2014 13:53:33 -0400 [thread overview]
Message-ID: <1406829213-4759-1-git-send-email-xerofoify@gmail.com> (raw)
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
next reply other threads:[~2014-07-31 17:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 17:53 Nicholas Krause [this message]
2014-07-31 19:09 ` [PATCH] Add support to check for FALLOC_FL_COLLAPSE_RANGE and FALLOC_FL_ZERO_RANGE crap modes 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1406829213-4759-1-git-send-email-xerofoify@gmail.com \
--to=xerofoify@gmail.com \
--cc=clm@fb.com \
--cc=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.