aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 3c3abff731a..a381cd22f51 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1817,6 +1817,11 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin)
1817 goto out; 1817 goto out;
1818 case SEEK_DATA: 1818 case SEEK_DATA:
1819 case SEEK_HOLE: 1819 case SEEK_HOLE:
1820 if (offset >= i_size_read(inode)) {
1821 mutex_unlock(&inode->i_mutex);
1822 return -ENXIO;
1823 }
1824
1820 ret = find_desired_extent(inode, &offset, origin); 1825 ret = find_desired_extent(inode, &offset, origin);
1821 if (ret) { 1826 if (ret) {
1822 mutex_unlock(&inode->i_mutex); 1827 mutex_unlock(&inode->i_mutex);
@@ -1825,11 +1830,11 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin)
1825 } 1830 }
1826 1831
1827 if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) { 1832 if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) {
1828 ret = -EINVAL; 1833 offset = -EINVAL;
1829 goto out; 1834 goto out;
1830 } 1835 }
1831 if (offset > inode->i_sb->s_maxbytes) { 1836 if (offset > inode->i_sb->s_maxbytes) {
1832 ret = -EINVAL; 1837 offset = -EINVAL;
1833 goto out; 1838 goto out;
1834 } 1839 }
1835 1840