summaryrefslogtreecommitdiff
path: root/fs/ceph/strings.c
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2019-12-20 17:34:04 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-13 11:48:11 +0300
commit56385788f7f6ce5389030a7cc72c54a461b85224 (patch)
tree5f29ddeb062eba4cd40a1e8a31f915abb166ba2f /fs/ceph/strings.c
parent7dafb2c6fb46166af9fa4c3c57493a48f6ff2950 (diff)
downloadlinux-56385788f7f6ce5389030a7cc72c54a461b85224.tar.xz
ceph: remove the extra slashes in the server path
commit 4fbc0c711b2464ee1551850b85002faae0b775d5 upstream. It's possible to pass the mount helper a server path that has more than one contiguous slash character. For example: $ mount -t ceph 192.168.195.165:40176:/// /mnt/cephfs/ In the MDS server side the extra slashes of the server path will be treated as snap dir, and then we can get the following debug logs: ceph: mount opening path // ceph: open_root_inode opening '//' ceph: fill_trace 0000000059b8a3bc is_dentry 0 is_target 1 ceph: alloc_inode 00000000dc4ca00b ceph: get_inode created new inode 00000000dc4ca00b 1.ffffffffffffffff ino 1 ceph: get_inode on 1=1.ffffffffffffffff got 00000000dc4ca00b And then when creating any new file or directory under the mount point, we can hit the following BUG_ON in ceph_fill_trace(): BUG_ON(ceph_snap(dir) != dvino.snap); Have the client ignore the extra slashes in the server path when mounting. This will also canonicalize the path, so that identical mounts can be consilidated. 1) "//mydir1///mydir//" 2) "/mydir1/mydir" 3) "/mydir1/mydir/" Regardless of the internal treatment of these paths, the kernel still stores the original string including the leading '/' for presentation to userland. URL: https://tracker.ceph.com/issues/42771 Signed-off-by: Xiubo Li <xiubli@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Luis Henriques <lhenriques@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ceph/strings.c')
0 files changed, 0 insertions, 0 deletions