public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Costa Sapuntzakis <costa@purestorage.com>
Cc: Jan Kara <jack@suse.cz>, linux-ext4@vger.kernel.org
Subject: Re: [BUG] invalid superblock checksum possibly due to race
Date: Wed, 1 Jul 2020 18:22:48 +0200	[thread overview]
Message-ID: <20200701162248.GA4355@quack2.suse.cz> (raw)
In-Reply-To: <CAABuPhZrQXQ8-tFu9V3575by5N3RV7jd-OcOjy_pLw_na1OUkw@mail.gmail.com>

Hello!

On Tue 30-06-20 11:34:49, Costa Sapuntzakis wrote:
> > Yes, probably ext4_superblock_csum_set() should use
> >
> > lock_buffer(EXT4_SB(sb)->s_sbh)
> >
> > to synchronize updating of superblock checksum. Will you send a patch?
> 
> Yes. I will send a patch.

Thanks!

> I noticed lock_buffer can sleep. That would seem to imply to me that
> lock_buffer can be held across I/Os.
> I worry that this will occasionally significantly slow down this code
> path compared to what it used to be.  Are there any things
> about the way ext4 uses buffers that makes this less of a concern?

Yes, buffer lock is a sleeping lock but that's the lock we usually use to
protect consistency of buffer contents. So I prefer to use that lock unless
we have definitive performance data showing we need something more
clever...

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      reply	other threads:[~2020-07-01 16:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 23:56 [BUG] invalid superblock checksum possibly due to race Costa Sapuntzakis
2020-06-30 11:48 ` Jan Kara
2020-06-30 18:34   ` Costa Sapuntzakis
2020-07-01 16:22     ` Jan Kara [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=20200701162248.GA4355@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=costa@purestorage.com \
    --cc=linux-ext4@vger.kernel.org \
    /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