From c83e5a977a2510de872d48a4d3bebc94dac0ed8f Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Fri, 13 May 2011 16:01:39 -0700 Subject: [PATCH 2/2] btrfs: Introduce btrfs_get_maps_dev() References: bnc#672923 Patch-mainline: Never Use this to return the subvolume superblock in proc instead of the global superblock which is automatically taken today. This fixes a userspace breakage where discrepancies between the devices two would confuse software such as lsof. Signed-off-by: Mark Fasheh --- fs/btrfs/super.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1301,6 +1301,11 @@ static void btrfs_fs_dirty_inode(struct "error %d\n", btrfs_ino(inode), ret); } +static dev_t btrfs_get_maps_dev(struct inode *inode) +{ + return BTRFS_I(inode)->root->anon_dev; +} + static const struct super_operations btrfs_super_ops = { .drop_inode = btrfs_drop_inode, .evict_inode = btrfs_evict_inode, @@ -1315,6 +1320,7 @@ static const struct super_operations btr .remount_fs = btrfs_remount, .freeze_fs = btrfs_freeze, .unfreeze_fs = btrfs_unfreeze, + .get_maps_dev = btrfs_get_maps_dev, }; static const struct file_operations btrfs_ctl_fops = {