@@ -371,7 +371,10 @@ struct btrfs_super_block {
*/
#define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0)
-#define BTRFS_FEATURE_COMPAT_SUPP 0ULL
+#define BTRFS_FEATURE_COMPAT_DEFAULT_SUBVOL (1ULL << 0)
+
+#define BTRFS_FEATURE_COMPAT_SUPP \
+ BTRFS_FEATURE_COMPAT_DEFAULT_SUBVOL
#define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL
#define BTRFS_FEATURE_INCOMPAT_SUPP \
BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF
@@ -1563,6 +1563,8 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
struct btrfs_path *path;
struct btrfs_key location;
struct btrfs_disk_key disk_key;
+ struct btrfs_super_block *disk_super;
+ u64 features;
u64 objectid = 0;
u64 dir_id;
@@ -1610,6 +1612,12 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
btrfs_mark_buffer_dirty(path->nodes[0]);
btrfs_free_path(path);
+ disk_super = &root->fs_info->super_copy;
+ features = btrfs_super_compat_flags(disk_super);
+ if (!(features & BTRFS_FEATURE_COMPAT_DEFAULT_SUBVOL)) {
+ features |= BTRFS_FEATURE_COMPAT_DEFAULT_SUBVOL;
+ btrfs_set_super_compat_flags(disk_super, features);
+ }
btrfs_end_transaction(trans, root);
return 0;