diff options
author | Mark Fasheh <mfasheh@suse.com> | 2008-01-29 19:59:56 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-04-18 11:56:04 -0400 |
commit | 0abd6d1803b01c741430af270026d1d95a103d9c (patch) | |
tree | c1aca3d286990be6f9043e28ad0bacaf3443ef54 /fs | |
parent | 6953b4c008628b945bfe0cee97f6e78a98773859 (diff) |
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 <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/dlmglue.c | 13 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 33 |
2 files changed, 12 insertions, 34 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 05fd016ba4bf..c7653bb343e1 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -2459,8 +2459,10 @@ int ocfs2_dlm_init(struct ocfs2_super *osb) | |||
2459 | 2459 | ||
2460 | mlog_entry_void(); | 2460 | mlog_entry_void(); |
2461 | 2461 | ||
2462 | if (ocfs2_mount_local(osb)) | 2462 | if (ocfs2_mount_local(osb)) { |
2463 | osb->node_num = 0; | ||
2463 | goto local; | 2464 | goto local; |
2465 | } | ||
2464 | 2466 | ||
2465 | status = ocfs2_dlm_init_debug(osb); | 2467 | status = ocfs2_dlm_init_debug(osb); |
2466 | if (status < 0) { | 2468 | if (status < 0) { |
@@ -2487,6 +2489,15 @@ int ocfs2_dlm_init(struct ocfs2_super *osb) | |||
2487 | goto bail; | 2489 | goto bail; |
2488 | } | 2490 | } |
2489 | 2491 | ||
2492 | status = ocfs2_cluster_this_node(&osb->node_num); | ||
2493 | if (status < 0) { | ||
2494 | mlog_errno(status); | ||
2495 | mlog(ML_ERROR, | ||
2496 | "could not find this host's node number\n"); | ||
2497 | ocfs2_cluster_disconnect(conn); | ||
2498 | goto bail; | ||
2499 | } | ||
2500 | |||
2490 | local: | 2501 | local: |
2491 | ocfs2_super_lock_res_init(&osb->osb_super_lockres, osb); | 2502 | ocfs2_super_lock_res_init(&osb->osb_super_lockres, osb); |
2492 | ocfs2_rename_lock_res_init(&osb->osb_rename_lockres, osb); | 2503 | ocfs2_rename_lock_res_init(&osb->osb_rename_lockres, osb); |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 8f536b39ce5b..fa9c46e2eab8 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -108,7 +108,6 @@ static int ocfs2_sync_fs(struct super_block *sb, int wait); | |||
108 | static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb); | 108 | static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb); |
109 | static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb); | 109 | static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb); |
110 | static void ocfs2_release_system_inodes(struct ocfs2_super *osb); | 110 | static void ocfs2_release_system_inodes(struct ocfs2_super *osb); |
111 | static int ocfs2_fill_local_node_info(struct ocfs2_super *osb); | ||
112 | static int ocfs2_check_volume(struct ocfs2_super *osb); | 111 | static int ocfs2_check_volume(struct ocfs2_super *osb); |
113 | static int ocfs2_verify_volume(struct ocfs2_dinode *di, | 112 | static int ocfs2_verify_volume(struct ocfs2_dinode *di, |
114 | struct buffer_head *bh, | 113 | struct buffer_head *bh, |
@@ -1126,32 +1125,6 @@ static int ocfs2_get_sector(struct super_block *sb, | |||
1126 | return 0; | 1125 | return 0; |
1127 | } | 1126 | } |
1128 | 1127 | ||
1129 | /* ocfs2 1.0 only allows one cluster and node identity per kernel image. */ | ||
1130 | static int ocfs2_fill_local_node_info(struct ocfs2_super *osb) | ||
1131 | { | ||
1132 | int status; | ||
1133 | |||
1134 | /* XXX hold a ref on the node while mounte? easy enough, if | ||
1135 | * desirable. */ | ||
1136 | if (ocfs2_mount_local(osb)) | ||
1137 | osb->node_num = 0; | ||
1138 | else { | ||
1139 | status = ocfs2_cluster_this_node(&osb->node_num); | ||
1140 | if (status < 0) { | ||
1141 | mlog_errno(status); | ||
1142 | mlog(ML_ERROR, | ||
1143 | "could not find this host's node number\n"); | ||
1144 | goto bail; | ||
1145 | } | ||
1146 | } | ||
1147 | |||
1148 | mlog(0, "I am node %u\n", osb->node_num); | ||
1149 | |||
1150 | status = 0; | ||
1151 | bail: | ||
1152 | return status; | ||
1153 | } | ||
1154 | |||
1155 | static int ocfs2_mount_volume(struct super_block *sb) | 1128 | static int ocfs2_mount_volume(struct super_block *sb) |
1156 | { | 1129 | { |
1157 | int status = 0; | 1130 | int status = 0; |
@@ -1163,12 +1136,6 @@ static int ocfs2_mount_volume(struct super_block *sb) | |||
1163 | if (ocfs2_is_hard_readonly(osb)) | 1136 | if (ocfs2_is_hard_readonly(osb)) |
1164 | goto leave; | 1137 | goto leave; |
1165 | 1138 | ||
1166 | status = ocfs2_fill_local_node_info(osb); | ||
1167 | if (status < 0) { | ||
1168 | mlog_errno(status); | ||
1169 | goto leave; | ||
1170 | } | ||
1171 | |||
1172 | status = ocfs2_dlm_init(osb); | 1139 | status = ocfs2_dlm_init(osb); |
1173 | if (status < 0) { | 1140 | if (status < 0) { |
1174 | mlog_errno(status); | 1141 | mlog_errno(status); |