提交 266d4f40 编写于 作者: H Hugh Dickins 提交者: Linus Torvalds

[PATCH] suspend regression: sysfs deadlock

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

This comes from Oliver's commit 94bebf4d
"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: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7c368bb1
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册