Commit 498f7f50 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: (22 commits)
  MAINTAINERS: Update Joel Becker's email address
  ocfs2: Remove unused truncate function from alloc.c
  ocfs2/cluster: dereferencing before checking in nst_seq_show()
  ocfs2: fix build for OCFS2_FS_STATS not enabled
  ocfs2/cluster: Show o2net timing statistics
  ocfs2/cluster: Track process message timing stats for each socket
  ocfs2/cluster: Track send message timing stats for each socket
  ocfs2/cluster: Use ktime instead of timeval in struct o2net_sock_container
  ocfs2/cluster: Replace timeval with ktime in struct o2net_send_tracking
  ocfs2: Add DEBUG_FS dependency
  ocfs2/dlm: Hard code the values for enums
  ocfs2/dlm: Minor cleanup
  ocfs2/dlm: Cleanup dlmdebug.c
  ocfs2: Release buffer_head in case of error in ocfs2_double_lock.
  ocfs2/cluster: Pin the local node when o2hb thread starts
  ocfs2/cluster: Show pin state for each o2hb region
  ocfs2/cluster: Pin/unpin o2hb regions
  ocfs2/cluster: Remove dropped region from o2hb quorum region bitmap
  ocfs2/cluster: Pin the remote node item in configfs
  ocfs2/dlm: make existing convertion precedent over new lock
  ...
parents 0969d11e d6351db2
...@@ -1785,7 +1785,8 @@ S: Maintained ...@@ -1785,7 +1785,8 @@ S: Maintained
F: drivers/usb/atm/cxacru.c F: drivers/usb/atm/cxacru.c
CONFIGFS CONFIGFS
M: Joel Becker <joel.becker@oracle.com> M: Joel Becker <jlbec@evilplan.org>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/configfs.git
S: Supported S: Supported
F: fs/configfs/ F: fs/configfs/
F: include/linux/configfs.h F: include/linux/configfs.h
...@@ -4549,7 +4550,7 @@ F: include/linux/oprofile.h ...@@ -4549,7 +4550,7 @@ F: include/linux/oprofile.h
ORACLE CLUSTER FILESYSTEM 2 (OCFS2) ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
M: Mark Fasheh <mfasheh@suse.com> M: Mark Fasheh <mfasheh@suse.com>
M: Joel Becker <joel.becker@oracle.com> M: Joel Becker <jlbec@evilplan.org>
L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers) L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
W: http://oss.oracle.com/projects/ocfs2/ W: http://oss.oracle.com/projects/ocfs2/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git
......
...@@ -51,7 +51,7 @@ config OCFS2_FS_USERSPACE_CLUSTER ...@@ -51,7 +51,7 @@ config OCFS2_FS_USERSPACE_CLUSTER
config OCFS2_FS_STATS config OCFS2_FS_STATS
bool "OCFS2 statistics" bool "OCFS2 statistics"
depends on OCFS2_FS depends on OCFS2_FS && DEBUG_FS
default y default y
help help
This option allows some fs statistics to be captured. Enabling This option allows some fs statistics to be captured. Enabling
......
...@@ -565,7 +565,6 @@ static inline int ocfs2_et_sanity_check(struct ocfs2_extent_tree *et) ...@@ -565,7 +565,6 @@ static inline int ocfs2_et_sanity_check(struct ocfs2_extent_tree *et)
return ret; return ret;
} }
static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc);
static int ocfs2_cache_extent_block_free(struct ocfs2_cached_dealloc_ctxt *ctxt, static int ocfs2_cache_extent_block_free(struct ocfs2_cached_dealloc_ctxt *ctxt,
struct ocfs2_extent_block *eb); struct ocfs2_extent_block *eb);
static void ocfs2_adjust_rightmost_records(handle_t *handle, static void ocfs2_adjust_rightmost_records(handle_t *handle,
...@@ -5858,6 +5857,7 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb, ...@@ -5858,6 +5857,7 @@ int ocfs2_truncate_log_append(struct ocfs2_super *osb,
ocfs2_journal_dirty(handle, tl_bh); ocfs2_journal_dirty(handle, tl_bh);
osb->truncated_clusters += num_clusters;
bail: bail:
mlog_exit(status); mlog_exit(status);
return status; return status;
...@@ -5929,6 +5929,8 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb, ...@@ -5929,6 +5929,8 @@ static int ocfs2_replay_truncate_records(struct ocfs2_super *osb,
i--; i--;
} }
osb->truncated_clusters = 0;
bail: bail:
mlog_exit(status); mlog_exit(status);
return status; return status;
...@@ -7138,64 +7140,6 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb, ...@@ -7138,64 +7140,6 @@ int ocfs2_commit_truncate(struct ocfs2_super *osb,
return status; return status;
} }
/*
* Expects the inode to already be locked.
*/
int ocfs2_prepare_truncate(struct ocfs2_super *osb,
struct inode *inode,
struct buffer_head *fe_bh,
struct ocfs2_truncate_context **tc)
{
int status;
unsigned int new_i_clusters;
struct ocfs2_dinode *fe;
struct ocfs2_extent_block *eb;
struct buffer_head *last_eb_bh = NULL;
mlog_entry_void();
*tc = NULL;
new_i_clusters = ocfs2_clusters_for_bytes(osb->sb,
i_size_read(inode));
fe = (struct ocfs2_dinode *) fe_bh->b_data;
mlog(0, "fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
"%llu\n", le32_to_cpu(fe->i_clusters), new_i_clusters,
(unsigned long long)le64_to_cpu(fe->i_size));
*tc = kzalloc(sizeof(struct ocfs2_truncate_context), GFP_KERNEL);
if (!(*tc)) {
status = -ENOMEM;
mlog_errno(status);
goto bail;
}
ocfs2_init_dealloc_ctxt(&(*tc)->tc_dealloc);
if (fe->id2.i_list.l_tree_depth) {
status = ocfs2_read_extent_block(INODE_CACHE(inode),
le64_to_cpu(fe->i_last_eb_blk),
&last_eb_bh);
if (status < 0) {
mlog_errno(status);
goto bail;
}
eb = (struct ocfs2_extent_block *) last_eb_bh->b_data;
}
(*tc)->tc_last_eb_bh = last_eb_bh;
status = 0;
bail:
if (status < 0) {
if (*tc)
ocfs2_free_truncate_context(*tc);
*tc = NULL;
}
mlog_exit_void();
return status;
}
/* /*
* 'start' is inclusive, 'end' is not. * 'start' is inclusive, 'end' is not.
*/ */
...@@ -7270,18 +7214,3 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh, ...@@ -7270,18 +7214,3 @@ int ocfs2_truncate_inline(struct inode *inode, struct buffer_head *di_bh,
out: out:
return ret; return ret;
} }
static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc)
{
/*
* The caller is responsible for completing deallocation
* before freeing the context.
*/
if (tc->tc_dealloc.c_first_suballocator != NULL)
mlog(ML_NOTICE,
"Truncate completion has non-empty dealloc context\n");
brelse(tc->tc_last_eb_bh);
kfree(tc);
}
...@@ -228,10 +228,6 @@ struct ocfs2_truncate_context { ...@@ -228,10 +228,6 @@ struct ocfs2_truncate_context {
int ocfs2_zero_range_for_truncate(struct inode *inode, handle_t *handle, int ocfs2_zero_range_for_truncate(struct inode *inode, handle_t *handle,
u64 range_start, u64 range_end); u64 range_start, u64 range_end);
int ocfs2_prepare_truncate(struct ocfs2_super *osb,
struct inode *inode,
struct buffer_head *fe_bh,
struct ocfs2_truncate_context **tc);
int ocfs2_commit_truncate(struct ocfs2_super *osb, int ocfs2_commit_truncate(struct ocfs2_super *osb,
struct inode *inode, struct inode *inode,
struct buffer_head *di_bh); struct buffer_head *di_bh);
......
...@@ -1630,6 +1630,43 @@ static int ocfs2_zero_tail(struct inode *inode, struct buffer_head *di_bh, ...@@ -1630,6 +1630,43 @@ static int ocfs2_zero_tail(struct inode *inode, struct buffer_head *di_bh,
return ret; return ret;
} }
/*
* Try to flush truncate logs if we can free enough clusters from it.
* As for return value, "< 0" means error, "0" no space and "1" means
* we have freed enough spaces and let the caller try to allocate again.
*/
static int ocfs2_try_to_free_truncate_log(struct ocfs2_super *osb,
unsigned int needed)
{
tid_t target;
int ret = 0;
unsigned int truncated_clusters;
mutex_lock(&osb->osb_tl_inode->i_mutex);
truncated_clusters = osb->truncated_clusters;
mutex_unlock(&osb->osb_tl_inode->i_mutex);
/*
* Check whether we can succeed in allocating if we free
* the truncate log.
*/
if (truncated_clusters < needed)
goto out;
ret = ocfs2_flush_truncate_log(osb);
if (ret) {
mlog_errno(ret);
goto out;
}
if (jbd2_journal_start_commit(osb->journal->j_journal, &target)) {
jbd2_log_wait_commit(osb->journal->j_journal, target);
ret = 1;
}
out:
return ret;
}
int ocfs2_write_begin_nolock(struct file *filp, int ocfs2_write_begin_nolock(struct file *filp,
struct address_space *mapping, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags, loff_t pos, unsigned len, unsigned flags,
...@@ -1637,7 +1674,7 @@ int ocfs2_write_begin_nolock(struct file *filp, ...@@ -1637,7 +1674,7 @@ int ocfs2_write_begin_nolock(struct file *filp,
struct buffer_head *di_bh, struct page *mmap_page) struct buffer_head *di_bh, struct page *mmap_page)
{ {
int ret, cluster_of_pages, credits = OCFS2_INODE_UPDATE_CREDITS; int ret, cluster_of_pages, credits = OCFS2_INODE_UPDATE_CREDITS;
unsigned int clusters_to_alloc, extents_to_split; unsigned int clusters_to_alloc, extents_to_split, clusters_need = 0;
struct ocfs2_write_ctxt *wc; struct ocfs2_write_ctxt *wc;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
...@@ -1646,7 +1683,9 @@ int ocfs2_write_begin_nolock(struct file *filp, ...@@ -1646,7 +1683,9 @@ int ocfs2_write_begin_nolock(struct file *filp,
struct ocfs2_alloc_context *meta_ac = NULL; struct ocfs2_alloc_context *meta_ac = NULL;
handle_t *handle; handle_t *handle;
struct ocfs2_extent_tree et; struct ocfs2_extent_tree et;
int try_free = 1, ret1;
try_again:
ret = ocfs2_alloc_write_ctxt(&wc, osb, pos, len, di_bh); ret = ocfs2_alloc_write_ctxt(&wc, osb, pos, len, di_bh);
if (ret) { if (ret) {
mlog_errno(ret); mlog_errno(ret);
...@@ -1681,6 +1720,7 @@ int ocfs2_write_begin_nolock(struct file *filp, ...@@ -1681,6 +1720,7 @@ int ocfs2_write_begin_nolock(struct file *filp,
mlog_errno(ret); mlog_errno(ret);
goto out; goto out;
} else if (ret == 1) { } else if (ret == 1) {
clusters_need = wc->w_clen;
ret = ocfs2_refcount_cow(inode, filp, di_bh, ret = ocfs2_refcount_cow(inode, filp, di_bh,
wc->w_cpos, wc->w_clen, UINT_MAX); wc->w_cpos, wc->w_clen, UINT_MAX);
if (ret) { if (ret) {
...@@ -1695,6 +1735,7 @@ int ocfs2_write_begin_nolock(struct file *filp, ...@@ -1695,6 +1735,7 @@ int ocfs2_write_begin_nolock(struct file *filp,
mlog_errno(ret); mlog_errno(ret);
goto out; goto out;
} }
clusters_need += clusters_to_alloc;
di = (struct ocfs2_dinode *)wc->w_di_bh->b_data; di = (struct ocfs2_dinode *)wc->w_di_bh->b_data;
...@@ -1817,6 +1858,22 @@ int ocfs2_write_begin_nolock(struct file *filp, ...@@ -1817,6 +1858,22 @@ int ocfs2_write_begin_nolock(struct file *filp,
ocfs2_free_alloc_context(data_ac); ocfs2_free_alloc_context(data_ac);
if (meta_ac) if (meta_ac)
ocfs2_free_alloc_context(meta_ac); ocfs2_free_alloc_context(meta_ac);
if (ret == -ENOSPC && try_free) {
/*
* Try to free some truncate log so that we can have enough
* clusters to allocate.
*/
try_free = 0;
ret1 = ocfs2_try_to_free_truncate_log(osb, clusters_need);
if (ret1 == 1)
goto try_again;
if (ret1 < 0)
mlog_errno(ret1);
}
return ret; return ret;
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -153,63 +153,114 @@ static void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, ...@@ -153,63 +153,114 @@ static void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
nst->st_node = node; nst->st_node = node;
} }
static void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) static inline void o2net_set_nst_sock_time(struct o2net_send_tracking *nst)
{ {
do_gettimeofday(&nst->st_sock_time); nst->st_sock_time = ktime_get();
} }
static void o2net_set_nst_send_time(struct o2net_send_tracking *nst) static inline void o2net_set_nst_send_time(struct o2net_send_tracking *nst)
{ {
do_gettimeofday(&nst->st_send_time); nst->st_send_time = ktime_get();
} }
static void o2net_set_nst_status_time(struct o2net_send_tracking *nst) static inline void o2net_set_nst_status_time(struct o2net_send_tracking *nst)
{ {
do_gettimeofday(&nst->st_status_time); nst->st_status_time = ktime_get();
} }
static void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, static inline void o2net_set_nst_sock_container(struct o2net_send_tracking *nst,
struct o2net_sock_container *sc) struct o2net_sock_container *sc)
{ {
nst->st_sc = sc; nst->st_sc = sc;
} }
static void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id) static inline void o2net_set_nst_msg_id(struct o2net_send_tracking *nst,
u32 msg_id)
{ {
nst->st_id = msg_id; nst->st_id = msg_id;
} }
#else /* CONFIG_DEBUG_FS */ static inline void o2net_set_sock_timer(struct o2net_sock_container *sc)
static inline void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype,
u32 msgkey, struct task_struct *task, u8 node)
{ {
sc->sc_tv_timer = ktime_get();
} }
static inline void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) static inline void o2net_set_data_ready_time(struct o2net_sock_container *sc)
{ {
sc->sc_tv_data_ready = ktime_get();
} }
static inline void o2net_set_nst_send_time(struct o2net_send_tracking *nst) static inline void o2net_set_advance_start_time(struct o2net_sock_container *sc)
{ {
sc->sc_tv_advance_start = ktime_get();
} }
static inline void o2net_set_nst_status_time(struct o2net_send_tracking *nst) static inline void o2net_set_advance_stop_time(struct o2net_sock_container *sc)
{ {
sc->sc_tv_advance_stop = ktime_get();
} }
static inline void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, static inline void o2net_set_func_start_time(struct o2net_sock_container *sc)
struct o2net_sock_container *sc)
{ {
sc->sc_tv_func_start = ktime_get();
} }
static inline void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, static inline void o2net_set_func_stop_time(struct o2net_sock_container *sc)
u32 msg_id)
{ {
sc->sc_tv_func_stop = ktime_get();
} }
static ktime_t o2net_get_func_run_time(struct o2net_sock_container *sc)
{
return ktime_sub(sc->sc_tv_func_stop, sc->sc_tv_func_start);
}
#else /* CONFIG_DEBUG_FS */
# define o2net_init_nst(a, b, c, d, e)
# define o2net_set_nst_sock_time(a)
# define o2net_set_nst_send_time(a)
# define o2net_set_nst_status_time(a)
# define o2net_set_nst_sock_container(a, b)
# define o2net_set_nst_msg_id(a, b)
# define o2net_set_sock_timer(a)
# define o2net_set_data_ready_time(a)
# define o2net_set_advance_start_time(a)
# define o2net_set_advance_stop_time(a)
# define o2net_set_func_start_time(a)
# define o2net_set_func_stop_time(a)
# define o2net_get_func_run_time(a) (ktime_t)0
#endif /* CONFIG_DEBUG_FS */ #endif /* CONFIG_DEBUG_FS */
#ifdef CONFIG_OCFS2_FS_STATS
static void o2net_update_send_stats(struct o2net_send_tracking *nst,
struct o2net_sock_container *sc)
{
sc->sc_tv_status_total = ktime_add(sc->sc_tv_status_total,
ktime_sub(ktime_get(),
nst->st_status_time));
sc->sc_tv_send_total = ktime_add(sc->sc_tv_send_total,
ktime_sub(nst->st_status_time,
nst->st_send_time));
sc->sc_tv_acquiry_total = ktime_add(sc->sc_tv_acquiry_total,
ktime_sub(nst->st_send_time,
nst->st_sock_time));
sc->sc_send_count++;
}
static void o2net_update_recv_stats(struct o2net_sock_container *sc)
{
sc->sc_tv_process_total = ktime_add(sc->sc_tv_process_total,
o2net_get_func_run_time(sc));
sc->sc_recv_count++;
}
#else
# define o2net_update_send_stats(a, b)
# define o2net_update_recv_stats(sc)
#endif /* CONFIG_OCFS2_FS_STATS */
static inline int o2net_reconnect_delay(void) static inline int o2net_reconnect_delay(void)
{ {
return o2nm_single_cluster->cl_reconnect_delay_ms; return o2nm_single_cluster->cl_reconnect_delay_ms;
...@@ -355,6 +406,7 @@ static void sc_kref_release(struct kref *kref) ...@@ -355,6 +406,7 @@ static void sc_kref_release(struct kref *kref)
sc->sc_sock = NULL; sc->sc_sock = NULL;
} }
o2nm_undepend_item(&sc->sc_node->nd_item);
o2nm_node_put(sc->sc_node); o2nm_node_put(sc->sc_node);
sc->sc_node = NULL; sc->sc_node = NULL;
...@@ -376,6 +428,7 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node) ...@@ -376,6 +428,7 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node)
{ {
struct o2net_sock_container *sc, *ret = NULL; struct o2net_sock_container *sc, *ret = NULL;
struct page *page = NULL; struct page *page = NULL;
int status = 0;
page = alloc_page(GFP_NOFS); page = alloc_page(GFP_NOFS);
sc = kzalloc(sizeof(*sc), GFP_NOFS); sc = kzalloc(sizeof(*sc), GFP_NOFS);
...@@ -386,6 +439,13 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node) ...@@ -386,6 +439,13 @@ static struct o2net_sock_container *sc_alloc(struct o2nm_node *node)
o2nm_node_get(node); o2nm_node_get(node);
sc->sc_node = node; sc->sc_node = node;
/* pin the node item of the remote node */
status = o2nm_depend_item(&node->nd_item);
if (status) {
mlog_errno(status);
o2nm_node_put(node);
goto out;
}
INIT_WORK(&sc->sc_connect_work, o2net_sc_connect_completed); INIT_WORK(&sc->sc_connect_work, o2net_sc_connect_completed);
INIT_WORK(&sc->sc_rx_work, o2net_rx_until_empty); INIT_WORK(&sc->sc_rx_work, o2net_rx_until_empty);
INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc); INIT_WORK(&sc->sc_shutdown_work, o2net_shutdown_sc);
...@@ -546,7 +606,7 @@ static void o2net_data_ready(struct sock *sk, int bytes) ...@@ -546,7 +606,7 @@ static void o2net_data_ready(struct sock *sk, int bytes)
if (sk->sk_user_data) { if (sk->sk_user_data) {
struct o2net_sock_container *sc = sk->sk_user_data; struct o2net_sock_container *sc = sk->sk_user_data;
sclog(sc, "data_ready hit\n"); sclog(sc, "data_ready hit\n");
do_gettimeofday(&sc->sc_tv_data_ready); o2net_set_data_ready_time(sc);
o2net_sc_queue_work(sc, &sc->sc_rx_work); o2net_sc_queue_work(sc, &sc->sc_rx_work);
ready = sc->sc_data_ready; ready = sc->sc_data_ready;
} else { } else {
...@@ -1070,6 +1130,8 @@ int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *caller_vec, ...@@ -1070,6 +1130,8 @@ int o2net_send_message_vec(u32 msg_type, u32 key, struct kvec *caller_vec,
o2net_set_nst_status_time(&nst); o2net_set_nst_status_time(&nst);
wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw)); wait_event(nsw.ns_wq, o2net_nsw_completed(nn, &nsw));
o2net_update_send_stats(&nst, sc);
/* Note that we avoid overwriting the callers status return /* Note that we avoid overwriting the callers status return
* variable if a system error was reported on the other * variable if a system error was reported on the other
* side. Callers beware. */ * side. Callers beware. */
...@@ -1183,13 +1245,15 @@ static int o2net_process_message(struct o2net_sock_container *sc, ...@@ -1183,13 +1245,15 @@ static int o2net_process_message(struct o2net_sock_container *sc,
if (syserr != O2NET_ERR_NONE) if (syserr != O2NET_ERR_NONE)
goto out_respond; goto out_respond;
do_gettimeofday(&sc->sc_tv_func_start); o2net_set_func_start_time(sc);
sc->sc_msg_key = be32_to_cpu(hdr->key); sc->sc_msg_key = be32_to_cpu(hdr->key);
sc->sc_msg_type = be16_to_cpu(hdr->msg_type); sc->sc_msg_type = be16_to_cpu(hdr->msg_type);
handler_status = (nmh->nh_func)(hdr, sizeof(struct o2net_msg) + handler_status = (nmh->nh_func)(hdr, sizeof(struct o2net_msg) +
be16_to_cpu(hdr->data_len), be16_to_cpu(hdr->data_len),
nmh->nh_func_data, &ret_data); nmh->nh_func_data, &ret_data);
do_gettimeofday(&sc->sc_tv_func_stop); o2net_set_func_stop_time(sc);
o2net_update_recv_stats(sc);
out_respond: out_respond:
/* this destroys the hdr, so don't use it after this */ /* this destroys the hdr, so don't use it after this */
...@@ -1300,7 +1364,7 @@ static int o2net_advance_rx(struct o2net_sock_container *sc) ...@@ -1300,7 +1364,7 @@ static int o2net_advance_rx(struct o2net_sock_container *sc)
size_t datalen; size_t datalen;
sclog(sc, "receiving\n"); sclog(sc, "receiving\n");
do_gettimeofday(&sc->sc_tv_advance_start); o2net_set_advance_start_time(sc);
if (unlikely(sc->sc_handshake_ok == 0)) { if (unlikely(sc->sc_handshake_ok == 0)) {
if(sc->sc_page_off < sizeof(struct o2net_handshake)) { if(sc->sc_page_off < sizeof(struct o2net_handshake)) {
...@@ -1375,7 +1439,7 @@ static int o2net_advance_rx(struct o2net_sock_container *sc) ...@@ -1375,7 +1439,7 @@ static int o2net_advance_rx(struct o2net_sock_container *sc)
out: out:
sclog(sc, "ret = %d\n", ret); sclog(sc, "ret = %d\n", ret);
do_gettimeofday(&sc->sc_tv_advance_stop); o2net_set_advance_stop_time(sc);
return ret; return ret;
} }
...@@ -1475,27 +1539,28 @@ static void o2net_idle_timer(unsigned long data) ...@@ -1475,27 +1539,28 @@ static void o2net_idle_timer(unsigned long data)
{ {
struct o2net_sock_container *sc = (struct o2net_sock_container *)data; struct o2net_sock_container *sc = (struct o2net_sock_container *)data;
struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num); struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num);
struct timeval now;
do_gettimeofday(&now); #ifdef CONFIG_DEBUG_FS
ktime_t now = ktime_get();
#endif
printk(KERN_NOTICE "o2net: connection to " SC_NODEF_FMT " has been idle for %u.%u " printk(KERN_NOTICE "o2net: connection to " SC_NODEF_FMT " has been idle for %u.%u "
"seconds, shutting it down.\n", SC_NODEF_ARGS(sc), "seconds, shutting it down.\n", SC_NODEF_ARGS(sc),
o2net_idle_timeout() / 1000, o2net_idle_timeout() / 1000,
o2net_idle_timeout() % 1000); o2net_idle_timeout() % 1000);
mlog(ML_NOTICE, "here are some times that might help debug the "
"situation: (tmr %ld.%ld now %ld.%ld dr %ld.%ld adv " #ifdef CONFIG_DEBUG_FS
"%ld.%ld:%ld.%ld func (%08x:%u) %ld.%ld:%ld.%ld)\n", mlog(ML_NOTICE, "Here are some times that might help debug the "
sc->sc_tv_timer.tv_sec, (long) sc->sc_tv_timer.tv_usec, "situation: (Timer: %lld, Now %lld, DataReady %lld, Advance %lld-%lld, "
now.tv_sec, (long) now.tv_usec, "Key 0x%08x, Func %u, FuncTime %lld-%lld)\n",
sc->sc_tv_data_ready.tv_sec, (long) sc->sc_tv_data_ready.tv_usec, (long long)ktime_to_us(sc->sc_tv_timer), (long long)ktime_to_us(now),
sc->sc_tv_advance_start.tv_sec, (long long)ktime_to_us(sc->sc_tv_data_ready),
(long) sc->sc_tv_advance_start.tv_usec, (long long)ktime_to_us(sc->sc_tv_advance_start),
sc->sc_tv_advance_stop.tv_sec, (long long)ktime_to_us(sc->sc_tv_advance_stop),
(long) sc->sc_tv_advance_stop.tv_usec,
sc->sc_msg_key, sc->sc_msg_type, sc->sc_msg_key, sc->sc_msg_type,
sc->sc_tv_func_start.tv_sec, (long) sc->sc_tv_func_start.tv_usec, (long long)ktime_to_us(sc->sc_tv_func_start),
sc->sc_tv_func_stop.tv_sec, (long) sc->sc_tv_func_stop.tv_usec); (long long)ktime_to_us(sc->sc_tv_func_stop));
#endif
/* /*
* Initialize the nn_timeout so that the next connection attempt * Initialize the nn_timeout so that the next connection attempt
...@@ -1511,7 +1576,7 @@ static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc) ...@@ -1511,7 +1576,7 @@ static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc)
o2net_sc_cancel_delayed_work(sc, &sc->sc_keepalive_work); o2net_sc_cancel_delayed_work(sc, &sc->sc_keepalive_work);
o2net_sc_queue_delayed_work(sc, &sc->sc_keepalive_work, o2net_sc_queue_delayed_work(sc, &sc->sc_keepalive_work,
msecs_to_jiffies(o2net_keepalive_delay())); msecs_to_jiffies(o2net_keepalive_delay()));
do_gettimeofday(&sc->sc_tv_timer); o2net_set_sock_timer(sc);
mod_timer(&sc->sc_idle_timeout, mod_timer(&sc->sc_idle_timeout,
jiffies + msecs_to_jiffies(o2net_idle_timeout())); jiffies + msecs_to_jiffies(o2net_idle_timeout()));
} }
......
...@@ -166,18 +166,27 @@ struct o2net_sock_container { ...@@ -166,18 +166,27 @@ struct o2net_sock_container {
/* original handlers for the sockets */ /* original handlers for the sockets */
void (*sc_state_change)(struct sock *sk); void (*sc_state_change)(struct sock *sk);
void (*sc_data_ready)(struct sock *sk, int bytes); void (*sc_data_ready)(struct sock *sk, int bytes);
#ifdef CONFIG_DEBUG_FS
struct list_head sc_net_debug_item;
#endif
struct timeval sc_tv_timer;
struct timeval sc_tv_data_ready;
struct timeval sc_tv_advance_start;
struct timeval sc_tv_advance_stop;
struct timeval sc_tv_func_start;
struct timeval sc_tv_func_stop;
u32 sc_msg_key; u32 sc_msg_key;
u16 sc_msg_type; u16 sc_msg_type;
#ifdef CONFIG_DEBUG_FS
struct list_head sc_net_debug_item;
ktime_t sc_tv_timer;
ktime_t sc_tv_data_ready;
ktime_t sc_tv_advance_start;
ktime_t sc_tv_advance_stop;
ktime_t sc_tv_func_start;
ktime_t sc_tv_func_stop;
#endif
#ifdef CONFIG_OCFS2_FS_STATS
ktime_t sc_tv_acquiry_total;
ktime_t sc_tv_send_total;
ktime_t sc_tv_status_total;
u32 sc_send_count;
u32 sc_recv_count;
ktime_t sc_tv_process_total;
#endif
struct mutex sc_send_lock; struct mutex sc_send_lock;
}; };
...@@ -220,9 +229,9 @@ struct o2net_send_tracking { ...@@ -220,9 +229,9 @@ struct o2net_send_tracking {
u32 st_msg_type; u32 st_msg_type;
u32 st_msg_key; u32 st_msg_key;
u8 st_node; u8 st_node;
struct timeval st_sock_time; ktime_t st_sock_time;
struct timeval st_send_time; ktime_t st_send_time;
struct timeval st_status_time; ktime_t st_status_time;
}; };
#else #else
struct o2net_send_tracking { struct o2net_send_tracking {
......
...@@ -90,19 +90,29 @@ static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -90,19 +90,29 @@ static int dlm_should_cancel_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
mlog_entry_void(); struct dlm_lock_resource *res;
BUG_ON(!dlm); BUG_ON(!dlm);
BUG_ON(!lock); BUG_ON(!lock);
res = lock->lockres;
assert_spin_locked(&dlm->ast_lock); assert_spin_locked(&dlm->ast_lock);
if (!list_empty(&lock->ast_list)) { if (!list_empty(&lock->ast_list)) {
mlog(ML_ERROR, "ast list not empty!! pending=%d, newlevel=%d\n", mlog(ML_ERROR, "%s: res %.*s, lock %u:%llu, "
"AST list not empty, pending %d, newlevel %d\n",
dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
lock->ast_pending, lock->ml.type); lock->ast_pending, lock->ml.type);
BUG(); BUG();
} }
if (lock->ast_pending) if (lock->ast_pending)
mlog(0, "lock has an ast getting flushed right now\n"); mlog(0, "%s: res %.*s, lock %u:%llu, AST getting flushed\n",
dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
/* putting lock on list, add a ref */ /* putting lock on list, add a ref */
dlm_lock_get(lock); dlm_lock_get(lock);
...@@ -110,9 +120,10 @@ void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -110,9 +120,10 @@ void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
/* check to see if this ast obsoletes the bast */ /* check to see if this ast obsoletes the bast */
if (dlm_should_cancel_bast(dlm, lock)) { if (dlm_should_cancel_bast(dlm, lock)) {
struct dlm_lock_resource *res = lock->lockres; mlog(0, "%s: res %.*s, lock %u:%llu, Cancelling BAST\n",
mlog(0, "%s: cancelling bast for %.*s\n", dlm->name, res->lockname.len, res->lockname.name,
dlm->name, res->lockname.len, res->lockname.name); dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
lock->bast_pending = 0; lock->bast_pending = 0;
list_del_init(&lock->bast_list); list_del_init(&lock->bast_list);
lock->ml.highest_blocked = LKM_IVMODE; lock->ml.highest_blocked = LKM_IVMODE;
...@@ -134,8 +145,6 @@ void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -134,8 +145,6 @@ void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
mlog_entry_void();
BUG_ON(!dlm); BUG_ON(!dlm);
BUG_ON(!lock); BUG_ON(!lock);
...@@ -147,15 +156,21 @@ void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -147,15 +156,21 @@ void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
mlog_entry_void(); struct dlm_lock_resource *res;
BUG_ON(!dlm); BUG_ON(!dlm);
BUG_ON(!lock); BUG_ON(!lock);
assert_spin_locked(&dlm->ast_lock); assert_spin_locked(&dlm->ast_lock);
res = lock->lockres;
BUG_ON(!list_empty(&lock->bast_list)); BUG_ON(!list_empty(&lock->bast_list));
if (lock->bast_pending) if (lock->bast_pending)
mlog(0, "lock has a bast getting flushed right now\n"); mlog(0, "%s: res %.*s, lock %u:%llu, BAST getting flushed\n",
dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
/* putting lock on list, add a ref */ /* putting lock on list, add a ref */
dlm_lock_get(lock); dlm_lock_get(lock);
...@@ -167,8 +182,6 @@ void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) ...@@ -167,8 +182,6 @@ void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
void dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock) void dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
{ {
mlog_entry_void();
BUG_ON(!dlm); BUG_ON(!dlm);
BUG_ON(!lock); BUG_ON(!lock);
...@@ -213,7 +226,10 @@ void dlm_do_local_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -213,7 +226,10 @@ void dlm_do_local_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
dlm_astlockfunc_t *fn; dlm_astlockfunc_t *fn;
struct dlm_lockstatus *lksb; struct dlm_lockstatus *lksb;
mlog_entry_void(); mlog(0, "%s: res %.*s, lock %u:%llu, Local AST\n", dlm->name,
res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
lksb = lock->lksb; lksb = lock->lksb;
fn = lock->ast; fn = lock->ast;
...@@ -231,7 +247,10 @@ int dlm_do_remote_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -231,7 +247,10 @@ int dlm_do_remote_ast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
struct dlm_lockstatus *lksb; struct dlm_lockstatus *lksb;
int lksbflags; int lksbflags;
mlog_entry_void(); mlog(0, "%s: res %.*s, lock %u:%llu, Remote AST\n", dlm->name,
res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)));
lksb = lock->lksb; lksb = lock->lksb;
BUG_ON(lock->ml.node == dlm->node_num); BUG_ON(lock->ml.node == dlm->node_num);
...@@ -250,9 +269,14 @@ void dlm_do_local_bast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -250,9 +269,14 @@ void dlm_do_local_bast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
{ {
dlm_bastlockfunc_t *fn = lock->bast; dlm_bastlockfunc_t *fn = lock->bast;
mlog_entry_void();
BUG_ON(lock->ml.node != dlm->node_num); BUG_ON(lock->ml.node != dlm->node_num);
mlog(0, "%s: res %.*s, lock %u:%llu, Local BAST, blocked %d\n",
dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(lock->ml.cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(lock->ml.cookie)),
blocked_type);
(*fn)(lock->astdata, blocked_type); (*fn)(lock->astdata, blocked_type);
} }
...@@ -332,7 +356,8 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -332,7 +356,8 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
/* cannot get a proxy ast message if this node owns it */ /* cannot get a proxy ast message if this node owns it */
BUG_ON(res->owner == dlm->node_num); BUG_ON(res->owner == dlm->node_num);
mlog(0, "lockres %.*s\n", res->lockname.len, res->lockname.name); mlog(0, "%s: res %.*s\n", dlm->name, res->lockname.len,
res->lockname.name);
spin_lock(&res->spinlock); spin_lock(&res->spinlock);
if (res->state & DLM_LOCK_RES_RECOVERING) { if (res->state & DLM_LOCK_RES_RECOVERING) {
...@@ -382,8 +407,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data, ...@@ -382,8 +407,12 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
if (past->type == DLM_AST) { if (past->type == DLM_AST) {
/* do not alter lock refcount. switching lists. */ /* do not alter lock refcount. switching lists. */
list_move_tail(&lock->list, &res->granted); list_move_tail(&lock->list, &res->granted);
mlog(0, "ast: Adding to granted list... type=%d, " mlog(0, "%s: res %.*s, lock %u:%llu, Granted type %d => %d\n",
"convert_type=%d\n", lock->ml.type, lock->ml.convert_type); dlm->name, res->lockname.len, res->lockname.name,
dlm_get_lock_cookie_node(be64_to_cpu(cookie)),
dlm_get_lock_cookie_seq(be64_to_cpu(cookie)),
lock->ml.type, lock->ml.convert_type);
if (lock->ml.convert_type != LKM_IVMODE) { if (lock->ml.convert_type != LKM_IVMODE) {
lock->ml.type = lock->ml.convert_type; lock->ml.type = lock->ml.convert_type;
lock->ml.convert_type = LKM_IVMODE; lock->ml.convert_type = LKM_IVMODE;
...@@ -426,9 +455,9 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -426,9 +455,9 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
size_t veclen = 1; size_t veclen = 1;
int status; int status;
mlog_entry("res %.*s, to=%u, type=%d, blocked_type=%d\n", mlog(0, "%s: res %.*s, to %u, type %d, blocked_type %d\n", dlm->name,
res->lockname.len, res->lockname.name, lock->ml.node, res->lockname.len, res->lockname.name, lock->ml.node, msg_type,
msg_type, blocked_type); blocked_type);
memset(&past, 0, sizeof(struct dlm_proxy_ast)); memset(&past, 0, sizeof(struct dlm_proxy_ast));
past.node_idx = dlm->node_num; past.node_idx = dlm->node_num;
...@@ -441,7 +470,6 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -441,7 +470,6 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
vec[0].iov_len = sizeof(struct dlm_proxy_ast); vec[0].iov_len = sizeof(struct dlm_proxy_ast);
vec[0].iov_base = &past; vec[0].iov_base = &past;
if (flags & DLM_LKSB_GET_LVB) { if (flags & DLM_LKSB_GET_LVB) {
mlog(0, "returning requested LVB data\n");
be32_add_cpu(&past.flags, LKM_GET_LVB); be32_add_cpu(&past.flags, LKM_GET_LVB);
vec[1].iov_len = DLM_LVB_LEN; vec[1].iov_len = DLM_LVB_LEN;
vec[1].iov_base = lock->lksb->lvb; vec[1].iov_base = lock->lksb->lvb;
...@@ -451,8 +479,8 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, ...@@ -451,8 +479,8 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
ret = o2net_send_message_vec(DLM_PROXY_AST_MSG, dlm->key, vec, veclen, ret = o2net_send_message_vec(DLM_PROXY_AST_MSG, dlm->key, vec, veclen,
lock->ml.node, &status); lock->ml.node, &status);
if (ret < 0) if (ret < 0)
mlog(ML_ERROR, "Error %d when sending message %u (key 0x%x) to " mlog(ML_ERROR, "%s: res %.*s, error %d send AST to node %u\n",
"node %u\n", ret, DLM_PROXY_AST_MSG, dlm->key, dlm->name, res->lockname.len, res->lockname.name, ret,
lock->ml.node); lock->ml.node);
else { else {
if (status == DLM_RECOVERING) { if (status == DLM_RECOVERING) {
......
...@@ -50,10 +50,10 @@ ...@@ -50,10 +50,10 @@
#define dlm_lockid_hash(_n, _l) full_name_hash(_n, _l) #define dlm_lockid_hash(_n, _l) full_name_hash(_n, _l)
enum dlm_mle_type { enum dlm_mle_type {
DLM_MLE_BLOCK, DLM_MLE_BLOCK = 0,
DLM_MLE_MASTER, DLM_MLE_MASTER = 1,
DLM_MLE_MIGRATION, DLM_MLE_MIGRATION = 2,
DLM_MLE_NUM_TYPES DLM_MLE_NUM_TYPES = 3,
}; };
struct dlm_master_list_entry { struct dlm_master_list_entry {
...@@ -82,8 +82,8 @@ struct dlm_master_list_entry { ...@@ -82,8 +82,8 @@ struct dlm_master_list_entry {
enum dlm_ast_type { enum dlm_ast_type {
DLM_AST = 0, DLM_AST = 0,
DLM_BAST, DLM_BAST = 1,
DLM_ASTUNLOCK DLM_ASTUNLOCK = 2,
}; };
...@@ -119,9 +119,9 @@ struct dlm_recovery_ctxt ...@@ -119,9 +119,9 @@ struct dlm_recovery_ctxt
enum dlm_ctxt_state { enum dlm_ctxt_state {
DLM_CTXT_NEW = 0, DLM_CTXT_NEW = 0,
DLM_CTXT_JOINED, DLM_CTXT_JOINED = 1,
DLM_CTXT_IN_SHUTDOWN, DLM_CTXT_IN_SHUTDOWN = 2,
DLM_CTXT_LEAVING, DLM_CTXT_LEAVING = 3,
}; };
struct dlm_ctxt struct dlm_ctxt
...@@ -388,8 +388,8 @@ struct dlm_lock ...@@ -388,8 +388,8 @@ struct dlm_lock
enum dlm_lockres_list { enum dlm_lockres_list {
DLM_GRANTED_LIST = 0, DLM_GRANTED_LIST = 0,
DLM_CONVERTING_LIST, DLM_CONVERTING_LIST = 1,
DLM_BLOCKED_LIST DLM_BLOCKED_LIST = 2,
}; };
static inline int dlm_lvb_is_empty(char *lvb) static inline int dlm_lvb_is_empty(char *lvb)
...@@ -427,27 +427,27 @@ struct dlm_node_iter ...@@ -427,27 +427,27 @@ struct dlm_node_iter
enum { enum {
DLM_MASTER_REQUEST_MSG = 500, DLM_MASTER_REQUEST_MSG = 500,
DLM_UNUSED_MSG1, /* 501 */ DLM_UNUSED_MSG1 = 501,
DLM_ASSERT_MASTER_MSG, /* 502 */ DLM_ASSERT_MASTER_MSG = 502,
DLM_CREATE_LOCK_MSG, /* 503 */ DLM_CREATE_LOCK_MSG = 503,
DLM_CONVERT_LOCK_MSG, /* 504 */ DLM_CONVERT_LOCK_MSG = 504,
DLM_PROXY_AST_MSG, /* 505 */ DLM_PROXY_AST_MSG = 505,
DLM_UNLOCK_LOCK_MSG, /* 506 */ DLM_UNLOCK_LOCK_MSG = 506,
DLM_DEREF_LOCKRES_MSG, /* 507 */ DLM_DEREF_LOCKRES_MSG = 507,
DLM_MIGRATE_REQUEST_MSG, /* 508 */ DLM_MIGRATE_REQUEST_MSG = 508,
DLM_MIG_LOCKRES_MSG, /* 509 */ DLM_MIG_LOCKRES_MSG = 509,
DLM_QUERY_JOIN_MSG, /* 510 */ DLM_QUERY_JOIN_MSG = 510,
DLM_ASSERT_JOINED_MSG, /* 511 */ DLM_ASSERT_JOINED_MSG = 511,
DLM_CANCEL_JOIN_MSG, /* 512 */ DLM_CANCEL_JOIN_MSG = 512,
DLM_EXIT_DOMAIN_MSG, /* 513 */ DLM_EXIT_DOMAIN_MSG = 513,
DLM_MASTER_REQUERY_MSG, /* 514 */ DLM_MASTER_REQUERY_MSG = 514,
DLM_LOCK_REQUEST_MSG, /* 515 */ DLM_LOCK_REQUEST_MSG = 515,
DLM_RECO_DATA_DONE_MSG, /* 516 */ DLM_RECO_DATA_DONE_MSG = 516,
DLM_BEGIN_RECO_MSG, /* 517 */ DLM_BEGIN_RECO_MSG = 517,
DLM_FINALIZE_RECO_MSG, /* 518 */ DLM_FINALIZE_RECO_MSG = 518,
DLM_QUERY_REGION, /* 519 */ DLM_QUERY_REGION = 519,
DLM_QUERY_NODEINFO, /* 520 */ DLM_QUERY_NODEINFO = 520,
}; };
struct dlm_reco_node_data struct dlm_reco_node_data
...@@ -460,19 +460,19 @@ struct dlm_reco_node_data ...@@ -460,19 +460,19 @@ struct dlm_reco_node_data
enum { enum {
DLM_RECO_NODE_DATA_DEAD = -1, DLM_RECO_NODE_DATA_DEAD = -1,
DLM_RECO_NODE_DATA_INIT = 0, DLM_RECO_NODE_DATA_INIT = 0,
DLM_RECO_NODE_DATA_REQUESTING, DLM_RECO_NODE_DATA_REQUESTING = 1,
DLM_RECO_NODE_DATA_REQUESTED, DLM_RECO_NODE_DATA_REQUESTED = 2,
DLM_RECO_NODE_DATA_RECEIVING, DLM_RECO_NODE_DATA_RECEIVING = 3,
DLM_RECO_NODE_DATA_DONE, DLM_RECO_NODE_DATA_DONE = 4,
DLM_RECO_NODE_DATA_FINALIZE_SENT, DLM_RECO_NODE_DATA_FINALIZE_SENT = 5,
}; };
enum { enum {
DLM_MASTER_RESP_NO = 0, DLM_MASTER_RESP_NO = 0,
DLM_MASTER_RESP_YES, DLM_MASTER_RESP_YES = 1,
DLM_MASTER_RESP_MAYBE, DLM_MASTER_RESP_MAYBE = 2,
DLM_MASTER_RESP_ERROR DLM_MASTER_RESP_ERROR = 3,
}; };
...@@ -649,9 +649,9 @@ struct dlm_proxy_ast ...@@ -649,9 +649,9 @@ struct dlm_proxy_ast
#define DLM_MOD_KEY (0x666c6172) #define DLM_MOD_KEY (0x666c6172)
enum dlm_query_join_response_code { enum dlm_query_join_response_code {
JOIN_DISALLOW = 0, JOIN_DISALLOW = 0,
JOIN_OK, JOIN_OK = 1,
JOIN_OK_NO_MAP, JOIN_OK_NO_MAP = 2,
JOIN_PROTOCOL_MISMATCH, JOIN_PROTOCOL_MISMATCH = 3,
}; };
struct dlm_query_join_packet { struct dlm_query_join_packet {
......
This diff is collapsed.
...@@ -37,11 +37,6 @@ struct dlm_debug_ctxt { ...@@ -37,11 +37,6 @@ struct dlm_debug_ctxt {
struct dentry *debug_purgelist_dentry; struct dentry *debug_purgelist_dentry;
}; };
struct debug_buffer {
int len;
char *buf;
};
struct debug_lockres { struct debug_lockres {
int dl_len; int dl_len;
char *dl_buf; char *dl_buf;
......
...@@ -460,8 +460,6 @@ static int dlm_migrate_all_locks(struct dlm_ctxt *dlm) ...@@ -460,8 +460,6 @@ static int dlm_migrate_all_locks(struct dlm_ctxt *dlm)
} }
cond_resched_lock(&dlm->spinlock); cond_resched_lock(&dlm->spinlock);
num += n; num += n;
mlog(0, "%s: touched %d lockreses in bucket %d "
"(tot=%d)\n", dlm->name, n, i, num);
} }
spin_unlock(&dlm->spinlock); spin_unlock(&dlm->spinlock);
wake_up(&dlm->dlm_thread_wq); wake_up(&dlm->dlm_thread_wq);
...@@ -1661,8 +1659,8 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm) ...@@ -1661,8 +1659,8 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm)
static void dlm_unregister_domain_handlers(struct dlm_ctxt *dlm) static void dlm_unregister_domain_handlers(struct dlm_ctxt *dlm)
{ {
o2hb_unregister_callback(NULL, &dlm->dlm_hb_up); o2hb_unregister_callback(dlm->name, &dlm->dlm_hb_up);
o2hb_unregister_callback(NULL, &dlm->dlm_hb_down); o2hb_unregister_callback(dlm->name, &dlm->dlm_hb_down);
o2net_unregister_handler_list(&dlm->dlm_domain_handlers); o2net_unregister_handler_list(&dlm->dlm_domain_handlers);
} }
...@@ -1674,13 +1672,13 @@ static int dlm_register_domain_handlers(struct dlm_ctxt *dlm) ...@@ -1674,13 +1672,13 @@ static int dlm_register_domain_handlers(struct dlm_ctxt *dlm)
o2hb_setup_callback(&dlm->dlm_hb_down, O2HB_NODE_DOWN_CB, o2hb_setup_callback(&dlm->dlm_hb_down, O2HB_NODE_DOWN_CB,
dlm_hb_node_down_cb, dlm, DLM_HB_NODE_DOWN_PRI); dlm_hb_node_down_cb, dlm, DLM_HB_NODE_DOWN_PRI);
status = o2hb_register_callback(NULL, &dlm->dlm_hb_down); status = o2hb_register_callback(dlm->name, &dlm->dlm_hb_down);
if (status) if (status)
goto bail; goto bail;
o2hb_setup_callback(&dlm->dlm_hb_up, O2HB_NODE_UP_CB, o2hb_setup_callback(&dlm->dlm_hb_up, O2HB_NODE_UP_CB,
dlm_hb_node_up_cb, dlm, DLM_HB_NODE_UP_PRI); dlm_hb_node_up_cb, dlm, DLM_HB_NODE_UP_PRI);
status = o2hb_register_callback(NULL, &dlm->dlm_hb_up); status = o2hb_register_callback(dlm->name, &dlm->dlm_hb_up);
if (status) if (status)
goto bail; goto bail;
......
...@@ -106,6 +106,9 @@ static int dlm_can_grant_new_lock(struct dlm_lock_resource *res, ...@@ -106,6 +106,9 @@ static int dlm_can_grant_new_lock(struct dlm_lock_resource *res,
if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type)) if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type))
return 0; return 0;
if (!dlm_lock_compatible(tmplock->ml.convert_type,
lock->ml.type))
return 0;
} }
return 1; return 1;
......
This diff is collapsed.
...@@ -1017,8 +1017,11 @@ static int ocfs2_double_lock(struct ocfs2_super *osb, ...@@ -1017,8 +1017,11 @@ static int ocfs2_double_lock(struct ocfs2_super *osb,
* An error return must mean that no cluster locks * An error return must mean that no cluster locks
* were held on function exit. * were held on function exit.
*/ */
if (oi1->ip_blkno != oi2->ip_blkno) if (oi1->ip_blkno != oi2->ip_blkno) {
ocfs2_inode_unlock(inode2, 1); ocfs2_inode_unlock(inode2, 1);
brelse(*bh2);
*bh2 = NULL;
}
if (status != -ENOENT) if (status != -ENOENT)
mlog_errno(status); mlog_errno(status);
......
...@@ -420,6 +420,11 @@ struct ocfs2_super ...@@ -420,6 +420,11 @@ struct ocfs2_super
struct inode *osb_tl_inode; struct inode *osb_tl_inode;
struct buffer_head *osb_tl_bh; struct buffer_head *osb_tl_bh;
struct delayed_work osb_truncate_log_wq; struct delayed_work osb_truncate_log_wq;
/*
* How many clusters in our truncate log.
* It must be protected by osb_tl_inode->i_mutex.
*/
unsigned int truncated_clusters;
struct ocfs2_node_map osb_recovering_orphan_dirs; struct ocfs2_node_map osb_recovering_orphan_dirs;
unsigned int *osb_orphan_wipes; unsigned int *osb_orphan_wipes;
......
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