linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Fasheh <mfasheh@suse.de>
To: dsterba@suse.cz, Andrew Vagin <avagin@gmail.com>,
	Chris Mason <chris.mason@oracle.com>,
	linux-btrfs@vger.kernel.org, kzak@redhat.com, xemul@openvz.org
Subject: Re: btrfs: stat(2) and /proc/pid/maps returns different devices
Date: Wed, 10 Jul 2013 09:31:05 -0700	[thread overview]
Message-ID: <20130710163105.GR32502@wotan.suse.de> (raw)
In-Reply-To: <20130708215446.GH18204@twin.jikos.cz>

On Mon, Jul 08, 2013 at 11:54:46PM +0200, David Sterba wrote:
> On Thu, Jul 04, 2013 at 01:51:38PM +0400, Andrew Vagin wrote:
> > We are not first who suffer from this problem:
> > https://bugzilla.redhat.com/show_bug.cgi?id=711881
> > http://marc.info/?l=linux-btrfs&m=130074451403261
> > https://bugzilla.openvz.org/show_bug.cgi?id=2653
> 
> > And about 2 years ago Mark Fasheh tried to fix this problem:
> > http://thr3ads.net/btrfs-devel/2011/05/2346176-RFC-PATCH-0-2-btrfs-vfs-Return-same-device-in-stat-2-and-proc-pid-maps

And basically nobody cared :/


> > Eric Biederman sugested to not create a new method and use vfs_getattr,
> > but here is a few problems:
> > * fanotify doesn't have dentry, but its fdinfo contains device.
> > * vfs_getattr can fail and which device should be shown in this case?
> > * vfs_getattr gets much more parameters, so here is a question about
> >   performance degradation.
> > 
> > So I have a question: Can two inodes from different subvolumes have
> > equal inode numbers?
> 
> Yes, subvolumes are separate inode number spaces.
> 
> > If someone have any suggestions how to fix this problem or any
> > explanation why this is not a problem at all, please write here.
> 
> The xstat syscall instead of the potentially heavyweight vfs_getattr
> could fix that, but it's not merged. For suse kernels we've taken the
> hackish approach of patching fs/proc/task_mmu.c:show_map_vma() (and the
> nommu variant) and use vfs_getattr only for btrfs.
> 
> http://kernel.opensuse.org/cgit/kernel-source/tree/patches.suse/btrfs-use-correct-device-for-maps.patch?id=2434fa6ee93a83b117461eb13f24272606677fec
> 
> Only a temporary and not upstreamable solution, but without it the core
> packaging tool zypper would not work correctly.

As far as I can tell we'll be carrying this patch until a better
solution is possible.

When that will happen, I don't know.
	--Mark

--
Mark Fasheh

  reply	other threads:[~2013-07-10 16:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-04  9:51 btrfs: stat(2) and /proc/pid/maps returns different devices Andrew Vagin
2013-07-05  8:06 ` Andrey Wagin
2013-07-08 21:54 ` David Sterba
2013-07-10 16:31   ` Mark Fasheh [this message]
2013-07-10 17:45     ` Mark Fasheh
2013-07-10 22:26       ` David Sterba
2013-07-19 20:51         ` Mark Fasheh
2013-07-31 18:24           ` David Sterba
2013-10-24 10:41           ` Pavel Emelyanov
2013-07-11 21:25       ` Andrew Vagin

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=20130710163105.GR32502@wotan.suse.de \
    --to=mfasheh@suse.de \
    --cc=avagin@gmail.com \
    --cc=chris.mason@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=kzak@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=xemul@openvz.org \
    /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).