Skip to content

Commit

Permalink
fuse: fix SEEK_END incorrectness
Browse files Browse the repository at this point in the history
Update file size before using it in lseek(..., SEEK_END).

Reported-by: Amnon Shiloh <u3557@miso.sublimeip.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
  • Loading branch information
Miklos Szeredi authored and Miklos Szeredi committed Oct 16, 2008
1 parent 04ab591 commit 769415c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,9 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
mutex_lock(&inode->i_mutex);
switch (origin) {
case SEEK_END:
retval = fuse_update_attributes(inode, NULL, file, NULL);
if (retval)
return retval;
offset += i_size_read(inode);
break;
case SEEK_CUR:
Expand Down

0 comments on commit 769415c

Please sign in to comment.