lkml.org 
[lkml]   [2023]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] kernfs: implement custom llseek method to fix userspace regression
From
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

\
 
 \ /
  Last update: 2023-08-17 20:55    [W:0.077 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site