From: Mark Fasheh <mfasheh@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: Chris Mason <chris.mason@oracle.com>
Subject: btrfs device returned from stat vs /proc/pid/maps
Date: Mon, 21 Mar 2011 14:55:08 -0700 [thread overview]
Message-ID: <20110321215508.GN1703@wotan.suse.de> (raw)
Hi,
I noticed that btrfs_getattr() is filling stat->dev with an anonymous device
(for per-snapshot root?):
stat->dev = BTRFS_I(inode)->root->anon_super.s_dev;
but /proc/pid/maps uses the "real" block device:
dev = inode->i_sb->s_dev;
This results in some unfortunate behavior for lsof as it reports some
duplicate paths (except on different block devices). The easiest way to see
this (if your root partition is btrfs):
$ lsof | grep lsof
<snip>
lsof 9238 root txt REG 0,19 139736 14478 /usr/bin/lsof
lsof 9238 root mem REG 0,17 14478 /usr/bin/lsof (path dev=0,19)
Ultimately, this breaks existing software. In my case, "zypper ps" gets
really unhappy (which may partially also be due to a zypper bug, hooray!)
I'm not really quite sure how this should be handled though. Do we have
/proc/pid/maps report the subvolumes device (via some callback I suppose)?
Another alternative of course is to return the true block device in
btrfs_getattr() but that has some obvious downsides too.
Thanks and best regards,
--Mark
--
Mark Fasheh
reply other threads:[~2011-03-21 21:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20110321215508.GN1703@wotan.suse.de \
--to=mfasheh@suse.com \
--cc=chris.mason@oracle.com \
--cc=linux-btrfs@vger.kernel.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).