From: Miklos Szeredi <miklos@szeredi.hu>
To: Jiachen Zhang <zhangjiachen.jaycee@bytedance.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Xie Yongji <xieyongji@bytedance.com>,
fam.zheng@bytedance.com, Miklos Szeredi <mszeredi@redhat.com>
Subject: Re: [PATCH] fuse: writeback_cache consistency enhancement (writeback_cache_v2)
Date: Mon, 18 Jul 2022 10:18:18 +0200 [thread overview]
Message-ID: <CAJfpegu1uSMGrh==DS9+fbX+Gm8XaOyY3KTQ3xtZsbPEJo1M8A@mail.gmail.com> (raw)
In-Reply-To: <CAFQAk7jTJi_OcX=4nevbOquphcibtD=jG-jwwbC0KMJOfx9DeQ@mail.gmail.com>
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
prev parent reply other threads:[~2022-07-18 8:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 5:58 [PATCH] fuse: writeback_cache consistency enhancement (writeback_cache_v2) Jiachen Zhang
2022-06-24 18:28 ` Vivek Goyal
2022-06-28 5:18 ` [External] " Jiachen Zhang
2022-06-29 17:24 ` Vivek Goyal
2022-06-28 10:09 ` Amir Goldstein
2022-06-29 18:37 ` Vivek Goyal
2022-06-29 17:57 ` Vivek Goyal
2022-07-18 5:17 ` Jiachen Zhang
2022-07-25 13:15 ` Vivek Goyal
2022-06-29 18:14 ` Vivek Goyal
2022-07-18 5:48 ` [External] " Jiachen Zhang
2022-07-25 13:30 ` Vivek Goyal
2022-07-15 10:07 ` Miklos Szeredi
2022-07-18 6:01 ` Jiachen Zhang
2022-07-18 8:18 ` Miklos Szeredi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJfpegu1uSMGrh==DS9+fbX+Gm8XaOyY3KTQ3xtZsbPEJo1M8A@mail.gmail.com' \
--to=miklos@szeredi.hu \
--cc=fam.zheng@bytedance.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=xieyongji@bytedance.com \
--cc=zhangjiachen.jaycee@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).