Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1921893rdb; Mon, 9 Oct 2023 07:11:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2YxWJlnOniH5rOMVGU90w8F1YZJH7njdYKJ2xgnPg7T3EFQQsGN2G4fO6cylh1TwHhSZi X-Received: by 2002:a17:902:7682:b0:1c7:249f:5e33 with SMTP id m2-20020a170902768200b001c7249f5e33mr12700320pll.46.1696860697120; Mon, 09 Oct 2023 07:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696860697; cv=none; d=google.com; s=arc-20160816; b=lBlJZPSOs2Lcl/24Rzip1xVvTuY7pLEmjhE2uwpg/wb3Y/0yrvOfQjHr8mSq7PZNjs tUPpLhcrjVit56NZFM/VxCQTmft62mPnz5CvidJWZiUdK99uZI/jkRYcD7Lyrq6wT6CI 7k1Cc5Lbr511yi9AaRjmzg7m3aUgrU+hvxVvUMVLOntXChXZZ/1JWPjwk7WRY/emG7+0 agOtoSs+2PFUjEVIXtgxGb3fwYz42xdqE9L15ly2D3Cf9Yu6lceQfgb9TIJJkDem+9t/ +maYPr/hjEDC0kBt6rFOMAc6djkHqP8vjFk+duHAS242koOwZ6+zOPEuMtx1x3+5+C3C cVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3sR92u+L6cdIrAnOWxGsaQjRuXvBPHsUBDNRpqB8jH4=; fh=lH9n+hKY18nCYB+DJ30llRKnFj18cOriadg5JXkUe6A=; b=vGdYWYvISNN5fxmyOySIV+OaOaqxut/w4M85UJ+bO/IYVxdW64Wu/y5XUnTafzgoNc mCiI/iqkTsqwMalMl9n9XLQeT35+W7XYBEldcr7hj/flgZwnF075xgzEZMgQMrm1jj5H EboyCURoyNhHLtyXijur5eYsZuD+DmsoaHgFvT8Sfr1xCSGS4KOFR2AhDxTK22rKTFy4 2ES7acakW18Zl4vVlIpjtkbVTVXNLhGRtsH0lxWn6kYDK6aGqsgbYxknHu9fK/DdzZ45 vN/jFrib/ay2mLZcCcn/MWcY4qT99c4DxFAba/phw2P5UgxlxEXrIJuKN0+z67CsfjaL SY0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=red-soft.ru Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id f5-20020a170902684500b001b878f9e11csi5789492pln.54.2023.10.09.07.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 07:11:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=red-soft.ru Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id B95A880F7F20; Mon, 9 Oct 2023 07:11:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376728AbjJIOLY (ORCPT + 99 others); Mon, 9 Oct 2023 10:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346526AbjJIOLX (ORCPT ); Mon, 9 Oct 2023 10:11:23 -0400 Received: from gw.red-soft.ru (red-soft.ru [188.246.186.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 47BE091 for ; Mon, 9 Oct 2023 07:11:20 -0700 (PDT) Received: from localhost.biz (unknown [10.81.81.211]) by gw.red-soft.ru (Postfix) with ESMTPA id DFA7F3E1B16; Mon, 9 Oct 2023 17:11:16 +0300 (MSK) From: Artem Chernyshev To: Joel Becker , Mark Fasheh Cc: Artem Chernyshev , Joseph Qi , Kurt Hackel , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] fs: ocfs2: Check status values Date: Mon, 9 Oct 2023 17:11:11 +0300 Message-Id: <20231009141111.149858-1-artem.chernyshev@red-soft.ru> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 180481 [Oct 09 2023] X-KLMS-AntiSpam-Version: 5.9.59.0 X-KLMS-AntiSpam-Envelope-From: artem.chernyshev@red-soft.ru X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Auth: dkim=none X-KLMS-AntiSpam-Info: LuaCore: 536 536 1ae19c7800f69da91432b5e67ed4a00b9ade0d03, {Tracking_from_domain_doesnt_match_to}, localhost.biz:7.1.1;red-soft.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, bases: 2023/10/09 07:46:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2023/10/09 10:51:00 #22099682 X-KLMS-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 07:11:35 -0700 (PDT) X-Spam-Level: ** Test return values before overwriting. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Artem Chernyshev --- fs/ocfs2/namei.c | 8 ++++++++ fs/ocfs2/quota_local.c | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 5cd6d7771cea..836c4279a979 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -1597,6 +1597,10 @@ static int ocfs2_rename(struct mnt_idmap *idmap, if (update_dot_dot) { status = ocfs2_update_entry(old_inode, handle, &old_inode_dot_dot_res, new_dir); + if (status < 0) { + mlog_errno(status); + goto bail; + } drop_nlink(old_dir); if (new_inode) { drop_nlink(new_inode); @@ -1636,6 +1640,10 @@ static int ocfs2_rename(struct mnt_idmap *idmap, INODE_CACHE(old_dir), old_dir_bh, OCFS2_JOURNAL_ACCESS_WRITE); + if (status < 0) { + mlog_errno(status); + goto bail; + } fe = (struct ocfs2_dinode *) old_dir_bh->b_data; ocfs2_set_links_count(fe, old_dir->i_nlink); ocfs2_journal_dirty(handle, old_dir_bh); diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c index dfaae1e52412..e09842fc9d4d 100644 --- a/fs/ocfs2/quota_local.c +++ b/fs/ocfs2/quota_local.c @@ -1240,6 +1240,10 @@ int ocfs2_create_local_dquot(struct dquot *dquot) &od->dq_local_phys_blk, &pcount, NULL); + if (status < 0) { + mlog_errno(status); + goto out; + } /* Initialize dquot structure on disk */ status = ocfs2_local_write_dquot(dquot); -- 2.37.3