From patchwork Mon Jul 19 14:54:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 480032 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4289925jao; Mon, 19 Jul 2021 09:34:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpIHsVbiy150p/50RotiroohCW0G8KhYVTE4mhQ2YJo1ihoDgG7pRT3yc9LQGNKINVLfh1 X-Received: by 2002:a17:906:c29a:: with SMTP id r26mr28740759ejz.235.1626712452509; Mon, 19 Jul 2021 09:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626712452; cv=none; d=google.com; s=arc-20160816; b=Z1mL8liEykk4Bkc1vgdGAJl8raXSSbvCxnrl4+SAh7yibFszUv9qGWXDBRuUTyx95y 7JCAuA12i0FPZmwy+XBUZLKQKx0j7D8RiKpPC/kDcEJb+3IaxfFsZ7jr8t8RtqP1241e EQHVD1BCK4DHsq0XcK6fKbqeaxJTXGpaw1bpEuQG5/TdvTCQ5SmrvuUxaiytRnhRUd7F BY9s6CQ8SdYBCNe3KqXxHCjUhgJHne/NPxzG33oTWUXkhqBrXog6sSgOA7fLSpBFknyK atglrMgnXnlH1g4WKKtzCRNhNJU7ksajDQlvxtGBb4HXvI92qiUYnhL4rAN5NjvejNss GKBg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=53clqdXCVXX5grhVpR08m/k+6NvfaUMs3TbGPZsZb30=; b=QVkk7R6hlgB3MO2HDaO9uSX13zWJ2gvI5YKypBAfyrmV5KEkFX1B9W/auFIT7he6Km 8KY6MktrgoZLv14Y7LlTmxopdyF7T1ETSo3jn576oJgoU76N2ZbJIJQ6ky2rLOALnYEF J22v5r7vs4laIvUFa7265vMYC7o6Afu9ZOY3izZ4ac/gOOp47wUCIfzBPZ+IMf5BNrLo yeTluBJACpsY1nB9RnQp2sGKA0YaMeAvYgsOul/9YM3+w1ocnelVkW7Gy02ALbHR7FIS LbmJgEv8IAivKcKmeqHhf6QhyjTapQQ2VuVgBM25TvsQI2Y0xuvGwaMmn7+Lnjd0wGnc r58A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p+1w72cd; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la14si22045543ejc.142.2021.07.19.09.34.12; Mon, 19 Jul 2021 09:34:12 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p+1w72cd; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347760AbhGSPsp (ORCPT + 12 others); Mon, 19 Jul 2021 11:48:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:44952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349683AbhGSPpS (ORCPT ); Mon, 19 Jul 2021 11:45:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B7D5A6113B; Mon, 19 Jul 2021 16:25:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626711957; bh=5CmuSDw8H3Y/kWPK6OVMprudBgeLmsfWjMqzjc9fq14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p+1w72cdaODxQSM05r19wlErFaN8E9bOpnEW1HSLDU1ZHljUUrF43uGv4Xp1LQK0E URsYy9Mq0+VFgG7ens30ZLCHShSrVzu12z4DfZxmbIs0FOtjgmzBmOLaGybMEqLagW AeObeHdfw8CGqPun/KSRI2GfpqXj3xfVscO8lZI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Richard Weinberger , Sasha Levin Subject: [PATCH 5.12 188/292] ubifs: journal: Fix error return code in ubifs_jnl_write_inode() Date: Mon, 19 Jul 2021 16:54:10 +0200 Message-Id: <20210719144948.671831249@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144942.514164272@linuxfoundation.org> References: <20210719144942.514164272@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhen Lei [ Upstream commit a2c2a622d41168f9fea2aa3f76b9fbaa88531aac ] 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 Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- fs/ubifs/journal.c | 1 + 1 file changed, 1 insertion(+) -- 2.30.2 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; }