mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Mark Lord <lkml@rtr.ca>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Chuck Ebbert <cebbert@redhat.com>,
	Stephen Tweedie <sct@redhat.com>, "Theodore Ts'o" <tytso@mit.edu>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: ext3fs: umount+sync not enough to guarantee metadata-on-disk
Date: Tue, 12 Jun 2007 12:00:57 +0200	[thread overview]
Message-ID: <20070612100057.GB6590@duck.suse.cz> (raw)
In-Reply-To: <466DD0E9.1060506@rtr.ca>

On Mon 11-06-07 18:47:05, Mark Lord wrote:
> Jan Kara wrote:
> >>Andrew Morton wrote:
> >>>On Thu, 07 Jun 2007 12:11:58 -0400
> >>>Chuck Ebbert <cebbert@redhat.com> wrote:
> >>>
> >>>>On 06/07/2007 11:41 AM, Andrew Morton wrote:
> >>>>>>  mount /var/lib/mythtv -oremount,ro
> >>>>>>  sync
> >>>>>>  umount /var/lib/mythtv
> >>>>>Did this succeed?  If the application is still truncating that file, 
> >>>>>the
> >>>>>umount should have failed.
> >>>>Shouldn't sync should wait for truncate to finish?
> >>>I can't think of anything in there at present which would cause that to
> >>>happen, and it's not immediately obvious how we _could_ make it happen - 
> >>>we
> >>>have an inode which potentially has no dirty pages and which is itself
> >>>clean.  The truncate can span multiple journal commits, so forcing a
> >>>journal commit in sync() won't necessarily block behind the truncate.
> >>>
> >>>I guess we could ask sync to speculatively take and release every inode's
> >>>i_mutex or something.  But even that would involve quite some 
> >>>hoop-jumping
> >>>due to those infuriating spinlock-protected list_heads on the superblock.
> >>>
> >>>hmm.
> >>Okay, I added more instrumentation and retested today.
> >>
> >>Good and Bad.
> >>The umount does indeed fail while the massive unlink is happening,
> >>so I can just loop on that a few times before giving up.
> >>
> >>But.. the earlier "remount,ro".. well.. I don't know what it does.
> >>I did get it to lock up solid, though.. hung on the "remount,ro"
> >>when issued during an unlink of a 15GB file.  The disk I/O eventually
> >>completes, and drives go idle, but the system remains hung inside
> >>the remount,ro call.
> >>
> >>Alt-sysrq-T was functioning, so I have some screen shots (.jpg) here:
> >>
> >> http://rtr.ca/remount_ro/
> >  Thanks for the traces.
> >
> >>That's definitely a bug.
> >  Yes. We have a nice lock inversion there. ext3_remount() is called
> >with sb->s_lock held and waits for transaction to finish in
> >journal_lock_updates(). On the other hand ext3_orphan_del() is called
> >inside a transaction and tries to do lock_super()... Bad luck.
> 
> Peachy.  Do you have enough knowledge here to generate a fix for this?
> Maybe just have the remount break out, releasing all locks, and then 
> loop and retry (or return -EBUSY?) when this happens?
  Yes, I'll try to cook up some patch. As I'm looking through the code,
ext3_remount seems to be the only place where we need to start a
transaction under s_lock. So probably we could release sb->s_lock for
the time we have to wait for a transaction...

								Honza
-- 
Jan Kara <jack@suse.cz>
SuSE CR Labs

  reply	other threads:[~2007-06-12  9:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-07 13:44 Mark Lord
2007-06-07 15:41 ` Andrew Morton
2007-06-07 16:01   ` Mark Lord
2007-06-07 17:09     ` Stephen C. Tweedie
2007-06-10 18:27     ` Pavel Machek
2007-06-12 15:15       ` Stephen C. Tweedie
2007-06-14 19:01       ` Phillip Susi
2007-06-07 16:11   ` Chuck Ebbert
2007-06-07 19:45     ` Andrew Morton
2007-06-07 21:38       ` Mark Lord
2007-06-07 22:04         ` Andrew Morton
2007-06-08 14:51           ` Mark Lord
2007-06-09  2:58       ` Mark Lord
2007-06-11 11:14         ` Jan Kara
2007-06-11 22:47           ` Mark Lord
2007-06-12 10:00             ` Jan Kara [this message]
2007-06-07 21:43     ` Mark Lord
2007-06-10 18:31       ` Pavel Machek
2007-06-11 11:05       ` Jan Kara
2007-06-11 22:46         ` Mark Lord

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=20070612100057.GB6590@duck.suse.cz \
    --to=jack@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=cebbert@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@rtr.ca \
    --cc=sct@redhat.com \
    --cc=tytso@mit.edu \
    /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

all inboxes | Powered by JetHome®