]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: don't use d_add in ceph_handle_snapdir
authorJeff Layton <jlayton@kernel.org>
Mon, 1 Mar 2021 13:01:54 +0000 (08:01 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 27 Apr 2021 21:52:23 +0000 (23:52 +0200)
commite8961c80c68bb0cac39c223ac36e0d8c31d946da
treeeab5168f12d68b2371ace2eb91a5eea95e560d7d
parent7a27b28f7c1e5cebd320aec1941684da97967d8b
ceph: don't use d_add in ceph_handle_snapdir

It's possible ceph_get_snapdir could end up finding a (disconnected)
inode that already exists in the cache. Change the prototype for
ceph_handle_snapdir to return a dentry pointer and have it use
d_splice_alias so we don't end up with an aliased dentry in the cache.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/dir.c
fs/ceph/file.c
fs/ceph/super.h