lkml.org 
[lkml]   [2014]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] lguest: force file->private_data to be NULL on open()
Am 2014-10-19 02:31, schrieb Martin Kepplinger:
> if we depend on private_data being NULL in write() before initialize()
> make sure it is NULL after open().
>
> Signed-off-by: Martin Kepplinger <martink@posteo.de>
> ---
>
> I'm not completely sure if this patch is needed and am still investigating.
> What do you think? open() could be called by the user I guess. Does
> lguest_user.c depend on private_data being NULL on a first write()?
>
>

Could it be that this patch is not needed indeed or did I ask not clear
enough here and caused a misunderstanding:


> Martin Kepplinger <martink@posteo.de> writes:
>> hi
>>
>> Just a question for understanding: open() is not implemented in
>> lguest_user.c's miscdevice. The miscdevice core, in this case, does
>> _not_ set file->private_data on a user's open() call. Is open() called
>> by the user here? and do you here _depend_ on file->private_data being
>> NULL after open()? (could you even?)
>>
>> Would the following force to NULL be necessary if the miscdevice core
>> _would_ set private_data?
>
> Hi Martin!
>
> Yes, the private_data is NULL on a new file. See
> get_empty_filp in fs/file_table.c, which does kmem_cache_zalloc
> (zeroing all the contents).
>
> So this isn't necessary here.
>
> Thanks!
> Rusty.



\
 
 \ /
  Last update: 2014-10-20 16:01    [W:0.305 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site