]> Git Repo - linux.git/commit
bcachefs: Fix sysfs warning in fstests generic/730,731
authorKent Overstreet <[email protected]>
Sat, 12 Oct 2024 18:36:38 +0000 (14:36 -0400)
committerKent Overstreet <[email protected]>
Mon, 14 Oct 2024 09:43:01 +0000 (05:43 -0400)
commit5e3b72324d32629fa013f86657308f3dbc1115e1
tree66d1d167a942aef22a89cfa0df092d1a593f663d
parentcb6055e66faa0d4c15587ef67be18bc199aef085
bcachefs: Fix sysfs warning in fstests generic/730,731

sysfs warns if we're removing a symlink from a directory that's no
longer in sysfs; this is triggered by fstests generic/730, which
simulates hot removal of a block device.

This patch is however not a correct fix, since checking
kobj->state_in_sysfs on a kobj owned by another subsystem is racy.

A better fix would be to add the appropriate check to
sysfs_remove_link() - and sysfs_create_link() as well.

But kobject_add_internal()/kobject_del() do not as of today have locking
that would support that.

Note that the block/holder.c code appears to be subject to this race as
well.

Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
fs/bcachefs/super.c
This page took 0.053175 seconds and 4 git commands to generate.