mirror of
https://github.com/versity/scoutfs.git
synced 2026-01-08 21:03:12 +00:00
Have quorum drop messages on force unmount
Forced unmount is supposed to isolate the mount from the world. The net.c TCP messaging returns errors when sending during forced unmount. The quorum code has its own UDP messaging and wasn't taking forced unmount into account. This lead to quorum still being able to send resignation messages to other quorum peers during forced unmount, making it hard to test heartbeat timeouts with forced unmount. The quorum messaging is already unreliable so we can easily make it drop messages during forced unmount. Now forced unmount more fully isolates the quorum code and it becomes easier to test. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -259,6 +259,11 @@ static int send_msg_members(struct super_block *sb, int type, u64 term, int only
|
||||
(only >= 0 && i != only) || i == qinf->our_quorum_slot_nr)
|
||||
continue;
|
||||
|
||||
if (scoutfs_forcing_unmount(sb)) {
|
||||
failed = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
scoutfs_quorum_slot_sin(&qinf->qconf, i, &sin);
|
||||
now = ktime_get();
|
||||
ret = kernel_sendmsg(qinf->sock, &mh, &kv, 1, kv.iov_len);
|
||||
@@ -330,6 +335,9 @@ static int recv_msg(struct super_block *sb, struct quorum_host_msg *msg,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (scoutfs_forcing_unmount(sb))
|
||||
return 0;
|
||||
|
||||
now = ktime_get();
|
||||
|
||||
if (ret != sizeof(qmes) ||
|
||||
|
||||
Reference in New Issue
Block a user