ceph: properly handle statfs on multifs setups
authorJeff Layton <jlayton@kernel.org>
Tue, 5 Oct 2021 15:12:58 +0000 (11:12 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 8 Nov 2021 02:29:52 +0000 (03:29 +0100)
commit8cfc0c7ed34f7929ce7e5d7c6eecf4d01ba89a84
treec02fbc12c15eaca98eee0a01b303a374c9f3b3a5
parent631ed4b082872767412cda8a941af832f227335c
ceph: properly handle statfs on multifs setups

ceph_statfs currently stuffs the cluster fsid into the f_fsid field.
This was fine when we only had a single filesystem per cluster, but now
that we have multiples we need to use something that will vary between
them.

Change ceph_statfs to xor each 32-bit chunk of the fsid (aka cluster id)
into the lower bits of the statfs->f_fsid. Change the lower bits to hold
the fscid (filesystem ID within the cluster).

That should give us a value that is guaranteed to be unique between
filesystems within a cluster, and should minimize the chance of
collisions between mounts of different clusters.

URL: https://tracker.ceph.com/issues/52812
Reported-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/super.c