rfkill: sync before userspace visibility/changes
authorJohannes Berg <johannes.berg@intel.com>
Thu, 14 Sep 2023 13:45:17 +0000 (15:45 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 18 Sep 2023 07:36:57 +0000 (09:36 +0200)
commit2c3dfba4cf84ac4f306cc6653b37b6dd6859ae9d
treed2fef1e758292fcf1a28c9f00aa47908db5d1165
parent6e48ebffc2db5419b3a51cfc509bde442252b356
rfkill: sync before userspace visibility/changes

If userspace quickly opens /dev/rfkill after a new
instance was created, it might see the old state of
the instance from before the sync work runs and may
even _change_ the state, only to have the sync work
change it again.

Fix this by doing the sync inline where needed, not
just for /dev/rfkill but also for sysfs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/rfkill/core.c