diff options
Diffstat (limited to 'fs/ocfs2/dlm/dlmmaster.c')
-rw-r--r-- | fs/ocfs2/dlm/dlmmaster.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index bd1268778b66..84f36db8ada3 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -2036,8 +2036,12 @@ ok: | |||
2036 | 2036 | ||
2037 | done: | 2037 | done: |
2038 | ret = 0; | 2038 | ret = 0; |
2039 | if (res) | 2039 | if (res) { |
2040 | dlm_lockres_put(res); | 2040 | spin_lock(&res->spinlock); |
2041 | res->state |= DLM_LOCK_RES_SETREF_INPROG; | ||
2042 | spin_unlock(&res->spinlock); | ||
2043 | *ret_data = (void *)res; | ||
2044 | } | ||
2041 | dlm_put(dlm); | 2045 | dlm_put(dlm); |
2042 | if (master_request) { | 2046 | if (master_request) { |
2043 | mlog(0, "need to tell master to reassert\n"); | 2047 | mlog(0, "need to tell master to reassert\n"); |
@@ -2064,11 +2068,25 @@ kill: | |||
2064 | __dlm_print_one_lock_resource(res); | 2068 | __dlm_print_one_lock_resource(res); |
2065 | spin_unlock(&res->spinlock); | 2069 | spin_unlock(&res->spinlock); |
2066 | spin_unlock(&dlm->spinlock); | 2070 | spin_unlock(&dlm->spinlock); |
2067 | dlm_lockres_put(res); | 2071 | *ret_data = (void *)res; |
2068 | dlm_put(dlm); | 2072 | dlm_put(dlm); |
2069 | return -EINVAL; | 2073 | return -EINVAL; |
2070 | } | 2074 | } |
2071 | 2075 | ||
2076 | void dlm_assert_master_post_handler(int status, void *data, void *ret_data) | ||
2077 | { | ||
2078 | struct dlm_lock_resource *res = (struct dlm_lock_resource *)ret_data; | ||
2079 | |||
2080 | if (ret_data) { | ||
2081 | spin_lock(&res->spinlock); | ||
2082 | res->state &= ~DLM_LOCK_RES_SETREF_INPROG; | ||
2083 | spin_unlock(&res->spinlock); | ||
2084 | wake_up(&res->wq); | ||
2085 | dlm_lockres_put(res); | ||
2086 | } | ||
2087 | return; | ||
2088 | } | ||
2089 | |||
2072 | int dlm_dispatch_assert_master(struct dlm_ctxt *dlm, | 2090 | int dlm_dispatch_assert_master(struct dlm_ctxt *dlm, |
2073 | struct dlm_lock_resource *res, | 2091 | struct dlm_lock_resource *res, |
2074 | int ignore_higher, u8 request_from, u32 flags) | 2092 | int ignore_higher, u8 request_from, u32 flags) |