Commit 264b86651c0986b4cf3b1e3ff48449d7afbaf0d5

Authored by Hugh Dickins
Committed by Greg Kroah-Hartman
1 parent faff2e120d

tmpfs: ZERO_RANGE and COLLAPSE_RANGE not currently supported

commit 13ace4d0d9db40e10ecd66dfda14e297571be813 upstream.

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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

... ... @@ -1728,6 +1728,9 @@
1728 1728 pgoff_t start, index, end;
1729 1729 int error;
1730 1730  
  1731 + if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
  1732 + return -EOPNOTSUPP;
  1733 +
1731 1734 mutex_lock(&inode->i_mutex);
1732 1735  
1733 1736 if (mode & FALLOC_FL_PUNCH_HOLE) {