diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/gfs2/glock.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index fca6a873dcf3..e6c2fd53cab2 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c | |||
@@ -954,7 +954,7 @@ __acquires(&gl->gl_spin) | |||
954 | struct gfs2_sbd *sdp = gl->gl_sbd; | 954 | struct gfs2_sbd *sdp = gl->gl_sbd; |
955 | struct list_head *insert_pt = NULL; | 955 | struct list_head *insert_pt = NULL; |
956 | struct gfs2_holder *gh2; | 956 | struct gfs2_holder *gh2; |
957 | int try_lock = 0; | 957 | int try_futile = 0; |
958 | 958 | ||
959 | BUG_ON(gh->gh_owner_pid == NULL); | 959 | BUG_ON(gh->gh_owner_pid == NULL); |
960 | if (test_and_set_bit(HIF_WAIT, &gh->gh_iflags)) | 960 | if (test_and_set_bit(HIF_WAIT, &gh->gh_iflags)) |
@@ -962,7 +962,7 @@ __acquires(&gl->gl_spin) | |||
962 | 962 | ||
963 | if (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) { | 963 | if (gh->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) { |
964 | if (test_bit(GLF_LOCK, &gl->gl_flags)) | 964 | if (test_bit(GLF_LOCK, &gl->gl_flags)) |
965 | try_lock = 1; | 965 | try_futile = !may_grant(gl, gh); |
966 | if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags)) | 966 | if (test_bit(GLF_INVALIDATE_IN_PROGRESS, &gl->gl_flags)) |
967 | goto fail; | 967 | goto fail; |
968 | } | 968 | } |
@@ -971,9 +971,8 @@ __acquires(&gl->gl_spin) | |||
971 | if (unlikely(gh2->gh_owner_pid == gh->gh_owner_pid && | 971 | if (unlikely(gh2->gh_owner_pid == gh->gh_owner_pid && |
972 | (gh->gh_gl->gl_ops->go_type != LM_TYPE_FLOCK))) | 972 | (gh->gh_gl->gl_ops->go_type != LM_TYPE_FLOCK))) |
973 | goto trap_recursive; | 973 | goto trap_recursive; |
974 | if (try_lock && | 974 | if (try_futile && |
975 | !(gh2->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB)) && | 975 | !(gh2->gh_flags & (LM_FLAG_TRY | LM_FLAG_TRY_1CB))) { |
976 | !may_grant(gl, gh)) { | ||
977 | fail: | 976 | fail: |
978 | gh->gh_error = GLR_TRYFAILED; | 977 | gh->gh_error = GLR_TRYFAILED; |
979 | gfs2_holder_wake(gh); | 978 | gfs2_holder_wake(gh); |