ceph: clear inode pointer when snap realm gets dropped by its inode
authorYan, Zheng <zyan@redhat.com>
Thu, 10 Jan 2019 07:41:09 +0000 (15:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:14:34 +0000 (08:14 +0100)
commit3e05ceedf1439eea0a1306e30935ef5ee65e5d4f
tree1934655dfddfff9794fca48809e1bed9b497bf7e
parent8e7320b9f55159f8e006eadfb3b767407d3a8fe5
ceph: clear inode pointer when snap realm gets dropped by its inode

commit d95e674c01cfb5461e8b9fdeebf6d878c9b80b2f upstream.

snap realm and corresponding inode have pointers to each other.
The two pointer should get clear at the same time. Otherwise,
snap realm's pointer may reference freed inode.

Cc: stable@vger.kernel.org # 4.17+
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Luis Henriques <lhenriques@suse.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ceph/caps.c