diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-12-13 05:40:59 -0500 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2011-12-13 05:40:59 -0500 |
commit | 73104b6e37f75f822e3dcf016147c322d1f6dad9 (patch) | |
tree | 07e8021e78af4237f645fef86ffe887aee5b4ea1 /fs | |
parent | b48c6af2086ab2ba8a9c9b6ce9ecb34592ce500c (diff) |
fuse: llseek fix race
Fix race between lseek(fd, 0, SEEK_CUR) and read/write. This was fixed in
generic code by commit 5b6f1eb97d (vfs: lseek(fd, 0, SEEK_CUR) race condition).
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fuse/file.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 19029e97ca2f..0c84100acd44 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -1567,6 +1567,10 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin) | |||
1567 | offset += i_size_read(inode); | 1567 | offset += i_size_read(inode); |
1568 | break; | 1568 | break; |
1569 | case SEEK_CUR: | 1569 | case SEEK_CUR: |
1570 | if (offset == 0) { | ||
1571 | retval = file->f_pos; | ||
1572 | goto exit; | ||
1573 | } | ||
1570 | offset += file->f_pos; | 1574 | offset += file->f_pos; |
1571 | break; | 1575 | break; |
1572 | case SEEK_DATA: | 1576 | case SEEK_DATA: |