Commit 80914d97 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
parents 74361cb6 883d4cae
...@@ -2375,7 +2375,6 @@ leave: ...@@ -2375,7 +2375,6 @@ leave:
mlog(0, "returning %d\n", ret); mlog(0, "returning %d\n", ret);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(dlm_migrate_lockres);
int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock) int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
......
...@@ -155,7 +155,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, ...@@ -155,7 +155,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
else else
status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions); status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions);
if (status != DLM_NORMAL) if (status != DLM_NORMAL && (status != DLM_CANCELGRANT || !master_node))
goto leave; goto leave;
/* By now this has been masked out of cancel requests. */ /* By now this has been masked out of cancel requests. */
...@@ -183,8 +183,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, ...@@ -183,8 +183,7 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm,
spin_lock(&lock->spinlock); spin_lock(&lock->spinlock);
/* if the master told us the lock was already granted, /* if the master told us the lock was already granted,
* let the ast handle all of these actions */ * let the ast handle all of these actions */
if (status == DLM_NORMAL && if (status == DLM_CANCELGRANT) {
lksb->status == DLM_CANCELGRANT) {
actions &= ~(DLM_UNLOCK_REMOVE_LOCK| actions &= ~(DLM_UNLOCK_REMOVE_LOCK|
DLM_UNLOCK_REGRANT_LOCK| DLM_UNLOCK_REGRANT_LOCK|
DLM_UNLOCK_CLEAR_CONVERT_TYPE); DLM_UNLOCK_CLEAR_CONVERT_TYPE);
...@@ -349,14 +348,9 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm, ...@@ -349,14 +348,9 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm,
vec, veclen, owner, &status); vec, veclen, owner, &status);
if (tmpret >= 0) { if (tmpret >= 0) {
// successfully sent and received // successfully sent and received
if (status == DLM_CANCELGRANT) if (status == DLM_FORWARD)
ret = DLM_NORMAL;
else if (status == DLM_FORWARD) {
mlog(0, "master was in-progress. retry\n"); mlog(0, "master was in-progress. retry\n");
ret = DLM_FORWARD; ret = status;
} else
ret = status;
lksb->status = status;
} else { } else {
mlog_errno(tmpret); mlog_errno(tmpret);
if (dlm_is_host_down(tmpret)) { if (dlm_is_host_down(tmpret)) {
...@@ -372,7 +366,6 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm, ...@@ -372,7 +366,6 @@ static enum dlm_status dlm_send_remote_unlock_request(struct dlm_ctxt *dlm,
/* something bad. this will BUG in ocfs2 */ /* something bad. this will BUG in ocfs2 */
ret = dlm_err_to_dlm_status(tmpret); ret = dlm_err_to_dlm_status(tmpret);
} }
lksb->status = ret;
} }
return ret; return ret;
...@@ -483,6 +476,10 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data) ...@@ -483,6 +476,10 @@ int dlm_unlock_lock_handler(struct o2net_msg *msg, u32 len, void *data)
/* lock was found on queue */ /* lock was found on queue */
lksb = lock->lksb; lksb = lock->lksb;
if (flags & (LKM_VALBLK|LKM_PUT_LVB) &&
lock->ml.type != LKM_EXMODE)
flags &= ~(LKM_VALBLK|LKM_PUT_LVB);
/* unlockast only called on originating node */ /* unlockast only called on originating node */
if (flags & LKM_PUT_LVB) { if (flags & LKM_PUT_LVB) {
lksb->flags |= DLM_LKSB_PUT_LVB; lksb->flags |= DLM_LKSB_PUT_LVB;
...@@ -507,11 +504,8 @@ not_found: ...@@ -507,11 +504,8 @@ not_found:
"cookie=%u:%llu\n", "cookie=%u:%llu\n",
dlm_get_lock_cookie_node(unlock->cookie), dlm_get_lock_cookie_node(unlock->cookie),
dlm_get_lock_cookie_seq(unlock->cookie)); dlm_get_lock_cookie_seq(unlock->cookie));
else { else
/* send the lksb->status back to the other node */
status = lksb->status;
dlm_lock_put(lock); dlm_lock_put(lock);
}
leave: leave:
if (res) if (res)
...@@ -533,26 +527,22 @@ static enum dlm_status dlm_get_cancel_actions(struct dlm_ctxt *dlm, ...@@ -533,26 +527,22 @@ static enum dlm_status dlm_get_cancel_actions(struct dlm_ctxt *dlm,
if (dlm_lock_on_list(&res->blocked, lock)) { if (dlm_lock_on_list(&res->blocked, lock)) {
/* cancel this outright */ /* cancel this outright */
lksb->status = DLM_NORMAL;
status = DLM_NORMAL; status = DLM_NORMAL;
*actions = (DLM_UNLOCK_CALL_AST | *actions = (DLM_UNLOCK_CALL_AST |
DLM_UNLOCK_REMOVE_LOCK); DLM_UNLOCK_REMOVE_LOCK);
} else if (dlm_lock_on_list(&res->converting, lock)) { } else if (dlm_lock_on_list(&res->converting, lock)) {
/* cancel the request, put back on granted */ /* cancel the request, put back on granted */
lksb->status = DLM_NORMAL;
status = DLM_NORMAL; status = DLM_NORMAL;
*actions = (DLM_UNLOCK_CALL_AST | *actions = (DLM_UNLOCK_CALL_AST |
DLM_UNLOCK_REMOVE_LOCK | DLM_UNLOCK_REMOVE_LOCK |
DLM_UNLOCK_REGRANT_LOCK | DLM_UNLOCK_REGRANT_LOCK |
DLM_UNLOCK_CLEAR_CONVERT_TYPE); DLM_UNLOCK_CLEAR_CONVERT_TYPE);
} else if (dlm_lock_on_list(&res->granted, lock)) { } else if (dlm_lock_on_list(&res->granted, lock)) {
/* too late, already granted. DLM_CANCELGRANT */ /* too late, already granted. */
lksb->status = DLM_CANCELGRANT; status = DLM_CANCELGRANT;
status = DLM_NORMAL;
*actions = DLM_UNLOCK_CALL_AST; *actions = DLM_UNLOCK_CALL_AST;
} else { } else {
mlog(ML_ERROR, "lock to cancel is not on any list!\n"); mlog(ML_ERROR, "lock to cancel is not on any list!\n");
lksb->status = DLM_IVLOCKID;
status = DLM_IVLOCKID; status = DLM_IVLOCKID;
*actions = 0; *actions = 0;
} }
...@@ -569,13 +559,11 @@ static enum dlm_status dlm_get_unlock_actions(struct dlm_ctxt *dlm, ...@@ -569,13 +559,11 @@ static enum dlm_status dlm_get_unlock_actions(struct dlm_ctxt *dlm,
/* unlock request */ /* unlock request */
if (!dlm_lock_on_list(&res->granted, lock)) { if (!dlm_lock_on_list(&res->granted, lock)) {
lksb->status = DLM_DENIED;
status = DLM_DENIED; status = DLM_DENIED;
dlm_error(status); dlm_error(status);
*actions = 0; *actions = 0;
} else { } else {
/* unlock granted lock */ /* unlock granted lock */
lksb->status = DLM_NORMAL;
status = DLM_NORMAL; status = DLM_NORMAL;
*actions = (DLM_UNLOCK_FREE_LOCK | *actions = (DLM_UNLOCK_FREE_LOCK |
DLM_UNLOCK_CALL_AST | DLM_UNLOCK_CALL_AST |
...@@ -632,6 +620,8 @@ retry: ...@@ -632,6 +620,8 @@ retry:
spin_lock(&res->spinlock); spin_lock(&res->spinlock);
is_master = (res->owner == dlm->node_num); is_master = (res->owner == dlm->node_num);
if (flags & LKM_VALBLK && lock->ml.type != LKM_EXMODE)
flags &= ~LKM_VALBLK;
spin_unlock(&res->spinlock); spin_unlock(&res->spinlock);
if (is_master) { if (is_master) {
...@@ -665,7 +655,7 @@ retry: ...@@ -665,7 +655,7 @@ retry:
} }
if (call_ast) { if (call_ast) {
mlog(0, "calling unlockast(%p, %d)\n", data, lksb->status); mlog(0, "calling unlockast(%p, %d)\n", data, status);
if (is_master) { if (is_master) {
/* it is possible that there is one last bast /* it is possible that there is one last bast
* pending. make sure it is flushed, then * pending. make sure it is flushed, then
...@@ -677,9 +667,12 @@ retry: ...@@ -677,9 +667,12 @@ retry:
wait_event(dlm->ast_wq, wait_event(dlm->ast_wq,
dlm_lock_basts_flushed(dlm, lock)); dlm_lock_basts_flushed(dlm, lock));
} }
(*unlockast)(data, lksb->status); (*unlockast)(data, status);
} }
if (status == DLM_CANCELGRANT)
status = DLM_NORMAL;
if (status == DLM_NORMAL) { if (status == DLM_NORMAL) {
mlog(0, "kicking the thread\n"); mlog(0, "kicking the thread\n");
dlm_kick_thread(dlm, res); dlm_kick_thread(dlm, res);
......
...@@ -840,6 +840,12 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb, ...@@ -840,6 +840,12 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb,
mlog(0, "Allocating %u clusters for a new window.\n", mlog(0, "Allocating %u clusters for a new window.\n",
ocfs2_local_alloc_window_bits(osb)); ocfs2_local_alloc_window_bits(osb));
/* Instruct the allocation code to try the most recently used
* cluster group. We'll re-record the group used this pass
* below. */
ac->ac_last_group = osb->la_last_gd;
/* we used the generic suballoc reserve function, but we set /* we used the generic suballoc reserve function, but we set
* everything up nicely, so there's no reason why we can't use * everything up nicely, so there's no reason why we can't use
* the more specific cluster api to claim bits. */ * the more specific cluster api to claim bits. */
...@@ -852,6 +858,8 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb, ...@@ -852,6 +858,8 @@ static int ocfs2_local_alloc_new_window(struct ocfs2_super *osb,
goto bail; goto bail;
} }
osb->la_last_gd = ac->ac_last_group;
la->la_bm_off = cpu_to_le32(cluster_off); la->la_bm_off = cpu_to_le32(cluster_off);
alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count); alloc->id1.bitmap1.i_total = cpu_to_le32(cluster_count);
/* just in case... In the future when we find space ourselves, /* just in case... In the future when we find space ourselves,
......
...@@ -197,7 +197,6 @@ struct ocfs2_super ...@@ -197,7 +197,6 @@ struct ocfs2_super
struct ocfs2_node_map recovery_map; struct ocfs2_node_map recovery_map;
struct ocfs2_node_map umount_map; struct ocfs2_node_map umount_map;
u32 num_clusters;
u64 root_blkno; u64 root_blkno;
u64 system_dir_blkno; u64 system_dir_blkno;
u64 bitmap_blkno; u64 bitmap_blkno;
...@@ -237,6 +236,7 @@ struct ocfs2_super ...@@ -237,6 +236,7 @@ struct ocfs2_super
enum ocfs2_local_alloc_state local_alloc_state; enum ocfs2_local_alloc_state local_alloc_state;
struct buffer_head *local_alloc_bh; struct buffer_head *local_alloc_bh;
u64 la_last_gd;
/* Next two fields are for local node slot recovery during /* Next two fields are for local node slot recovery during
* mount. */ * mount. */
......
This diff is collapsed.
...@@ -49,6 +49,8 @@ struct ocfs2_alloc_context { ...@@ -49,6 +49,8 @@ struct ocfs2_alloc_context {
u16 ac_chain; u16 ac_chain;
int ac_allow_chain_relink; int ac_allow_chain_relink;
group_search_t *ac_group_search; group_search_t *ac_group_search;
u64 ac_last_group;
}; };
void ocfs2_free_alloc_context(struct ocfs2_alloc_context *ac); void ocfs2_free_alloc_context(struct ocfs2_alloc_context *ac);
......
...@@ -1442,8 +1442,13 @@ static int ocfs2_initialize_super(struct super_block *sb, ...@@ -1442,8 +1442,13 @@ static int ocfs2_initialize_super(struct super_block *sb,
osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno; osb->bitmap_blkno = OCFS2_I(inode)->ip_blkno;
/* We don't have a cluster lock on the bitmap here because
* we're only interested in static information and the extra
* complexity at mount time isn't worht it. Don't pass the
* inode in to the read function though as we don't want it to
* be put in the cache. */
status = ocfs2_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0, status = ocfs2_read_block(osb, osb->bitmap_blkno, &bitmap_bh, 0,
inode); NULL);
iput(inode); iput(inode);
if (status < 0) { if (status < 0) {
mlog_errno(status); mlog_errno(status);
...@@ -1452,7 +1457,6 @@ static int ocfs2_initialize_super(struct super_block *sb, ...@@ -1452,7 +1457,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
di = (struct ocfs2_dinode *) bitmap_bh->b_data; di = (struct ocfs2_dinode *) bitmap_bh->b_data;
osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.cl_cpg); osb->bitmap_cpg = le16_to_cpu(di->id2.i_chain.cl_cpg);
osb->num_clusters = le32_to_cpu(di->id1.bitmap1.i_total);
brelse(bitmap_bh); brelse(bitmap_bh);
mlog(0, "cluster bitmap inode: %llu, clusters per group: %u\n", mlog(0, "cluster bitmap inode: %llu, clusters per group: %u\n",
(unsigned long long)osb->bitmap_blkno, osb->bitmap_cpg); (unsigned long long)osb->bitmap_blkno, osb->bitmap_cpg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment