Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] suspend regression: sysfs deadlock

Suspend deadlocks when trying to unregister /sys/block/sr0.

This comes from Oliver's commit 94bebf4d1b8e7719f0f3944c037a21cfd99a4af7
"Driver core: fix race in sysfs between sysfs_remove_file() and
read()/write()".

sysfs_write_file downs buffer->sem while calling flush_write_buffer, and
flushing that particular write buffer entails downing buffer->sem in
orphan_all_buffers, resulting in the obvious self-deadlock.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
266d4f40 7c368bb1

+1 -4
+1 -4
fs/sysfs/inode.c
··· 227 227 228 228 mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); 229 229 if (node->i_private) { 230 - list_for_each_entry(buf, &set->associates, associates) { 231 - down(&buf->sem); 230 + list_for_each_entry(buf, &set->associates, associates) 232 231 buf->orphaned = 1; 233 - up(&buf->sem); 234 - } 235 232 } 236 233 mutex_unlock(&node->i_mutex); 237 234 }