[lkml]   [2020]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v4] 9p: retrieve fid from file when file instance exist.
Jianyong Wu wrote on Fri, Jul 10, 2020:
> In the current setattr implementation in 9p, fid is always retrieved
> from dentry no matter file instance exists or not. If so, there may be
> some info related to opened file instance dropped. So it's better
> to retrieve fid from file instance when it is passed to setattr.
> for example:
> fd=open("tmp", O_RDWR);
> ftruncate(fd, 10);
> The file context related with the fd will be lost as fid is always
> retrieved from dentry, then the backend can't get the info of
> file context. It is against the original intention of user and
> may lead to bug.
> Signed-off-by: Jianyong Wu <>
> ---

For next time, you can add arbitrary comments (e.g. describe briefly
differences from previous versions) after the --- line.

For others, this inits fid to NULL in both functions; thanks for picking
it up I'll refresh the patch.


 \ /
  Last update: 2020-07-10 13:09    [W:0.071 / U:2.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site