Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp2229653rdb; Mon, 9 Oct 2023 18:20:28 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFFWvLvxg06c82XPpS2uRftXhU+ZME46qzFzP22dGsgQEIUJUqS8S5SQPcYstcLVodyw6Mb X-Received: by 2002:a25:aa8a:0:b0:d44:a90b:ba50 with SMTP id t10-20020a25aa8a000000b00d44a90bba50mr18233585ybi.5.1696900828086; Mon, 09 Oct 2023 18:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696900828; cv=none; d=google.com; s=arc-20160816; b=q7ufo0cKnVrBPufmMSmXvoY6AmwTR+j572zJZVIW+0AuSaHc+WydoadyAbF0IVRioF lAuFyK87B0mo9OdHmu08YUx6nN5JU1NM8SZyAxc++/EpvUuZlE8H7E88M5LtDSDVCd/9 ZeMP5kE6Y9tx1C2EiGP4lfoC/VuWPxFmecIWS5ghO5bBlB/Vh0+cvV0ajKZGkvNiaBjP CEulvUCS2lRJrAvIbiBfc8OWKeXD51PmGpB+eBgQED/6d9r9lw7PUEFb8SnV0gUc62Kn HlrhhSUUws/8RsSfH2TslI/DqfUzzB5fWl48A6wtDCRmw5YRItUix/2cKdaBVz0LNf4z UR+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=sjeOiAFjIO9Gz5zd72CbQnaRP52v4VfILtLxHBP51DE=; fh=VcOFAfcYbMrCY5IT9RzYUfYgAi5EUf40jYO+35EiAaA=; b=0UL7CXM9u1EtsSdTpPJa1UIqZ4FaDw3unoDwSyZQCV4VjEpJu/0GZpQKxCIn2J/1xQ wciSY2Xgx0VEeznXlRDQZv+hRCu9JjMsQOs8qH3x9XWuQFaAWyCfWT81TE+mtFT4iObZ BcVe8dS8LYWrToqGqQ18L5wtltFprQGEGlXg4X55yoA9y7hyCmzgsKEd80dwopih4ybV rFrzKJ+cayK1mjUICHMw0BT21UHWm9IatTYDtQjjZF+PuGmwKbhR+vrg2H77ASeqClPI hy6jWGZvZfbtdjgUtjbqbWuOa6HmAMcE5tiE33q+07/Kas5+kMKCjcQdiE1bD55v6kAH m33A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id m22-20020a637116000000b005781afa41b3si10457029pgc.152.2023.10.09.18.20.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 18:20:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id BB3878043ED8; Mon, 9 Oct 2023 18:20:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379240AbjJJBUL (ORCPT + 99 others); Mon, 9 Oct 2023 21:20:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378034AbjJJBUK (ORCPT ); Mon, 9 Oct 2023 21:20:10 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4448491 for ; Mon, 9 Oct 2023 18:20:09 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0Vtqdwwn_1696900805; Received: from 30.221.128.182(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0Vtqdwwn_1696900805) by smtp.aliyun-inc.com; Tue, 10 Oct 2023 09:20:06 +0800 Message-ID: <7dfa521c-ee4c-60b2-bdd8-95b956183f3b@linux.alibaba.com> Date: Tue, 10 Oct 2023 09:20:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] fs: ocfs2: Check status values Content-Language: en-US To: Artem Chernyshev , Joel Becker , Mark Fasheh , akpm Cc: Kurt Hackel , ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org References: <20231009141111.149858-1-artem.chernyshev@red-soft.ru> From: Joseph Qi In-Reply-To: <20231009141111.149858-1-artem.chernyshev@red-soft.ru> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.5 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 09 Oct 2023 18:20:23 -0700 (PDT) On 10/9/23 10:11 PM, Artem Chernyshev wrote: > Test return values before overwriting. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Artem Chernyshev Looks good. Reviewed-by: Joseph Qi > --- > 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);