Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 769415c6 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Miklos Szeredi
Browse files

fuse: fix SEEK_END incorrectness



Update file size before using it in lseek(..., SEEK_END).

Reported-by: default avatarAmnon Shiloh <u3557@miso.sublimeip.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
parent 04ab5918
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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: