Whamcloud - gitweb
LU-13577 wbc: theoretical link with missing destination 16/55016/2
authorShaun Tancheff <shaun.tancheff@hpe.com>
Mon, 6 May 2024 06:14:43 +0000 (13:14 +0700)
committerOleg Drokin <green@whamcloud.com>
Mon, 10 Jun 2024 06:12:21 +0000 (06:12 +0000)
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 <shaun.tancheff@hpe.com>
Change-Id: I2a41d1a37820a3bc7b06dff42a4cc09386a88820
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55016
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/namei.c

index 35a2d11..cb58d58 100644 (file)
@@ -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