]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: canonicalize server path in place
authorIlya Dryomov <idryomov@gmail.com>
Mon, 10 Feb 2020 21:51:08 +0000 (22:51 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 11 Feb 2020 16:04:40 +0000 (17:04 +0100)
commit21e978f824ebebfbc89899c91bfa532acb79f7b8
tree6c72dedbdfa517d8d8ef45768dd8015538ad3f5a
parent2e53f563d9bfe3d438eca66aa58ae5b13b8c8009
ceph: canonicalize server path in place

syzbot reported that 458797c4c569 ("ceph: remove the extra slashes in
the server path") had caused a regression where an allocation could be
done under a spinlock -- compare_mount_options() is called by sget_fc()
with sb_lock held.

We don't really need the supplied server path, so canonicalize it
in place and compare it directly.  To make this work, the leading
slash is kept around and the logic in ceph_real_mount() to skip it
is restored.  CEPH_MSG_CLIENT_SESSION now reports the same (i.e.
canonicalized) path, with the leading slash of course.

Fixes: 458797c4c569 ("ceph: remove the extra slashes in the server path")
Reported-by: syzbot+98704a51af8e3d9425a9@syzkaller.appspotmail.com
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/super.c
fs/ceph/super.h