]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: properly handle statfs on multifs setups
authorJeff Layton <jlayton@kernel.org>
Tue, 5 Oct 2021 15:12:58 +0000 (11:12 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Dec 2021 08:04:55 +0000 (09:04 +0100)
commit29b6f832839da21105994440e0d273370d5b68a2
tree474c7d86c1b8d6f30a9e2a942ab25180739033bb
parentf936cd04ebcfd53afbe50e2f9e527c81feaee93f
ceph: properly handle statfs on multifs setups

[ Upstream commit ba13714b1fdb6007066cfd97fa5360f33edfbbbe ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/super.c