From: Jan Kara <jack@suse.cz>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Jan Kara <jack@suse.cz>, Dong Aisheng <dongas86@gmail.com>,
Tejun Heo <tj@kernel.org>,
viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.or>,
Dong Aisheng-B29396 <b29396@freescale.com>,
r64343@freescale.com
Subject: Re: WARNING: at fs/fs-writeback.c when plug out SD card after system suspend/resume
Date: Thu, 4 Dec 2014 15:08:35 +0100 [thread overview]
Message-ID: <20141204140835.GA15108@quack.suse.cz> (raw)
In-Reply-To: <CAPDyKFphwNUUV-e8SuZDEutMCu_a-S9cEP08V0DwUJywa6PtOg@mail.gmail.com>
On Thu 04-12-14 14:36:03, Ulf Hansson wrote:
> On 4 December 2014 at 13:41, Jan Kara <jack@suse.cz> wrote:
> > On Thu 04-12-14 11:43:17, Dong Aisheng wrote:
> >> Hi ALL,
> >>
> >> We met an filesystem issue when do stable kernel upgrade from 3.10.31 to
> >> 3.10.53. And we found it's caused by the following commit bf0972039 which
> >> introduced in 3.10.53.
> >> After applying this patch, after system suspend/resume, plug out a SD card
> >> will cause the following WARNING if SD card has a filesystem mounted.
> >> If revert it, no such WARNING shows.
> >>
> >> I also tried the latest linux-next tree, it also has such issue.
> >>
> >> Looks the patch is used to fixing a potential system crashing.
> >> We're not sure whether this WARNING is as expected and reasonable
> >> or a BUG because there's no such WARNING before this patch.
> >>
> >> Can someone explain about it?
> > The warning happens because bdi disappeared from under filesystem (likely
> > it was even freed) but filesystem still has references to it. Previously,
> > we were just silenly using freed memory, now we warn about it because we
> > now clear the BDI_registered bit before freeing the bdi.
> >
> > So for now the best advice I can give you is: Don't remove device from
> > under mounted filesystem (even when the system is suspended). I may easily
> > crash your machine.
>
> When you are dealing with removable devices, we can't protect us
> against such scenarios.
Yes, I understand. I agree it's a kernel bug to not deal with the hot
remove properly. It's just not simple to fix.
> Moreover, during system suspend phase the mmc block device are not
> being removed (even if the physical mmc card gets removed). Instead
> that will be handled first when a PM_POST_SUSPEND|HIBERNATION|RESTORE
> notifier is received by the mmc subsystem.
Yeah, but for the filesystem on top it doesn't really matter. Filesystems
simply don't expect underlying structures can disappear. Changing all
filesystems to deal with that would be too difficult so we have to make bdi
stay in memory as needed and just detach it from the device (request queue)
which goes away.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2014-12-04 14:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-04 3:43 WARNING: at fs/fs-writeback.c when plug out SD card after system suspend/resume Dong Aisheng
2014-12-04 12:41 ` Jan Kara
2014-12-04 13:09 ` Christoph Hellwig
2014-12-04 13:36 ` Ulf Hansson
2014-12-04 14:08 ` Jan Kara [this message]
2014-12-04 14:16 ` Tejun Heo
2014-12-04 14:31 ` Jan Kara
2014-12-05 2:54 ` Dong Aisheng
-- strict thread matches above, loose matches on Subject: below --
2014-12-04 3:46 Dong Aisheng
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=20141204140835.GA15108@quack.suse.cz \
--to=jack@suse.cz \
--cc=b29396@freescale.com \
--cc=dongas86@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.or \
--cc=r64343@freescale.com \
--cc=tj@kernel.org \
--cc=ulf.hansson@linaro.org \
--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).