summaryrefslogtreecommitdiff
path: root/fs/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 2eb43a54e2d6..9634eb79b041 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1481,13 +1481,13 @@ static loff_t ceph_llseek(struct file *file, loff_t offset, int whence)
offset += file->f_pos;
break;
case SEEK_DATA:
- if (offset >= i_size) {
+ if (offset < 0 || offset >= i_size) {
ret = -ENXIO;
goto out;
}
break;
case SEEK_HOLE:
- if (offset >= i_size) {
+ if (offset < 0 || offset >= i_size) {
ret = -ENXIO;
goto out;
}