aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-01-21 12:54:41 -0500
committerDavid Sterba <dsterba@suse.com>2016-01-21 12:54:41 -0500
commit14e46e04958df740c6c6a94849f176159a333f13 (patch)
tree79a2d0a4255c3555175ca3803fb9c9a6b6c8ea1a /fs/btrfs/super.c
parent444e75169872f668eb890f19ec1f32dfc632e704 (diff)
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/super.c')
-rw-r--r--fs/btrfs/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 86f7fdc05633..5a1bab11984d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -58,6 +58,7 @@
58#include "dev-replace.h" 58#include "dev-replace.h"
59#include "free-space-cache.h" 59#include "free-space-cache.h"
60#include "backref.h" 60#include "backref.h"
61#include "sysfs.h"
61#include "tests/btrfs-tests.h" 62#include "tests/btrfs-tests.h"
62 63
63#include "qgroup.h" 64#include "qgroup.h"
@@ -477,6 +478,9 @@ int btrfs_parse_options(struct btrfs_root *root, char *options)
477 btrfs_clear_opt(info->mount_opt, NODATACOW); 478 btrfs_clear_opt(info->mount_opt, NODATACOW);
478 btrfs_clear_opt(info->mount_opt, NODATASUM); 479 btrfs_clear_opt(info->mount_opt, NODATASUM);
479 btrfs_set_fs_incompat(info, COMPRESS_LZO); 480 btrfs_set_fs_incompat(info, COMPRESS_LZO);
481 btrfs_sysfs_feature_update(root->fs_info,
482 BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO,
483 FEAT_INCOMPAT);
480 } else if (strncmp(args[0].from, "no", 2) == 0) { 484 } else if (strncmp(args[0].from, "no", 2) == 0) {
481 compress_type = "no"; 485 compress_type = "no";
482 btrfs_clear_opt(info->mount_opt, COMPRESS); 486 btrfs_clear_opt(info->mount_opt, COMPRESS);