Skip to content

Commit

Permalink
btrfs: sysfs: check initialization state before updating features
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
kdave authored and masoncl committed Jan 27, 2016
1 parent 80ad623 commit bf60920
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/btrfs/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,9 @@ void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info,
fs_devs = fs_info->fs_devices;
fsid_kobj = &fs_devs->fsid_kobj;

if (!fsid_kobj->state_initialized)
return;

/*
* FIXME: this is too heavy to update just one value, ideally we'd like
* to use sysfs_update_group but some refactoring is needed first.
Expand Down

0 comments on commit bf60920

Please sign in to comment.