aboutsummaryrefslogtreecommitdiff
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-12-14 18:23:35 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-12-14 18:23:35 -0800
commit30aaca4582eac20a52ac7b2ec35bdb908133e5b1 (patch)
treeddc71661851922ba75dbeb0e6f272e9c2a0895fb /fs/fuse/file.c
parentddb360778a86bcf55d856bc15df3ebd2e77afff1 (diff)
parent73104b6e37f75f822e3dcf016147c322d1f6dad9 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: llseek fix race fuse: fix llseek bug fuse: fix fuse_retrieve
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r--fs/fuse/file.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 594f07a81c2..0c84100acd4 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -1556,7 +1556,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
struct inode *inode = file->f_path.dentry->d_inode;
mutex_lock(&inode->i_mutex);
- if (origin != SEEK_CUR || origin != SEEK_SET) {
+ if (origin != SEEK_CUR && origin != SEEK_SET) {
retval = fuse_update_attributes(inode, NULL, file, NULL);
if (retval)
goto exit;
@@ -1567,6 +1567,10 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
offset += i_size_read(inode);
break;
case SEEK_CUR:
+ if (offset == 0) {
+ retval = file->f_pos;
+ goto exit;
+ }
offset += file->f_pos;
break;
case SEEK_DATA: