From patchwork Mon Jul 19 14:53:09 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: 480008 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4276888jao; Mon, 19 Jul 2021 09:18:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7dugkUlnN+qfeLNDXm1LU/+iX2C4Srg/nUcyJWFDtfwEKxq0YoT0CpLSBTCZ6zTF7zjVI X-Received: by 2002:aa7:cd73:: with SMTP id ca19mr35210889edb.117.1626711483248; Mon, 19 Jul 2021 09:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626711483; cv=none; d=google.com; s=arc-20160816; b=e3Fjr6UKbz6yie5VTrsVnMPgUel5EcQDizKQpPj8bFm9OBhXHlvUL9yXRbhZeGAuXf Kl7YWlBHocchuPbTn9GN96c7P7GRr6mgeN1l27nSaPvsTAy48qfD22KFO1UCEYUA/od5 ziXY0KARZwSo3GirtDRyPocsSx7LjtWcLjbih6O1eoqoc6Uby0/Pjo6jkSGP2YFTSdqM hVqZ5fYSv6q/McOb5cOh+mj3v8g7RHsXST8QeiQWy59q8ltAW+kZVJk/8w7SkHrEB7DG Dn4iiJLoRdB512eShgZrPAV+q2qEKKdPGiwPgjdDPhIq0KHmXoqUn9ZR0Enb9j/iJQ17 T4BA== 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=A/CRumvJuy4dAoZ/7Op3sF/yROGySqMKsCg9hmWe2nNjyRJxNCGKMjaMf1RVcFd9Vj XgtMWT8Rv1CxDHQJcUmVQqz77Tu6uIIYKNzndp0GAAep7Pn+/qPjHmnP82VTdf0oR+MW vc+DDMVt7IQdfTS3ZFYuNkeiRxXfj4SGAbFh1/jsUV+NNE8luFaJOr34Nw30aGsLq4cn IGuwAAuiOWAEH7I72Slgz9a73eKfKYjO0vw399/AYCl0AQ6NZT/6GMLfOH5VsDSqRtfZ 4MXMZqbf4JdADIgA1G1WRZtgqkHWsoD9DUryhxYQxq6kthxNmdUoJVbaCKUo/MRc03wE lBFg== 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 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.18.03; Mon, 19 Jul 2021 09:18:03 -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=oLHl5tNk; 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 S235879AbhGSPdM (ORCPT + 12 others); Mon, 19 Jul 2021 11:33:12 -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 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 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; }