From 0abd6d1803b01c741430af270026d1d95a103d9c Mon Sep 17 00:00:00 2001 From: Mark Fasheh Date: Tue, 29 Jan 2008 16:59:56 -0800 Subject: ocfs2: Fill node number during cluster stack init It doesn't make sense to query for a node number before connecting to the cluster stack. This should be safe to do because node_num is only just printed, and we're actually only moving the setting of node num a small amount further in the mount process. [ Disconnect when node query fails -- Joel ] Reviewed-by: Joel Becker Signed-off-by: Mark Fasheh --- fs/ocfs2/dlmglue.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'fs/ocfs2/dlmglue.c') diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 05fd016ba4b..c7653bb343e 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -2459,8 +2459,10 @@ int ocfs2_dlm_init(struct ocfs2_super *osb) mlog_entry_void(); - if (ocfs2_mount_local(osb)) + if (ocfs2_mount_local(osb)) { + osb->node_num = 0; goto local; + } status = ocfs2_dlm_init_debug(osb); if (status < 0) { @@ -2487,6 +2489,15 @@ int ocfs2_dlm_init(struct ocfs2_super *osb) goto bail; } + status = ocfs2_cluster_this_node(&osb->node_num); + if (status < 0) { + mlog_errno(status); + mlog(ML_ERROR, + "could not find this host's node number\n"); + ocfs2_cluster_disconnect(conn); + goto bail; + } + local: ocfs2_super_lock_res_init(&osb->osb_super_lockres, osb); ocfs2_rename_lock_res_init(&osb->osb_rename_lockres, osb); -- cgit v1.2.3