Skip to content

Commit bf60920

Browse files
kdavemasoncl
authored andcommitted
btrfs: sysfs: check initialization state before updating features
If the mount phase is not finished, we can't update the sysfs files. Reported-by: Chris Mason <[email protected]> Signed-off-by: David Sterba <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 80ad623 commit bf60920

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/btrfs/sysfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,9 @@ void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
804804
fs_devs = fs_info->fs_devices;
805805
fsid_kobj = &fs_devs->fsid_kobj;
806806

807+
if (!fsid_kobj->state_initialized)
808+
return;
809+
807810
/*
808811
* FIXME: this is too heavy to update just one value, ideally we'd like
809812
* to use sysfs_update_group but some refactoring is needed first.

0 commit comments

Comments
 (0)