Skip to content

Commit

Permalink
[PATCH] suspend regression: sysfs deadlock
Browse files Browse the repository at this point in the history
Suspend deadlocks when trying to unregister /sys/block/sr0.

This comes from Oliver's commit 94bebf4
"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>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Mar 7, 2007
1 parent 7c368bb commit 266d4f4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/sysfs/inode.c
Expand Up @@ -227,11 +227,8 @@ static inline void orphan_all_buffers(struct inode *node)

mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD);
if (node->i_private) {
list_for_each_entry(buf, &set->associates, associates) {
down(&buf->sem);
list_for_each_entry(buf, &set->associates, associates)
buf->orphaned = 1;
up(&buf->sem);
}
}
mutex_unlock(&node->i_mutex);
}
Expand Down

0 comments on commit 266d4f4

Please sign in to comment.