btrfs: sysfs: check initialization state before updating features
David Sterba
maintainerPATCH 1/1 btrfs: sysfs: check initialization state before updating features
If the mount phase is not finished, we can't update the sysfs files.
--- fs/btrfs/sysfs.c | 3 +++ 1 file changed, 3 insertions(+)
fs/btrfs/sysfs.c +3 -0
@@ -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.
Signature · 1 line
1.8.4.5
Quoted 13 lines · David Sterba
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]>--- fs/btrfs/sysfs.c | 3 +++ 1 file changed, 3 insertions(+)fs/btrfs/sysfs.c +0
-0
fs/btrfs/sysfs.c void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info, · line 809
Quoted 6 lines
fs/btrfs/sysfs.c +3
-0@@ -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 ; +
uhm..
fs/btrfs/sysfs.c: In function 'btrfs_sysfs_feature_update':fs/btrfs/sysfs.c:807:16: error: request for member 'state_initialized' in something not a structure or union
if (!fsid_kobj.state_initialized)
^
I think this should be fsid_kobj->state_initialized, no?
-h
Quoted 23 lines · Holger Hoffstätte
Quoted 13 lines · David Sterba
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]>--- fs/btrfs/sysfs.c | 3 +++ 1 file changed, 3 insertions(+)fs/btrfs/sysfs.c +0
-0fs/btrfs/sysfs.c void btrfs_sysfs_feature_update(struct btrfs_fs_info *fs_info, · line 809
Quoted 6 lines
fs/btrfs/sysfs.c +3
-0@@ -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 ; +uhm..
Quoted 7 lines
fs/btrfs/sysfs.c: In function 'btrfs_sysfs_feature_update':fs/btrfs/sysfs.c:807:16: error: request for member 'state_initialized' in something not a structure or union
if (!fsid_kobj.state_initialized)^I think this should be
fsid_kobj->state_initialized, no?
Of course. What I've tested was
if (!fs_devs->fsid_kobj.state_initialized)
and removed the "fs_devs->" but did not recompile.
David Sterba
maintainerPATCH v2 1/1 btrfs: sysfs: check initialization state before updating features
In reply to David SterbaIf the mount phase is not finished, we can't update the sysfs files.
---
v2: fix compilation error
fs/btrfs/sysfs.c | 3 +++ 1 file changed, 3 insertions(+)
fs/btrfs/sysfs.c +3 -0
@@ -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.
Signature · 1 line
1.8.4.5
Quoted 6 lines · David Sterba
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]>---
v2: fix compilation error
Thanks Dave, pushed into integration-4.5
-chris