From patchwork Fri Jun 4 10:11:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 1487728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=1qEkIIe0; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FxJqh2VKhz9sSn for ; Fri, 4 Jun 2021 20:27:44 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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=cpgySLKOkL4TuO55Hyv62xzsUfWzOLoOhsUSbqL/eE8=; b=1qEkIIe0+xql3P 09YR7bWnfN9YKn2S7DkjihU9mY6FRFyfXvQhkvBVcHM0czyXvCR2qxWnVvxJ3tz4HhDvnGQhchLfG LLa1OK5wzrWyUfqAkx3iJuqOrZ+GEiUWdUxbNhtCni1yuYnky8uxu/UQEP8Mbp9+2ZyX+vgkYQlad R+BwivBnZ5a6thZHe7Mf8UAg+MB2MKFfD1L+cAvERqzBDsls7wj0nmxbXLspqgqf4Ww5wBtRroSXW nQNkMpLGx5tPJeBiY0u0oZ55EwnQKrN6T7Ly9rWM5HwKwqR039K+relOZ7B+vv9rnXRHERteZGltB +xhSs+oA1S7yC7BEZP+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lp72c-00Cx8A-Qz; Fri, 04 Jun 2021 10:27:03 +0000 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lp6oL-00CrEs-0V for linux-mtd@lists.infradead.org; Fri, 04 Jun 2021 10:12:18 +0000 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R121e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e04423; MF=yang.lee@linux.alibaba.com; NM=1; PH=DS; RN=4; SR=0; TI=SMTPD_---0UbFI391_1622801520; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UbFI391_1622801520) by smtp.aliyun-inc.com(127.0.0.1); Fri, 04 Jun 2021 18:12:01 +0800 From: Yang Li To: richard@nod.at Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] ubifs: Fix an error code in ubifs_jnl_write_inode() Date: Fri, 4 Jun 2021 18:11:54 +0800 Message-Id: <1622801514-38016-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210604_031217_227001_9BED4F4D X-CRM114-Status: UNSURE ( 8.71 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -8.7 (--------) 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: When the code executes if (ui->xattr_cnt > ubifs_xattr_max_cnt(c)), the value of err is 0. However, we can see from the ubifs_err log that the value of err should be -EPERM. Clean up smatch warning: fs/ubifs/journal.c:886 ubifs_jnl_write_inode() warn: missing error code 'err'. Content analysis details: (-8.7 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [47.88.44.36 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -7.5 USER_IN_DEF_SPF_WL From: address is in the default SPF white-list -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines -0.5 ENV_AND_HDR_SPF_MATCH Env and Hdr From used in default SPF WL Match 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: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org When the code executes if (ui->xattr_cnt > ubifs_xattr_max_cnt(c)), the value of err is 0. However, we can see from the ubifs_err log that the value of err should be -EPERM. Clean up smatch warning: fs/ubifs/journal.c:886 ubifs_jnl_write_inode() warn: missing error code 'err'. Reported-by: Abaci Robot Fixes: 9ca2d7326444 ("ubifs: Limit number of xattrs per inode") Signed-off-by: Yang Li --- fs/ubifs/journal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 2857e64..2307173 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; }