author: Zhihao Cheng <chengzhihao1@huawei.com> 2023-05-16 22:16:18 +0800
committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2023-07-19 16:37:00 +0200
commit: 69f9ae7edf9ec0ff500429101923347fcba5c8c4
parent: e7c921db1739f95e495b746b8765893fa346af13
Commit Summary:
Diffstat:
1 file changed, 2 insertions, 3 deletions
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c
index 541cf3717fc2..ca56b1328a2c 100644
--- a/fs/overlayfs/inode.c
+++ b/fs/overlayfs/inode.c
@@ -288,8 +288,8 @@ int ovl_permission(struct mnt_idmap *idmap,
int err;
/* Careful in RCU walk mode */
- ovl_i_path_real(inode, &realpath);
- if (!realpath.dentry) {
+ realinode = ovl_i_path_real(inode, &realpath);
+ if (!realinode) {
WARN_ON(!(mask & MAY_NOT_BLOCK));
return -ECHILD;
}
@@ -302,7 +302,6 @@ int ovl_permission(struct mnt_idmap *idmap,
if (err)
return err;
- realinode = d_inode(realpath.dentry);
old_cred = ovl_override_creds(inode->i_sb);
if (!upperinode &&
!special_file(realinode->i_mode) && mask & MAY_WRITE) {