diff options
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 8f23a94dab77..2009cea65d89 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -3116,8 +3116,11 @@ out_wake_log_root: | |||
3116 | mutex_unlock(&log_root_tree->log_mutex); | 3116 | mutex_unlock(&log_root_tree->log_mutex); |
3117 | 3117 | ||
3118 | /* | 3118 | /* |
3119 | * The barrier before waitqueue_active is implied by mutex_unlock | 3119 | * The barrier before waitqueue_active is needed so all the updates |
3120 | * above are seen by the woken threads. It might not be necessary, but | ||
3121 | * proving that seems to be hard. | ||
3120 | */ | 3122 | */ |
3123 | smp_mb(); | ||
3121 | if (waitqueue_active(&log_root_tree->log_commit_wait[index2])) | 3124 | if (waitqueue_active(&log_root_tree->log_commit_wait[index2])) |
3122 | wake_up(&log_root_tree->log_commit_wait[index2]); | 3125 | wake_up(&log_root_tree->log_commit_wait[index2]); |
3123 | out: | 3126 | out: |
@@ -3128,8 +3131,11 @@ out: | |||
3128 | mutex_unlock(&root->log_mutex); | 3131 | mutex_unlock(&root->log_mutex); |
3129 | 3132 | ||
3130 | /* | 3133 | /* |
3131 | * The barrier before waitqueue_active is implied by mutex_unlock | 3134 | * The barrier before waitqueue_active is needed so all the updates |
3135 | * above are seen by the woken threads. It might not be necessary, but | ||
3136 | * proving that seems to be hard. | ||
3132 | */ | 3137 | */ |
3138 | smp_mb(); | ||
3133 | if (waitqueue_active(&root->log_commit_wait[index1])) | 3139 | if (waitqueue_active(&root->log_commit_wait[index1])) |
3134 | wake_up(&root->log_commit_wait[index1]); | 3140 | wake_up(&root->log_commit_wait[index1]); |
3135 | return ret; | 3141 | return ret; |