Skip to content

Commit

Permalink
tmpfs: ZERO_RANGE and COLLAPSE_RANGE not currently supported
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Lukas Czerner <[email protected]>
Cc: <[email protected]>	[3.15]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Hugh Dickins authored and torvalds committed Jun 23, 2014
1 parent 7cdb0d2 commit 13ace4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,9 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
pgoff_t start, index, end;
int error;

if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
return -EOPNOTSUPP;

mutex_lock(&inode->i_mutex);

if (mode & FALLOC_FL_PUNCH_HOLE) {
Expand Down

0 comments on commit 13ace4d

Please sign in to comment.