aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorHugh Dickins <hughd@google.com>2013-08-04 14:30:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-08-04 14:40:17 -0400
commit387aae6fdd737038e92d7bb40712bdf6dcb11945 (patch)
tree7066b704e3ca7bdc714226aca98f0b5e278d3367 /mm/shmem.c
parent2f85399115ff2632a2d32dd76ef8b524374e69f3 (diff)
tmpfs: fix SEEK_DATA/SEEK_HOLE regression
Commit 46a1c2c7ae53 ("vfs: export lseek_execute() to modules") broke the tmpfs SEEK_DATA/SEEK_HOLE implementation, because vfs_setpos() converts the carefully prepared -ENXIO to -EINVAL. Other filesystems avoid it in error cases: do the same in tmpfs. Signed-off-by: Hugh Dickins <hughd@google.com> Cc: Jie Liu <jeff.liu@oracle.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index a87990cf9f94..8335dbd3fc35 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1798,7 +1798,8 @@ static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)
1798 } 1798 }
1799 } 1799 }
1800 1800
1801 offset = vfs_setpos(file, offset, MAX_LFS_FILESIZE); 1801 if (offset >= 0)
1802 offset = vfs_setpos(file, offset, MAX_LFS_FILESIZE);
1802 mutex_unlock(&inode->i_mutex); 1803 mutex_unlock(&inode->i_mutex);
1803 return offset; 1804 return offset;
1804} 1805}