From b196350f2afed30a80b2007dadff251292abe8ed Mon Sep 17 00:00:00 2001 From: Paul Lawrence Date: Mon, 11 Apr 2022 12:33:39 -0700 Subject: [PATCH] ANDROID: fuse-bpf: Fix lseek return value for offset 0 Bug: 227160050 Test: audible app now works Signed-off-by: Paul Lawrence Change-Id: Ib14765285190b5838f28c25a69c91935d02c34f4 --- fs/fuse/backing.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c index 118bd9d12945..dc11545dcd48 100644 --- a/fs/fuse/backing.c +++ b/fs/fuse/backing.c @@ -465,11 +465,15 @@ int fuse_lseek_backing(struct fuse_args *fa, struct file *file, loff_t offset, i /* TODO: Handle changing of the file handle */ if (offset == 0) { - if (whence == SEEK_CUR) - return file->f_pos; + if (whence == SEEK_CUR) { + flo->offset = file->f_pos; + return flo->offset; + } - if (whence == SEEK_SET) - return vfs_setpos(file, 0, 0); + if (whence == SEEK_SET) { + flo->offset = vfs_setpos(file, 0, 0); + return flo->offset; + } } inode_lock(file->f_inode);