diff options
author | Benjamin Marzinski <bmarzins@redhat.com> | 2009-03-06 11:03:20 -0500 |
---|---|---|
committer | Steven Whitehouse <steve@dolmen.chygwyn.com> | 2009-03-24 07:21:26 -0400 |
commit | 02ffad08e838997fad3de05c85560a57e5fd92de (patch) | |
tree | feee17b1848957b1b42047ae6c4156d716adf4e8 /fs/gfs2/incore.h | |
parent | 229615def3f573fc448d20f62c6ec1bc9340cefb (diff) |
GFS2: Fix locking bug in failed shared to exclusive conversion
After calling out to the dlm, GFS2 sets the new state of a glock to
gl_target in gdlm_ast(). However, gl_target is not always the lock
state that was requested. If a conversion from shared to exclusive
fails, finish_xmote() will call do_xmote() with LM_ST_UNLOCKED, instead
of gl->gl_target, so that it can reacquire the lock in exlusive the next
time around. In this case, setting the lock to gl_target in gdlm_ast()
will make GFS2 think that it has the glock in exclusive mode, when
really, it doesn't have the glock locked at all. This patch adds a new
field to the gfs2_glock structure, gl_req, to track the mode that was
requested.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/incore.h')
-rw-r--r-- | fs/gfs2/incore.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/gfs2/incore.h b/fs/gfs2/incore.h index 980a0864ca6c..399d1b978049 100644 --- a/fs/gfs2/incore.h +++ b/fs/gfs2/incore.h | |||
@@ -203,6 +203,7 @@ struct gfs2_glock { | |||
203 | unsigned int gl_target; | 203 | unsigned int gl_target; |
204 | unsigned int gl_reply; | 204 | unsigned int gl_reply; |
205 | unsigned int gl_hash; | 205 | unsigned int gl_hash; |
206 | unsigned int gl_req; | ||
206 | unsigned int gl_demote_state; /* state requested by remote node */ | 207 | unsigned int gl_demote_state; /* state requested by remote node */ |
207 | unsigned long gl_demote_time; /* time of first demote request */ | 208 | unsigned long gl_demote_time; /* time of first demote request */ |
208 | struct list_head gl_holders; | 209 | struct list_head gl_holders; |