diff options
author | Hugh Dickins <hugh@veritas.com> | 2007-03-06 14:20:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-06 20:59:14 -0500 |
commit | 266d4f40370757459f8aa063976c932d0de5e59b (patch) | |
tree | 315f882e2325b1485b55e0c2c029fb7e4173786f /fs | |
parent | 7c368bb1049bde17fc4f8655492478d7f2918da9 (diff) |
[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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/sysfs/inode.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index dd1344b007f5..ccb7d722c558 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -227,11 +227,8 @@ static inline void orphan_all_buffers(struct inode *node) | |||
227 | 227 | ||
228 | mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); | 228 | mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); |
229 | if (node->i_private) { | 229 | if (node->i_private) { |
230 | list_for_each_entry(buf, &set->associates, associates) { | 230 | list_for_each_entry(buf, &set->associates, associates) |
231 | down(&buf->sem); | ||
232 | buf->orphaned = 1; | 231 | buf->orphaned = 1; |
233 | up(&buf->sem); | ||
234 | } | ||
235 | } | 232 | } |
236 | mutex_unlock(&node->i_mutex); | 233 | mutex_unlock(&node->i_mutex); |
237 | } | 234 | } |