aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2014-06-23 16:22:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-23 19:47:43 -0400
commit13ace4d0d9db40e10ecd66dfda14e297571be813 (patch)
tree9ed45b2ee2053f1b0fd8f1efd0f9c5c3d8f5671c
parent7cdb0d25bc93e936edbfde12fe277ee21b88c1ef (diff)
tmpfs: ZERO_RANGE and COLLAPSE_RANGE not currently supported
I was well aware of FALLOC_FL_ZERO_RANGE and FALLOC_FL_COLLAPSE_RANGE support being added to fallocate(); but didn't realize until now that I had been too stupid to future-proof shmem_fallocate() against new additions. -EOPNOTSUPP instead of going on to ordinary fallocation. Signed-off-by: Hugh Dickins <hughd@google.com> Reviewed-by: Lukas Czerner <lczerner@redhat.com> Cc: <stable@vger.kernel.org> [3.15] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/shmem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index f484c276e994..91b912b37b8c 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1724,6 +1724,9 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
1724 pgoff_t start, index, end; 1724 pgoff_t start, index, end;
1725 int error; 1725 int error;
1726 1726
1727 if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
1728 return -EOPNOTSUPP;
1729
1727 mutex_lock(&inode->i_mutex); 1730 mutex_lock(&inode->i_mutex);
1728 1731
1729 if (mode & FALLOC_FL_PUNCH_HOLE) { 1732 if (mode & FALLOC_FL_PUNCH_HOLE) {