From: Oliver Neukum Date: Wed, 20 Dec 2006 09:52:44 +0000 (+0100) Subject: Driver core: fix race in sysfs between sysfs_remove_file() and read()/write() X-Git-Tag: v2.6.21-rc1~92^2~30^2~11 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94bebf4d1b8e7719f0f3944c037a21cfd99a4af7;p=pandora-kernel.git Driver core: fix race in sysfs between sysfs_remove_file() and read()/write() This patch prevents a race between IO and removing a file from sysfs. It introduces a list of sysfs_buffers associated with a file at the inode. Upon removal of a file the list is walked and the buffers marked orphaned. IO to orphaned buffers fails with -ENODEV. The driver can safely free associated data structures or be unloaded. Signed-off-by: Oliver Neukum Acked-by: Maneesh Soni Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed