scoutfs: use hdr.fsid in greeting instead of id

The network greeting exchange was mistakenly using the global super
block magic number instead of the per-volume fsid to identify the
volumes that the endpoints are working with.  This prevented the check
from doing its only job: to fail when clients in one volume try to
connect to a server in another.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-11-20 10:06:50 -08:00
committed by Zach Brown
parent 288d781645
commit 675275fbf1
2 changed files with 6 additions and 6 deletions

View File

@@ -293,10 +293,10 @@ static int client_greeting(struct super_block *sb,
goto out;
}
if (gr->fsid != super->id) {
if (gr->fsid != super->hdr.fsid) {
scoutfs_warn(sb, "server sent fsid 0x%llx, client has 0x%llx",
le64_to_cpu(gr->fsid),
le64_to_cpu(super->id));
le64_to_cpu(super->hdr.fsid));
ret = -EINVAL;
goto out;
}
@@ -421,7 +421,7 @@ static void scoutfs_client_connect_worker(struct work_struct *work)
client->old_elected_nr = 0;
/* send a greeting to verify endpoints of each connection */
greet.fsid = super->id;
greet.fsid = super->hdr.fsid;
greet.format_hash = super->format_hash;
greet.node_id = cpu_to_le64(sbi->node_id);

View File

@@ -1095,10 +1095,10 @@ static int server_greeting(struct super_block *sb,
goto out;
}
if (gr->fsid != super->id) {
if (gr->fsid != super->hdr.fsid) {
scoutfs_warn(sb, "client sent fsid 0x%llx, server has 0x%llx",
le64_to_cpu(gr->fsid),
le64_to_cpu(super->id));
le64_to_cpu(super->hdr.fsid));
ret = -EINVAL;
goto out;
}
@@ -1128,7 +1128,7 @@ static int server_greeting(struct super_block *sb,
node_id = gr->node_id;
}
greet.fsid = super->id;
greet.fsid = super->hdr.fsid;
greet.format_hash = super->format_hash;
greet.node_id = node_id;
out: