ovl: let helper ovl_i_path_real() return the realinode
authorZhihao Cheng <chengzhihao1@huawei.com>
Mon, 17 Jul 2023 03:09:03 +0000 (11:09 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 23 Jul 2023 11:49:28 +0000 (13:49 +0200)
commit06b3f0bf418a7b6c266a589ef0516e6a99bc4fab
tree835f341c1c9d71412c064ef76c056b7dffe07604
parent000a9a72efa4a9df289bab9c9e8ba1639c72e0d6
ovl: let helper ovl_i_path_real() return the realinode

[ Upstream commit b2dd05f107b11966e26fe52a313b418364cf497b ]

Let helper ovl_i_path_real() return the realinode to prepare for
checking non-null realinode in RCU walking path.

[msz] Use d_inode_rcu() since we are depending on the consitency
between dentry and inode being non-NULL in an RCU setting.

There are some changes from upstream commit:
1. Context conflicts caused by 73db6a063c785bc ("ovl: port to
   vfs{g,u}id_t and associated helpers") is handled.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Fixes: ffa5723c6d25 ("ovl: store lower path in ovl_inode")
Cc: <stable@vger.kernel.org> # v5.19
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/overlayfs/overlayfs.h
fs/overlayfs/util.c