Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp982583pxj; Fri, 4 Jun 2021 03:13:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyITLjxKepsRnkWeOIdg+P6xSPeM+4cQF91jRAKqNxgbS5XMe8Skirhl7YZg8yYMjAlaVuA X-Received: by 2002:a17:906:b294:: with SMTP id q20mr3396112ejz.382.1622801634430; Fri, 04 Jun 2021 03:13:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622801634; cv=none; d=google.com; s=arc-20160816; b=Vw+vQYqVjtPBT8TUtnxtFgSLOg+C+2DL5PgQmeayxF5UV8zv72TE3kt7p1dPszHpJY Mnrs8n0sC/LZNGeJPCqvjhvVBE9vB4fSE8J12Dcm0mJDRuLOIjDa1M4rMH2uv8sy90lx zZ+EMIRyk5IKn51MhRrm/wNkhXdEWdnufNyRmtuoAwosOhbhNe0qDzCyYwo5en93yunl hmRemtIcdMCQqrwoyELBQ4/y419/FjiebFgToG2UwDoRjKcz+/iTUbd8+v4821hlPahl KnWTWDcrzaVDkDMqr9v8YtogmKrN1wn8hTXyWvhaGu7bS745X6EY2HxDjF18ZVUjvwUv krng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=x3kLtMrEouVRdYB6JCWVn5nU1g9jtlUssetYNhhCQKs=; b=viNWvekCdpcbIrpD9yzM33884rECRUlGZzFWXV9ouJnFNsEjqiR2ayrCb8uZTf8o6l wNpk/Oon6e6Rv4AUa2hSn9a1H68rnKhzldpK8ui/44X6Mn59Rv436JdeqOuBSWoAg7Yg KhBI/gs0zt/qrX7uVDjBT09WYqXd08SnmD8y3IlgPlh+FTE8ieXK5Sl+WNtkLKHXx+x2 BYsM3nwxvEC2MrPkefRL1E4dWC3qTc8MicGV4CQw5wSxKG5rg7hxg9L/is9HTTxEwdr4 Y1vbpnesezkUViFNOoBcQjnpIRyqjCmnmYOZG6+QQGgXkrM8LcCoX0n7v+/RYqEHbM4k lPHQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f25si4979983ejh.388.2021.06.04.03.13.29; Fri, 04 Jun 2021 03:13:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbhFDKNt (ORCPT + 99 others); Fri, 4 Jun 2021 06:13:49 -0400 Received: from out30-56.freemail.mail.aliyun.com ([115.124.30.56]:60867 "EHLO out30-56.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbhFDKNt (ORCPT ); Fri, 4 Jun 2021 06:13:49 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; } -- 1.8.3.1