From 675275fbf1693522d050bda97f91fbdd3f68ff2f Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 20 Nov 2018 10:06:50 -0800 Subject: [PATCH] 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 --- kmod/src/client.c | 6 +++--- kmod/src/server.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kmod/src/client.c b/kmod/src/client.c index 81603385..11bd1fe7 100644 --- a/kmod/src/client.c +++ b/kmod/src/client.c @@ -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); diff --git a/kmod/src/server.c b/kmod/src/server.c index fba4f9eb..e8d4d42f 100644 --- a/kmod/src/server.c +++ b/kmod/src/server.c @@ -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: