linux-btrfs.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: Linux Fsdevel <linux-fsdevel@vger.kernel.org>,
	Linux Btrfs <linux-btrfs@vger.kernel.org>,
	Chris Mason <chris.mason@oracle.com>
Subject: Re: [PATCH 2/2] Btrfs: fix wrong the mount information in /proc
Date: Thu, 31 May 2012 16:53:04 +0100	[thread overview]
Message-ID: <20120531155304.GF11775@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20120531143605.GE11775@ZenIV.linux.org.uk>

On Thu, May 31, 2012 at 03:36:05PM +0100, Al Viro wrote:
> On Thu, May 31, 2012 at 06:25:14PM +0800, Miao Xie wrote:
> > +#include "../mount.h"
> 
> No.
> 
> > +	struct mount *r = real_mount(mnt);
> 
> And even more so.  Find a way to do that without layering violations or
> live with the current behaviour.
> 
> Both patches NAKed with extreme prejudice.  Don't bring them back, you
> are *not* going to get them in.  Any filesystem code that wants to do
> that kind of thing is seriously out of luck.

BTW, resulting behaviour is bogus, regardless of layering violations  -
note that device_list_add() renames existing btrfs_device.  *And* does so
without holding ->device_list_mutex, so your patch would've cheerfully
walked right into strcmp() vs. kfree() races.  And while the order of
kfree vs. reassignment in device_list_add() is clearly wrong, flipping it
won't fix that problem.

Try to formulate the rules for names you are generating - when do they
change, what can we say about two mounts by comparing these names,
when can two that used to give different names start giving the same
and vice versa.  You won't be happy with the result.

  reply	other threads:[~2012-05-31 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 10:25 [PATCH 2/2] Btrfs: fix wrong the mount information in /proc Miao Xie
2012-05-31 14:36 ` Al Viro
2012-05-31 15:53   ` Al Viro [this message]
2012-05-31 18:15     ` Josef Bacik

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=20120531155304.GF11775@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).