Valentin Sinitsyn wrote: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().
[..]
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).