fuse: fix SEEK_END incorrectness
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>
This commit is contained in:
parent
04ab591808
commit
769415c611
1 changed files with 3 additions and 0 deletions
|
@ -1448,6 +1448,9 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
|
||||||
mutex_lock(&inode->i_mutex);
|
mutex_lock(&inode->i_mutex);
|
||||||
switch (origin) {
|
switch (origin) {
|
||||||
case SEEK_END:
|
case SEEK_END:
|
||||||
|
retval = fuse_update_attributes(inode, NULL, file, NULL);
|
||||||
|
if (retval)
|
||||||
|
return retval;
|
||||||
offset += i_size_read(inode);
|
offset += i_size_read(inode);
|
||||||
break;
|
break;
|
||||||
case SEEK_CUR:
|
case SEEK_CUR:
|
||||||
|
|
Loading…
Add table
Reference in a new issue