From: Miklos Szeredi Date: Tue, 13 Dec 2011 10:40:59 +0000 (+0100) Subject: fuse: llseek fix race X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=73104b6e37f75f822e3dcf016147c322d1f6dad9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 --- 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) 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: