@@ -769,8 +769,10 @@ int ksmbd_vfs_rename(struct ksmbd_work *work, struct path *old_path,
if (parent_fp->daccess & FILE_DELETE_LE) {
pr_err("parent dir is opened with delete access\n");
err = -ESHARE;
+ ksmbd_fd_put(work, parent_fp);
goto out5;
}
+ ksmbd_fd_put(work, parent_fp);
}
rd.old_mnt_userns = mnt_user_ns(old_path->mnt),
@@ -493,6 +493,7 @@ struct ksmbd_file *ksmbd_lookup_fd_inode(struct inode *inode)
list_for_each_entry(lfp, &ci->m_fp_list, node) {
if (inode == file_inode(lfp->filp)) {
atomic_dec(&ci->m_count);
+ lfp = ksmbd_fp_get(lfp);
read_unlock(&ci->m_lock);
return lfp;
}
Add missing increment reference count of parent fp in ksmbd_lookup_fd_inode(). Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> --- v2: - switch the order of 3/4 and 4/4 patch. fs/ksmbd/vfs.c | 2 ++ fs/ksmbd/vfs_cache.c | 1 + 2 files changed, 3 insertions(+)