linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: KCSAN in fuse (fuse_request_end <-> fuse_request_end)
Date: Mon, 29 Apr 2024 10:34:26 -0700	[thread overview]
Message-ID: <Zi/aIkYRU5N03xEC@gmail.com> (raw)
In-Reply-To: <CAJfpeguNAEH88aKTSFbEdaa4neUbpXVkbr5-XiAkOEH6ZNUoHQ@mail.gmail.com>

On Mon, Apr 29, 2024 at 04:18:56PM +0200, Miklos Szeredi wrote:
> On Fri, 26 Apr 2024 at 18:18, Breno Leitao <leitao@debian.org> wrote:
> 
> > fuse_request_end() reads and writes to ->num_background while holding
> > the bg_lock, but fuse_readahead() does not hold any lock before reading
> > ->num_background.  That is what KCSAN seems to be complaining about.
> >
> > Should we get ->bg_lock before reading ->num_background?
> 
> Probably not necessary.  Does wrapping that access in READ_ONCE() fix
> the complaint?

Yes, reading ->num_background using READ_ONCE() in the fuse_readahead()
path fix KCSAN complaint.

Should I sent it for review?

Thanks

  reply	other threads:[~2024-04-29 17:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 16:17 KCSAN in fuse (fuse_request_end <-> fuse_request_end) Breno Leitao
2024-04-29 14:18 ` Miklos Szeredi
2024-04-29 17:34   ` Breno Leitao [this message]
2024-05-09 11:10     ` Miklos Szeredi

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=Zi/aIkYRU5N03xEC@gmail.com \
    --to=leitao@debian.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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).