linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Costa Sapuntzakis <costa@purestorage.com>
Cc: Hillf Danton <hdanton@sina.com>, Jan Kara <jack@suse.cz>,
	syzbot <syzbot+7a4ba6a239b91a126c28@syzkaller.appspotmail.com>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Theodore Ts'o <tytso@mit.edu>,
	syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk
Subject: Re: BUG: sleeping function called from invalid context in ext4_superblock_csum_set
Date: Wed, 11 Nov 2020 15:31:06 +0100	[thread overview]
Message-ID: <20201111143106.GC28132@quack2.suse.cz> (raw)
In-Reply-To: <20201104131235.GD5600@quack2.suse.cz>

On Wed 04-11-20 14:12:35, Jan Kara wrote:
> On Tue 03-11-20 09:16:19, Costa Sapuntzakis wrote:
> > Jan, does this fixup from Hillf look ok to you?  You originally argued for
> > lock_buffer/unlock_buffer.
> > 
> > I think the problem here is that the ext4 code assumes that
> > ext4_commit_super will not sleep if sync == 0 (or at least
> > __ext4_grp_locked_error deos). Perhaps there should be a comment on
> > ext4_commit_super documenting this constraint.
> 
> Hum, right. I forgot about that. The spinlock Hillf suggests kind of works
> but it still doesn't quite handle the case where superblock is modified in
> parallel from another place (that can still lead to sb checksum mismatch on
> next load). When we are going for a more complex solution I'd rather solve
> this as well... I'm looking into possible solutions now.

Just an update: I'm still working on this and it's like peeling an onion.
The mixing of journalled superblock updates with unjournalled one is really
evil and commit acaa532687cd fixes just a small part of the problems. So
for now I suggest to just revert acaa532687cd (to avoid sleep in atomic
context) and I'll submit larger set of fixes once they are ready.

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

      reply	other threads:[~2020-11-11 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01 23:24 BUG: sleeping function called from invalid context in ext4_superblock_csum_set syzbot
     [not found] ` <20201102033326.3343-1-hdanton@sina.com>
     [not found]   ` <CAABuPhbFbQ+_nwDKXjUngtuS5twU6OqKtNu5xYW-d82JJ3cFuQ@mail.gmail.com>
2020-11-04 13:12     ` Jan Kara
2020-11-11 14:31       ` 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=20201111143106.GC28132@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=costa@purestorage.com \
    --cc=hdanton@sina.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+7a4ba6a239b91a126c28@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /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).