linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* btrfs device returned from stat vs /proc/pid/maps
@ 2011-03-21 21:55 Mark Fasheh
  0 siblings, 0 replies; only message in thread
From: Mark Fasheh @ 2011-03-21 21:55 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Chris Mason

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-21 21:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21 21:55 btrfs device returned from stat vs /proc/pid/maps Mark Fasheh

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).