From: Shaun Tancheff Date: Mon, 6 May 2024 06:14:43 +0000 (+0700) Subject: LU-13577 wbc: theoretical link with missing destination X-Git-Tag: 2.15.64~93 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5ed290a235d3479fda3279bf3386f016aade9ba5;p=fs%2Flustre-release.git LU-13577 wbc: theoretical link with missing destination While unlikely it would be possible so return -EINVAL here CoverityID: 425353 ("Null pointer dereferences (FORWARD NULL)") Fixes: 668dfb53de ("LU-13577 wbc: reimplement mkdir() by using intent lock") Signed-off-by: Shaun Tancheff Change-Id: I2a41d1a37820a3bc7b06dff42a4cc09386a88820 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55016 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Arshad Hussain Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 35a2d11..cb58d58 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -1660,6 +1660,8 @@ static int ll_new_node_prepare(struct inode *dir, struct dentry *dchild, if (!fakeinode) GOTO(err_exit, err = -ENOMEM); + if (!disk_link) + GOTO(err_exit, err = -EINVAL); fakeinode->i_sb = dchild->d_sb; fakeinode->i_mode |= S_IFLNK; #ifdef IOP_XATTR