linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Miao Xie <miaox@cn.fujitsu.com>
Cc: Chris Mason <chris.mason@oracle.com>,
	Linux Fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] vfs: add an interface to do some preparation for umount
Date: Thu, 22 Mar 2012 03:41:09 +0000	[thread overview]
Message-ID: <20120322034109.GU6589@ZenIV.linux.org.uk> (raw)
In-Reply-To: <4F6A98CB.1070308@cn.fujitsu.com>

On Thu, Mar 22, 2012 at 11:13:15AM +0800, Miao Xie wrote:
> Some file systems can do some works in the background by kthreads, we'd
> better stop those works before we umount the file system, or it is easy to
> introduce some problems. So we add an interface that is used to do some
> preparation for umount.

NAK.  First of all, fs might be in active use _after_ umount.  man 8 umount,
see umount -l there.  Moreover, the same superblock may very well be mounted
more than once, so umount of an individual mountpoint would better not do
anything nasty to users of other ones.

IOW, this is completely misguided - you are dealing with whatever problem it
is at least two layers above the right one.

1) vfsmount may be detached from mount trees but remain in active use.
2) there may be many vfsmounts over given struct super_block.

Doing things earlier than the final mntput() runs afoul of (1); doing
them before the final deactivate_locked_super() runs afoul of (2).

What the hell is that thread doing that needs ->s_umount for serialization
and why is it doing that?

  reply	other threads:[~2012-03-22  3:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22  3:13 [RFC PATCH 1/2] vfs: add an interface to do some preparation for umount Miao Xie
2012-03-22  3:41 ` Al Viro [this message]
2012-03-22  5:07   ` Miao Xie

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=20120322034109.GU6589@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=miaox@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).