From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2065C30FA7 for ; Wed, 20 Sep 2023 12:27:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F146C433C7; Wed, 20 Sep 2023 12:27:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695212867; bh=Zi6BEGV7YyeqlKMKDRRYVaCAOTxPti04IHSU/6t5Umo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B0+7njSpqx+bSzLLcKfB0j768QiaFCBuA5dNR9YTzgY0+Pu4HuquoexeyuDZpjiyb gHSz9KsEGq0zjngu5jkI+AfbKchjYgdVO0iYwA+jHw6r4YetGZenuv5cBYc2NIIWFg aNb6V9iQ2t6Kf1ZsTIu+iyECI+bb95yUO+QG6bHw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Artem Chernyshev , Joseph Qi , Joel Becker , Kurt Hackel , Mark Fasheh , Junxiao Bi , Changwei Ge , Gang He , Jun Piao , Andrew Morton , Sasha Levin Subject: [PATCH 5.4 075/367] fs: ocfs2: namei: check return value of ocfs2_add_entry() Date: Wed, 20 Sep 2023 13:27:32 +0200 Message-ID: <20230920112900.473368466@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112858.471730572@linuxfoundation.org> References: <20230920112858.471730572@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Artem Chernyshev [ Upstream commit 6b72e5f9e79360fce4f2be7fe81159fbdf4256a5 ] Process result of ocfs2_add_entry() in case we have an error value. Found by Linux Verification Center (linuxtesting.org) with SVACE. Link: https://lkml.kernel.org/r/20230803145417.177649-1-artem.chernyshev@red-soft.ru Fixes: ccd979bdbce9 ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem") Signed-off-by: Artem Chernyshev Reviewed-by: Joseph Qi Cc: Artem Chernyshev Cc: Joel Becker Cc: Kurt Hackel Cc: Mark Fasheh Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- fs/ocfs2/namei.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index fb284bf3aed15..cd6a214398266 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -1524,6 +1524,10 @@ static int ocfs2_rename(struct inode *old_dir, status = ocfs2_add_entry(handle, new_dentry, old_inode, OCFS2_I(old_inode)->ip_blkno, new_dir_bh, &target_insert); + if (status < 0) { + mlog_errno(status); + goto bail; + } } old_inode->i_ctime = current_time(old_inode); -- 2.40.1