]> rtime.felk.cvut.cz Git - linux-imx.git/blobdiff - mm/shmem.c
tmpfs: fix SEEK_DATA/SEEK_HOLE regression
[linux-imx.git] / mm / shmem.c
index a87990cf9f94019c70d7263d247c1c94945aee5b..8335dbd3fc358ed1fe9d6521785ecee1dc031313 100644 (file)
@@ -1798,7 +1798,8 @@ static loff_t shmem_file_llseek(struct file *file, loff_t offset, int whence)
                }
        }
 
-       offset = vfs_setpos(file, offset, MAX_LFS_FILESIZE);
+       if (offset >= 0)
+               offset = vfs_setpos(file, offset, MAX_LFS_FILESIZE);
        mutex_unlock(&inode->i_mutex);
        return offset;
 }