From patchwork Mon Jul 19 14:52:45 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: 480027 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp4285238jao; Mon, 19 Jul 2021 09:28:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNb/YrDbRzOUjvUJEpVcZOZYdBfV5hc+3YkJ+4x0Dl0kpHmmMF3785QcyXn/NU8Fk8h/3s X-Received: by 2002:aa7:d554:: with SMTP id u20mr35270690edr.50.1626711733068; Mon, 19 Jul 2021 09:22:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626711733; cv=none; d=google.com; s=arc-20160816; b=O9sbK0bpoEgDJJ2n9X+bfXRx8e08Qc3bScqA1gEdVYljWQwPiEhPU2KhSJ/0aLeGq4 ToMR/VI8lcK61tPTfTQLpmHPgnVvXtOp5Gkcssr/OJWcL882sjpln6Yf8ExaBVHKq6Vu gQZi/7SyRSSYS527sWikPW71NBs+bNhT6wIPjsCTEphxgbRW/pYDkDvVRda29l/RO0ZP lj4mJDSVVfdmD/gKVQ689QKmStXzcstNU6g7Nm7lDmuuNpNlX2LYyUpmX8Sqc5D3qAch GyMYNw2DEEOysz9fQscLOgMic5MtWtIE2DIsjsk1lkdUUNapBRNnvViScb/ofzhvAKQz uvSQ== 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=ZGhdI+sVnuwXXLN6hAaFticCfIQMoIe9IAOY9iv+qc4O3Zwo/SNcXRw98W87DPckFA wzYIuV+0xg6VhP8TUtQseN3jGVAcqfk9FIugPBwenFV+PO8MW9/wNmoBqbQ0Df1InB+b JwtXbA1pSPhxoaKzIXd6qKzcyIWqPILRuz2/uux3mSXFWhKhm9R2OXJWG1oxzw9alYzm Y9bzda2oKXhPWI6M0YTXIxm8AEEjKT8vYDZbMzOzF2ce9lTw21gXwdWk3CWT2r5GixP5 O33SCuw2jf5Wjt8oYNx80/FZ2z4Lx4q21Slge5K/AYVFrQzB6G5Amgeq1uvmf669+dfy XW2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ifFjJ8eO; 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.22.12; Mon, 19 Jul 2021 09:22:13 -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=ifFjJ8eO; 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 S229474AbhGSPkl (ORCPT + 12 others); Mon, 19 Jul 2021 11:40:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:59802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239282AbhGSPeS (ORCPT ); Mon, 19 Jul 2021 11:34:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4746261002; Mon, 19 Jul 2021 16:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626711075; bh=5CmuSDw8H3Y/kWPK6OVMprudBgeLmsfWjMqzjc9fq14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ifFjJ8eOh86+UASsUsZ0Euoz4IID+TXCHOWgY15EK/w0uIj5P6KoSQsFTwCAhKGqb n4UqtiLHaBWj7yXdkIdQbXVPif4qx85luALhcvaUxdcK1kse+xmo2akQJjKp7aodJL szMx86bFjXrZUFfAac42RelKvMii5JDk2M6bx5HE= 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.13 219/351] ubifs: journal: Fix error return code in ubifs_jnl_write_inode() Date: Mon, 19 Jul 2021 16:52:45 +0200 Message-Id: <20210719144952.202198577@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144944.537151528@linuxfoundation.org> References: <20210719144944.537151528@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; }