Commit 01b172b7b10146cf5f02604047bee065cfb49946
Committed by
Steven Whitehouse
1 parent
48f8f711ed
Exists in
master
and in
13 other branches
GFS2: Ensure workqueue is scheduled after noexp request
This patch closes a small timing window whereby a request to hold the transaction glock can get stuck. The problem is that after the DLM has granted the lock, it can get into a state whereby it doesn't transition the glock to a held state, due to not having requeued the glock state machine to finish the transition. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Showing 1 changed file with 6 additions and 2 deletions Side-by-side Diff
fs/gfs2/glock.c
... | ... | @@ -1047,9 +1047,13 @@ |
1047 | 1047 | |
1048 | 1048 | spin_lock(&gl->gl_spin); |
1049 | 1049 | add_to_queue(gh); |
1050 | - if ((LM_FLAG_NOEXP & gh->gh_flags) && | |
1051 | - test_and_clear_bit(GLF_FROZEN, &gl->gl_flags)) | |
1050 | + if (unlikely((LM_FLAG_NOEXP & gh->gh_flags) && | |
1051 | + test_and_clear_bit(GLF_FROZEN, &gl->gl_flags))) { | |
1052 | 1052 | set_bit(GLF_REPLY_PENDING, &gl->gl_flags); |
1053 | + gl->gl_lockref.count++; | |
1054 | + if (queue_delayed_work(glock_workqueue, &gl->gl_work, 0) == 0) | |
1055 | + gl->gl_lockref.count--; | |
1056 | + } | |
1053 | 1057 | run_queue(gl, 1); |
1054 | 1058 | spin_unlock(&gl->gl_spin); |
1055 | 1059 |