Messages in this thread | | | Date | Thu, 17 Aug 2023 23:53:57 +0500 | Subject | Re: [PATCH] kernfs: implement custom llseek method to fix userspace regression | From | Valentin Sinitsyn <> |
| |
On 15.08.2023 20:48, Dan Williams wrote: > Valentin Sinitsyn wrote: > [..] >>> My only concern is whether there are any scenarios where this is not >>> appropriate. I.e. do a bit more work to define a kernfs_ops instance >>> specifically for overriding lseek() in this scenario. >> >> Not sure I'm getting you here: do you mean something like this? >> >> struct inode *inode = is_f_mapping_redefined(file) ? file_inode(file) : >> file->f_mapping->host; > > I meant something like the patch below (incomplete, but shows the idea). Understood, thanks. I believe the change can be localized even further, up to the point where battr->f_mapping is initialized with iomem_get_mapping, as it is the only override known to break generic_file_llseek().
I'll send the updated patch in a few days.
Best, Valentin
| |