forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/fs/ocfs2/dlm/dlmrecovery.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* -*- mode: c; c-basic-offset: 8; -*-
23 * vim: noexpandtab sw=8 ts=8 sts=0:
34 *
....@@ -6,22 +7,6 @@
67 * recovery stuff
78 *
89 * Copyright (C) 2004 Oracle. All rights reserved.
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public
12
- * License as published by the Free Software Foundation; either
13
- * version 2 of the License, or (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public
21
- * License along with this program; if not, write to the
22
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23
- * Boston, MA 021110-1307, USA.
24
- *
2510 */
2611
2712
....@@ -41,16 +26,16 @@
4126 #include <linux/delay.h>
4227
4328
44
-#include "cluster/heartbeat.h"
45
-#include "cluster/nodemanager.h"
46
-#include "cluster/tcp.h"
29
+#include "../cluster/heartbeat.h"
30
+#include "../cluster/nodemanager.h"
31
+#include "../cluster/tcp.h"
4732
4833 #include "dlmapi.h"
4934 #include "dlmcommon.h"
5035 #include "dlmdomain.h"
5136
5237 #define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_RECOVERY)
53
-#include "cluster/masklog.h"
38
+#include "../cluster/masklog.h"
5439
5540 static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node);
5641
....@@ -1124,16 +1109,13 @@
11241109 {
11251110 u64 mig_cookie = be64_to_cpu(mres->mig_cookie);
11261111 int mres_total_locks = be32_to_cpu(mres->total_locks);
1127
- int sz, ret = 0, status = 0;
1112
+ int ret = 0, status = 0;
11281113 u8 orig_flags = mres->flags,
11291114 orig_master = mres->master;
11301115
11311116 BUG_ON(mres->num_locks > DLM_MAX_MIGRATABLE_LOCKS);
11321117 if (!mres->num_locks)
11331118 return 0;
1134
-
1135
- sz = sizeof(struct dlm_migratable_lockres) +
1136
- (mres->num_locks * sizeof(struct dlm_migratable_lock));
11371119
11381120 /* add an all-done flag if we reached the last lock */
11391121 orig_flags = mres->flags;
....@@ -1148,7 +1130,8 @@
11481130
11491131 /* send it */
11501132 ret = o2net_send_message(DLM_MIG_LOCKRES_MSG, dlm->key, mres,
1151
- sz, send_to, &status);
1133
+ struct_size(mres, ml, mres->num_locks),
1134
+ send_to, &status);
11521135 if (ret < 0) {
11531136 /* XXX: negative status is not handled.
11541137 * this will end up killing this node. */
....@@ -1685,7 +1668,7 @@
16851668 int dlm_do_master_requery(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
16861669 u8 nodenum, u8 *real_master)
16871670 {
1688
- int ret = -EINVAL;
1671
+ int ret;
16891672 struct dlm_master_requery req;
16901673 int status = DLM_LOCK_RES_OWNER_UNKNOWN;
16911674