All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/2] btrfs/vfs: Return same device in stat(2) and /proc/pid/maps
@ 2011-05-13 23:18 Mark Fasheh
  2011-05-13 23:18 ` [RFC][PATCH 1/2] vfs: allow /proc/pid/maps to return a custom device Mark Fasheh
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Fasheh @ 2011-05-13 23:18 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Chris Mason, linux-fsdevel

I originally posted about this issue some weeks ago but unfortunately didn't
get a response:

http://comments.gmane.org/gmane.comp.file-systems.btrfs/9682


To recap:

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)


As was noted in my original mail, this winds up breaking userspace software
(zypper in my case).

The following patch series fixes this issue by allowing a file
system to supply a custom method for the device reported in /proc/pid/maps.
It fixes the issue for me, but I'm not 100% sold on the approach taken -
it's an admittedly brute-force solution hence the RFC tag. Any comments are
appreciated and welcome.

Thanks,
	--Mark


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-07 18:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-13 23:18 [RFC][PATCH 0/2] btrfs/vfs: Return same device in stat(2) and /proc/pid/maps Mark Fasheh
2011-05-13 23:18 ` [RFC][PATCH 1/2] vfs: allow /proc/pid/maps to return a custom device Mark Fasheh
2011-05-15  3:06   ` Eric W. Biederman
2011-05-19 20:18     ` Mark Fasheh
2011-10-07 18:32       ` Mark Fasheh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.