Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3867812pxv; Mon, 19 Jul 2021 10:39:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHaDei4vy1Fu5U+eYjPFBqitLieyWblzfLf8wAHbeSqV0oeJgkUp20NMi1DZsUK152zGP5 X-Received: by 2002:a17:906:b794:: with SMTP id dt20mr28433136ejb.431.1626716376489; Mon, 19 Jul 2021 10:39:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626716376; cv=none; d=google.com; s=arc-20160816; b=tF+J6X2lj2vAMbtdjQB1C+lqANnuuFbWXGn7lq628P/eUPOWX5awdCfKHTMQ6RwLLV GSlEI6flmicjNS2EcUZv2ie4cPdL7rDwcKJdZFcKyqM5CwvviYQGS+4PJsIk+Ucut6lA iN3Y6UzWu8SBCDgNIJnNxwV3B4zKHAvaLlCLbd3a1cfZbgMmvT8HSKYpFBoMvwBDzjtF 9Z3IGnfjz154F6snIcMeO8+Upu/NzcFlyiheDpfml563FmRsb0COUQsCUkIgSeOqPEfq Q2DJF4w80+dpmQl0FCVXXWLh1Fs6wrAD4FvreQs65Cz5VcvSby0ZCzXo74BQse7Q6A1f 7LSw== 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=0EL70O8r3su5GKJoth4CQpQlTDwr1euiuiu1mIfwL5o=; b=hf/UQbL0twpzfnoX22nuk+BOVGkkN9hsWQh5cLf3OjrqeIJRIhDfTFc/MkgCl4QvSw 3Ni6M7KROKM+WnOMLknPAL8MgpPLUdzDVFZqU1z95efpepeSOKApQF6bPL6I0AMSdRGz ZX8IUiGsvnwHJijbjWCZmI5Dg9JHqbfPHhOpdVXxg5+Nov/FN1pVASIUaG3gFQWSHzk5 GA+etMmvQw+WoyKXmEE6Ugj/heEZNpgRxU5uDllLg0v5dHawydEbfgMmNyq0Rr8JHZ94 UhJH1y9JiWidd4lQ8443wCeMxQD2cpRSp6qUB0HC6WrnnLFie0ouotXSBBJjBR5kxrk+ ubVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oLHl5tNk; 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=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 k5si21452777ejv.445.2021.07.19.10.39.14; Mon, 19 Jul 2021 10:39:36 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oLHl5tNk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353340AbhGSQ52 (ORCPT + 99 others); Mon, 19 Jul 2021 12:57:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:59470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347522AbhGSPTb (ORCPT ); Mon, 19 Jul 2021 11:19:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B4A3361415; Mon, 19 Jul 2021 15:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710301; bh=E2RmQRbNJXBzx2Ef1fGcsPlJ5wyQTnwudubQj9I9VXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oLHl5tNk/VQjOkkeHZafLSeff/lxMYTDD76U8gQaGCCTzGqr5EAMqnyPvBOPu0OOh w+I3dodxPSIF/xv+iQDoEt53oVSenkKK6kU5VcdFqwu9hRm/iLoA+2Mmqv4vwgdeG8 d0kLN1ASL16YYY10BctnXEl6f184AuDZhYPx41qk= 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.10 160/243] ubifs: journal: Fix error return code in ubifs_jnl_write_inode() Date: Mon, 19 Jul 2021 16:53:09 +0200 Message-Id: <20210719144946.068152235@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 7927dea2baba..7274bd23881b 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; } -- 2.30.2