Btrfs: btrfs_ioctl_default_subvol: Revert back to toplevel subvolume when arg is 0
authorchandan <chandan@linux.vnet.ibm.com>
Fri, 13 Sep 2013 14:04:10 +0000 (19:34 +0530)
committerChris Mason <chris.mason@fusionio.com>
Sat, 21 Sep 2013 15:05:29 +0000 (11:05 -0400)
This patch makes it possible to set BTRFS_FS_TREE_OBJECTID as the default
subvolume by passing a subvolume id of 0.

Signed-off-by: chandan <chandan@linux.vnet.ibm.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/ioctl.c

index fd6557e7118a6774e81f17cca6a97b3ef8604287..fba259ab99941e429fa7c5f55fc3a42229778efa 100644 (file)
@@ -3310,7 +3310,7 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
        }
 
        if (!objectid)
-               objectid = root->root_key.objectid;
+               objectid = BTRFS_FS_TREE_OBJECTID;
 
        location.objectid = objectid;
        location.type = BTRFS_ROOT_ITEM_KEY;