From: Al Viro <viro@ZenIV.linux.org.uk>
To: Eric Biggers <ebiggers3@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
syzbot+d2586fde8fdcead3647f@syzkaller.appspotmail.com,
hughd@google.com, syzkaller-bugs@googlegroups.com,
linux-mm@kvack.org, Dave Chinner <dchinner@redhat.com>
Subject: Re: [PATCH] shmem: don't call put_super() when fill_super() failed.
Date: Mon, 14 May 2018 19:07:10 +0100 [thread overview]
Message-ID: <20180514180710.GK30522@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20180514171154.GB252575@gmail.com>
On Mon, May 14, 2018 at 10:11:54AM -0700, Eric Biggers wrote:
> > I'm not following, since generic_shutdown_super() only calls ->put_super() if
> > ->s_root is set, which only happens at the end of shmem_fill_super(). Isn't the
> > real problem that s_shrink is registered too early, causing super_cache_count()
> > and shmem_unused_huge_count() to potentially run before shmem_fill_super() has
> > completed? Or alternatively, the problem is that super_cache_count() doesn't
> > check for SB_ACTIVE.
> >
>
> Coincidentally, this is already going to be fixed by commit 79f546a696bff259
> ("fs: don't scan the inode cache before SB_BORN is set") in vfs/for-linus.
Exactly. While we are at it, we could add
static void shmem_kill_super(struct super_block *sb)
{
struct shmem_sb_info *sbinfo = SHMEM_SB(sb);
kill_litter_super(sb);
if (sbinfo) {
percpu_counter_destroy(&sbinfo->used_blocks);
mpol_put(sbinfo->mpol);
kfree(sbinfo);
}
}
use that for ->kill_sb() and to hell with shmem_put_super() *and* its call in
cleanup path of shmem_fill_super() - these err = -E...; goto failed; in there
become simply return -E...;
next prev parent reply other threads:[~2018-05-14 18:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 6:57 Tetsuo Handa
2018-05-14 17:04 ` Eric Biggers
2018-05-14 17:11 ` Eric Biggers
2018-05-14 18:07 ` Al Viro [this message]
2018-05-14 20:59 ` Tetsuo Handa
2018-05-15 0:27 ` Tetsuo Handa
2018-05-15 0:39 ` Al Viro
2018-05-15 0:52 ` Tetsuo Handa
2018-05-15 1:13 ` Al Viro
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=20180514180710.GK30522@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=dchinner@redhat.com \
--cc=ebiggers3@gmail.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=syzbot+d2586fde8fdcead3647f@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.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