From patchwork Sat May 8 03:33:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhen Lei X-Patchwork-Id: 432593 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp897387jao; Fri, 7 May 2021 20:35:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3aQmeDtwPbK/I40qvw0rb2/BxsAurla3mbH6Q8gbAE+DZX12WwURY2bTIS7Y73RSpNHf8 X-Received: by 2002:a1c:b306:: with SMTP id c6mr895053wmf.37.1620444928751; Fri, 07 May 2021 20:35:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620444928; cv=none; d=google.com; s=arc-20160816; b=OWJyL+9AboYjv/bxOBBrkwnAZ1BrxutW7aayaDIBVb+RPDRuAIDXA9tGlVfGNahf2E ptTbBgXpRl8wPME9VYjrSrkbMULnFfqGTHeMU00d8t2BND/2bu0l36paLjMq2eb/3Hru UWxd/PjVBmxG2ONZpsLKJyjUJP3SXCaP609N9DfHhK8TY95iwuyNwfJbDdKN6d9vaxdW N2Y1izauZ92vqYxxdPmhqGKExkO2NByZeoe7Ns3pYeDMK99FmcquLxeXCZvVR2ytE5Yl BP0G5fNNvuYmNH9YxoMJFYrMnkjXWevPSJiJXhaPNkoWvFTA5DY1dm1MgWTK0WaYz6rY cE1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dkim-signature; bh=P8aoJ7u2syLm/QPHCnFFH26sKBu3XS01YPuqX/gBVGE=; b=i+R+aR9DAuvFaL3BpIu27hRxPj0XSdH98nNUb/AlfwzajuBDTRgbHZ0zPvRXiAjiuA yb7JjUAZhb5QD/nv6QlW4dARDxMznWnP8jVQJ3cxAJjWRqfQxU3nj/ShMcwK2F0Diecu j7DfetqUiFMkxTquzwPPMFH5P5Lfl7tYqT93EYKMrn6b44vXRCMm35KiplLx47rgjnEd GKzVHdOXcZk5xK9X+T1fjFxeDzNWqScNz9fBjeZL0JvTxOa/+wnhRJ0Z+6VfahPNq7+e Qe1+Rj5YvoNXwi5c7yCJ+4es6d/X/lgXCIek3SJfqlOdrjQYL9MMolvRLnO+/FU6vfjp SH5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=mVoBkRZ2; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20210309 header.b=3x9otDoC; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from desiato.infradead.org (desiato.infradead.org. [2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by mx.google.com with ESMTPS id h5si1435468wmq.221.2021.05.07.20.35.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 May 2021 20:35:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=desiato.20200630 header.b=mVoBkRZ2; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20210309 header.b=3x9otDoC; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:8b0:10b:1:d65d:64ff:fe57:4e05 as permitted sender) smtp.mailfrom="linux-mtd-bounces+patch=linaro.org@lists.infradead.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=P8aoJ7u2syLm/QPHCnFFH26sKBu3XS01YPuqX/gBVGE=; b=mVoBkRZ2mQBuSfbjddgvulRLqe 0o+gFixhH/yzskUn+fY6NmHLtu4e0zqed2ahUgS0zIHMFeP2Ny02iP8ECTWqA4BnEXS6MkR3HuduP jD5jbr3X45P3IIgGL0FcHERFudHNU+EkoEm4tdOvoC8+e4Wxmj9Fp60cXMwE7hTf1b7qlCoaSSfrN mSryfWoA/v4THlryIQt+5M1Q1a54DW9F/O7bhL77r0Xnp7DyF13xueaBAtT2+sU6f2tSFlKA7NewL KlLJKUr3If/v/vXkCwiLJ9/eK0B0MzaYooum7LvTvzsMunq5pnCsWQpQKthKxcee6fu8IUW+gmCZI R8ztnzRw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lfDj3-008fi9-7n; Sat, 08 May 2021 03:33:57 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfDir-008fgA-6Z for linux-mtd@desiato.infradead.org; Sat, 08 May 2021 03:33:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Sender:Reply-To:Content-ID:Content-Description:In-Reply-To:References; bh=guUrlkaLxv+KyAnmc4sYIzpeiRks9WIaKBaFXCqTcdg=; b=3x9otDoCBmfMPt90GBq6ZXQ6Fy bVRZp1JbXTFl9qhH8eJ422uxpkUyw02H3L6mGQXJYXJU4Ye7Pl40AtEmveTGqwhjwkS8xu8UvYTEO MrTrB902qyKD/PF3GsRVxFNSUJctIjjL5ipUNcQpMNmHODuJuCOzb+ONuLQ38rc9x3Qt2iEK+PhQj PANDcuQHZdXINFxj9N56pnj4tY3CYYkqA91gORZRA6S2Z1tor9nRmNJ1duzYWsA9NJOh4M7cybyi8 Ys3LlnWXzPBqSGsqBbKeRGlz79rvdRZFtjCT0dnYnUHSL2q2NbaPVj+76KkEuCtkfLqDVJNaLCuOF bsUTmDlg==; Received: from szxga06-in.huawei.com ([45.249.212.32]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lfDio-007LVT-9M for linux-mtd@lists.infradead.org; Sat, 08 May 2021 03:33:43 +0000 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FcXsr4sLTzlbyJ; Sat, 8 May 2021 11:31:28 +0800 (CST) Received: from thunder-town.china.huawei.com (10.174.177.72) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Sat, 8 May 2021 11:33:26 +0800 From: Zhen Lei To: Richard Weinberger , linux-mtd , linux-kernel CC: Zhen Lei Subject: [PATCH 1/1] ubifs: journal: Fix error return code in ubifs_jnl_write_inode() Date: Sat, 8 May 2021 11:33:13 +0800 Message-ID: <20210508033313.2227-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.177.72] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_203342_510557_843DA6C1 X-CRM114-Status: UNSURE ( 7.72 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 9ca2d7326444 ("ubifs: Limit number of xattrs per inode") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- fs/ubifs/journal.c | 1 + 1 file cha [...] Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.32 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [45.249.212.32 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 9ca2d7326444 ("ubifs: Limit number of xattrs per inode") Reported-by: Hulk Robot Signed-off-by: Zhen Lei --- fs/ubifs/journal.c | 1 + 1 file changed, 1 insertion(+) -- 2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 2857e64d673d..230717384a38 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -882,6 +882,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode) struct ubifs_dent_node *xent, *pxent = NULL; if (ui->xattr_cnt > ubifs_xattr_max_cnt(c)) { + err = -EPERM; ubifs_err(c, "Cannot delete inode, it has too much xattrs!"); goto out_release; }