ANDROID: fuse-bpf: Fix lseek return value for offset 0

Bug: 227160050
Test: audible app now works
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ib14765285190b5838f28c25a69c91935d02c34f4
This commit is contained in:
Paul Lawrence
2022-04-11 12:33:39 -07:00
parent bba21782c8
commit b196350f2a

View File

@@ -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);