summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorDavid Sterba2016-01-21 18:54:41 +0100
committerDavid Sterba2016-01-21 18:54:41 +0100
commit14e46e04958df740c6c6a94849f176159a333f13 (patch)
tree79a2d0a4255c3555175ca3803fb9c9a6b6c8ea1a /fs/btrfs/ioctl.c
parentbtrfs: sysfs: introduce helper for syncing bits with sysfs files (diff)
downloadkernel-qcow2-linux-14e46e04958df740c6c6a94849f176159a333f13.tar.gz
kernel-qcow2-linux-14e46e04958df740c6c6a94849f176159a333f13.tar.xz
kernel-qcow2-linux-14e46e04958df740c6c6a94849f176159a333f13.zip
btrfs: synchronize incompat feature bits with sysfs files
The files under /sys/fs/UUID/features get out of sync with the actual incompat bits set for the filesystem if they change after mount (eg. the LZO compression). Synchronize the feature bits with the sysfs files representing them right after we set/clear them. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index e392dd67f0ba..209dcfa9ab33 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1455,6 +1455,8 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
if (range->compress_type == BTRFS_COMPRESS_LZO) {
btrfs_set_fs_incompat(root->fs_info, COMPRESS_LZO);
+ btrfs_sysfs_feature_update(root->fs_info,
+ BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO, FEAT_INCOMPAT);
}
ret = defrag_count;
@@ -4063,6 +4065,8 @@ static long btrfs_ioctl_default_subvol(struct file *file, void __user *argp)
btrfs_free_path(path);
btrfs_set_fs_incompat(root->fs_info, DEFAULT_SUBVOL);
+ btrfs_sysfs_feature_update(root->fs_info,
+ BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL, FEAT_INCOMPAT);
btrfs_end_transaction(trans, root);
out:
mnt_drop_write_file(file);