aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm/dlmrecovery.c
diff options
context:
space:
mode:
authorKurt Hackel <kurt.hackel@oracle.com>2007-01-17 18:11:36 -0500
committerMark Fasheh <mark.fasheh@oracle.com>2007-02-07 15:06:24 -0500
commit74aa25856c693d20a886cdb31a004aaca411d135 (patch)
treeea833f164771279a3141668e537e316c21027387 /fs/ocfs2/dlm/dlmrecovery.c
parent90aaaf1c235a70daee04e897e9501415b766de69 (diff)
ocfs2_dlm: Cookies in locks not being printed correctly in error messages
The dlm encodes the node number and a sequence number in the lock cookie. It also stores the cookie in the lockres in the big endian format to avoid swapping 8 bytes on each lock request. The bug here was that it was assuming the cookie to be in the cpu format when decoding it for printing the error message. This patch swaps the bytes before the print. Signed-off-by: Kurt Hackel <kurt.hackel@oracle.com> Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/dlm/dlmrecovery.c')
-rw-r--r--fs/ocfs2/dlm/dlmrecovery.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index e57636c399f4..38d714645309 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -1766,8 +1766,8 @@ static int dlm_process_recovery_data(struct dlm_ctxt *dlm,
1766 u64 c = ml->cookie; 1766 u64 c = ml->cookie;
1767 mlog(ML_ERROR, "could not find local lock " 1767 mlog(ML_ERROR, "could not find local lock "
1768 "with cookie %u:%llu!\n", 1768 "with cookie %u:%llu!\n",
1769 dlm_get_lock_cookie_node(c), 1769 dlm_get_lock_cookie_node(be64_to_cpu(c)),
1770 dlm_get_lock_cookie_seq(c)); 1770 dlm_get_lock_cookie_seq(be64_to_cpu(c)));
1771 __dlm_print_one_lock_resource(res); 1771 __dlm_print_one_lock_resource(res);
1772 BUG(); 1772 BUG();
1773 } 1773 }
@@ -1876,14 +1876,14 @@ skip_lvb:
1876 mlog(ML_ERROR, "%s:%.*s: %u:%llu: lock already " 1876 mlog(ML_ERROR, "%s:%.*s: %u:%llu: lock already "
1877 "exists on this lockres!\n", dlm->name, 1877 "exists on this lockres!\n", dlm->name,
1878 res->lockname.len, res->lockname.name, 1878 res->lockname.len, res->lockname.name,
1879 dlm_get_lock_cookie_node(c), 1879 dlm_get_lock_cookie_node(be64_to_cpu(c)),
1880 dlm_get_lock_cookie_seq(c)); 1880 dlm_get_lock_cookie_seq(be64_to_cpu(c)));
1881 1881
1882 mlog(ML_NOTICE, "sent lock: type=%d, conv=%d, " 1882 mlog(ML_NOTICE, "sent lock: type=%d, conv=%d, "
1883 "node=%u, cookie=%u:%llu, queue=%d\n", 1883 "node=%u, cookie=%u:%llu, queue=%d\n",
1884 ml->type, ml->convert_type, ml->node, 1884 ml->type, ml->convert_type, ml->node,
1885 dlm_get_lock_cookie_node(ml->cookie), 1885 dlm_get_lock_cookie_node(be64_to_cpu(ml->cookie)),
1886 dlm_get_lock_cookie_seq(ml->cookie), 1886 dlm_get_lock_cookie_seq(be64_to_cpu(ml->cookie)),
1887 ml->list); 1887 ml->list);
1888 1888
1889 __dlm_print_one_lock_resource(res); 1889 __dlm_print_one_lock_resource(res);