|
21 | 21 | M0_SRC_DIR=`readlink -f $0` |
22 | 22 | M0_SRC_DIR=${M0_SRC_DIR%/*/*/*} |
23 | 23 |
|
24 | | -. $M0_SRC_DIR/utils/functions # die, sandbox_init, report_and_exit |
25 | | -. $M0_SRC_DIR/m0t1fs/linux_kernel/st/common.sh |
26 | | -. $M0_SRC_DIR/m0t1fs/linux_kernel/st/m0t1fs_common_inc.sh |
27 | | -. $M0_SRC_DIR/m0t1fs/linux_kernel/st/m0t1fs_client_inc.sh |
28 | | -. $M0_SRC_DIR/m0t1fs/linux_kernel/st/m0t1fs_server_inc.sh |
29 | | -. $M0_SRC_DIR/m0t1fs/linux_kernel/st/common_service_fids_inc.sh |
30 | | -. $M0_SRC_DIR/m0t1fs/linux_kernel/st/m0t1fs_sns_common_inc.sh |
| 24 | +. "$M0_SRC_DIR"/utils/functions # die, sandbox_init, report_and_exit |
| 25 | +. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/common.sh |
| 26 | +. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/m0t1fs_common_inc.sh |
| 27 | +. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/m0t1fs_client_inc.sh |
| 28 | +. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/m0t1fs_server_inc.sh |
| 29 | +. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/common_service_fids_inc.sh |
| 30 | +. "$M0_SRC_DIR"/m0t1fs/linux_kernel/st/m0t1fs_sns_common_inc.sh |
31 | 31 |
|
32 | 32 | ################################################### |
33 | 33 | # SNS repair is only supported in COPYTOOL mode, |
@@ -91,8 +91,8 @@ verify() |
91 | 91 | { |
92 | 92 | echo "verifying ..." |
93 | 93 | for ((i=0; i < ${#files[*]}; i++)) ; do |
94 | | - local_read $((${unit_size[$i]} * 1024)) ${file_size[$i]} || return $? |
95 | | - read_and_verify ${files[$i]} $((${unit_size[$i]} * 1024)) ${file_size[$i]} || return $? |
| 94 | + local_read $((${unit_size[$i]} * 1024)) "${file_size[$i]}" || return $? |
| 95 | + read_and_verify "${files[$i]}" $((${unit_size[$i]} * 1024)) "${file_size[$i]}" || return $? |
96 | 96 | done |
97 | 97 |
|
98 | 98 | echo "file verification sucess" |
@@ -131,28 +131,28 @@ spiel_prepare() |
131 | 131 | export SPIEL_OPTS=$SPIEL_OPTS |
132 | 132 | export SPIEL_FIDS_LIST=$SPIEL_FIDS_LIST |
133 | 133 |
|
134 | | - echo SPIEL_OPTS=$SPIEL_OPTS |
135 | | - echo SPIEL_FIDS_LIST=$SPIEL_FIDS_LIST |
| 134 | + echo SPIEL_OPTS="$SPIEL_OPTS" |
| 135 | + echo SPIEL_FIDS_LIST="$SPIEL_FIDS_LIST" |
136 | 136 |
|
137 | 137 | # install "motr" Python module required by m0spiel tool |
138 | | - cd $M0_SRC_DIR/utils/spiel |
| 138 | + cd "$M0_SRC_DIR"/utils/spiel |
139 | 139 | python3 setup.py install --record $PYTHON_STUFF > /dev/null ||\ |
140 | 140 | die 'Cannot install Python "motr" module' |
141 | 141 | cd - |
142 | 142 | } |
143 | 143 |
|
144 | 144 | spiel_cleanup() |
145 | 145 | { |
146 | | - cd $M0_SRC_DIR/utils/spiel |
| 146 | + cd "$M0_SRC_DIR"/utils/spiel |
147 | 147 | cat $PYTHON_STUFF | xargs rm -rf |
148 | 148 | rm -rf build/ $PYTHON_STUFF |
149 | 149 | cd - |
150 | 150 | } |
151 | 151 |
|
152 | 152 | spiel_sns_repair_start() |
153 | 153 | { |
154 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
155 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 154 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 155 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
156 | 156 | $SPIEL_FIDS_LIST |
157 | 157 |
|
158 | 158 | $SPIEL_RCONF_START |
|
166 | 166 |
|
167 | 167 | spiel_sns_repair_abort() |
168 | 168 | { |
169 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
170 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 169 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 170 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
171 | 171 | $SPIEL_FIDS_LIST |
172 | 172 |
|
173 | 173 | $SPIEL_RCONF_START |
|
181 | 181 |
|
182 | 182 | spiel_sns_repair_quiesce() |
183 | 183 | { |
184 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
185 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 184 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 185 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
186 | 186 | $SPIEL_FIDS_LIST |
187 | 187 |
|
188 | 188 | $SPIEL_RCONF_START |
|
196 | 196 |
|
197 | 197 | spiel_sns_repair_continue() |
198 | 198 | { |
199 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
200 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 199 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 200 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
201 | 201 | $SPIEL_FIDS_LIST |
202 | 202 |
|
203 | 203 | $SPIEL_RCONF_START |
|
211 | 211 |
|
212 | 212 | spiel_wait_for_sns_repair() |
213 | 213 | { |
214 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
215 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 214 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 215 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
216 | 216 | import time |
217 | 217 | $SPIEL_FIDS_LIST |
218 | 218 |
|
|
240 | 240 |
|
241 | 241 | spiel_sns_rebalance_start() |
242 | 242 | { |
243 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
244 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 243 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 244 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
245 | 245 | $SPIEL_FIDS_LIST |
246 | 246 |
|
247 | 247 | $SPIEL_RCONF_START |
|
255 | 255 |
|
256 | 256 | spiel_sns_rebalance_quiesce() |
257 | 257 | { |
258 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
259 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 258 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 259 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
260 | 260 | $SPIEL_FIDS_LIST |
261 | 261 |
|
262 | 262 | $SPIEL_RCONF_START |
|
270 | 270 |
|
271 | 271 | spiel_sns_rebalance_continue() |
272 | 272 | { |
273 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
274 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 273 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 274 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
275 | 275 | $SPIEL_FIDS_LIST |
276 | 276 |
|
277 | 277 | $SPIEL_RCONF_START |
|
285 | 285 |
|
286 | 286 | spiel_wait_for_sns_rebalance() |
287 | 287 | { |
288 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
289 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 288 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 289 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
290 | 290 | import time |
291 | 291 | $SPIEL_FIDS_LIST |
292 | 292 |
|
|
314 | 314 |
|
315 | 315 | spiel_sns_rebalance_abort() |
316 | 316 | { |
317 | | -echo $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS |
318 | | - $M0_SRC_DIR/utils/spiel/m0spiel $SPIEL_OPTS <<EOF |
| 317 | +echo "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" |
| 318 | + "$M0_SRC_DIR"/utils/spiel/m0spiel "$SPIEL_OPTS" <<EOF |
319 | 319 | $SPIEL_FIDS_LIST |
320 | 320 |
|
321 | 321 | $SPIEL_RCONF_START |
|
0 commit comments