| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* -*- mode: c; c-basic-offset: 8; -*- |
|---|
| 2 | 3 | * vim: noexpandtab sw=8 ts=8 sts=0: |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * recovery stuff |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * 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 | | - * |
|---|
| 25 | 10 | */ |
|---|
| 26 | 11 | |
|---|
| 27 | 12 | |
|---|
| .. | .. |
|---|
| 41 | 26 | #include <linux/delay.h> |
|---|
| 42 | 27 | |
|---|
| 43 | 28 | |
|---|
| 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" |
|---|
| 47 | 32 | |
|---|
| 48 | 33 | #include "dlmapi.h" |
|---|
| 49 | 34 | #include "dlmcommon.h" |
|---|
| 50 | 35 | #include "dlmdomain.h" |
|---|
| 51 | 36 | |
|---|
| 52 | 37 | #define MLOG_MASK_PREFIX (ML_DLM|ML_DLM_RECOVERY) |
|---|
| 53 | | -#include "cluster/masklog.h" |
|---|
| 38 | +#include "../cluster/masklog.h" |
|---|
| 54 | 39 | |
|---|
| 55 | 40 | static void dlm_do_local_recovery_cleanup(struct dlm_ctxt *dlm, u8 dead_node); |
|---|
| 56 | 41 | |
|---|
| .. | .. |
|---|
| 1124 | 1109 | { |
|---|
| 1125 | 1110 | u64 mig_cookie = be64_to_cpu(mres->mig_cookie); |
|---|
| 1126 | 1111 | int mres_total_locks = be32_to_cpu(mres->total_locks); |
|---|
| 1127 | | - int sz, ret = 0, status = 0; |
|---|
| 1112 | + int ret = 0, status = 0; |
|---|
| 1128 | 1113 | u8 orig_flags = mres->flags, |
|---|
| 1129 | 1114 | orig_master = mres->master; |
|---|
| 1130 | 1115 | |
|---|
| 1131 | 1116 | BUG_ON(mres->num_locks > DLM_MAX_MIGRATABLE_LOCKS); |
|---|
| 1132 | 1117 | if (!mres->num_locks) |
|---|
| 1133 | 1118 | return 0; |
|---|
| 1134 | | - |
|---|
| 1135 | | - sz = sizeof(struct dlm_migratable_lockres) + |
|---|
| 1136 | | - (mres->num_locks * sizeof(struct dlm_migratable_lock)); |
|---|
| 1137 | 1119 | |
|---|
| 1138 | 1120 | /* add an all-done flag if we reached the last lock */ |
|---|
| 1139 | 1121 | orig_flags = mres->flags; |
|---|
| .. | .. |
|---|
| 1148 | 1130 | |
|---|
| 1149 | 1131 | /* send it */ |
|---|
| 1150 | 1132 | 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); |
|---|
| 1152 | 1135 | if (ret < 0) { |
|---|
| 1153 | 1136 | /* XXX: negative status is not handled. |
|---|
| 1154 | 1137 | * this will end up killing this node. */ |
|---|
| .. | .. |
|---|
| 1685 | 1668 | int dlm_do_master_requery(struct dlm_ctxt *dlm, struct dlm_lock_resource *res, |
|---|
| 1686 | 1669 | u8 nodenum, u8 *real_master) |
|---|
| 1687 | 1670 | { |
|---|
| 1688 | | - int ret = -EINVAL; |
|---|
| 1671 | + int ret; |
|---|
| 1689 | 1672 | struct dlm_master_requery req; |
|---|
| 1690 | 1673 | int status = DLM_LOCK_RES_OWNER_UNKNOWN; |
|---|
| 1691 | 1674 | |
|---|