lkml.org 
[lkml]   [2022]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] fuse: writeback_cache consistency enhancement (writeback_cache_v2)
On Mon, 18 Jul 2022 at 08:01, Jiachen Zhang
<zhangjiachen.jaycee@bytedance.com> wrote:
>
> On Fri, Jul 15, 2022 at 6:07 PM Miklos Szeredi <miklos@szeredi.hu> wrote:
> >
> > On Fri, 24 Jun 2022 at 07:58, Jiachen Zhang
> > <zhangjiachen.jaycee@bytedance.com> wrote:

> > > + if (fc->writeback_cache_v2 && S_ISREG(inode->i_mode)) {
> > > + inode_lock(inode);
> >
> > I don't think this can work. fuse_change_attributes() might be
> > called from within inlode locked context. E.g.
> >
> > lookup_slow -> __lookup_slow -> d_revalidate -> fuse_dentry_revalidate
> > -> fuse_change_attributes
> >
>
> Yes, this is a problem that should be fixed. As we can not check the
> inode lock state from the inode->i_rwsem structure, I think we can
> pass the inode lock state along the FUSE function call-path to
> fuse_change_attributes(), and only when we can certainly know whether
> the inode is locked or unlocked then we continue the
> writeback_cache_v2 logics. What do you think?

Not liking it very much.

Better create a new lock for this purpose that we do always know the state of.

Thanks,
Miklos

\
 
 \ /
  Last update: 2022-07-18 10:19    [W:0.050 / U:1.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site