Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2768222imj; Mon, 11 Feb 2019 08:10:58 -0800 (PST) X-Google-Smtp-Source: AHgI3IbmbeacnkWVvI+w1QNMbRYAnObY9HvizLJewrQVaoEa13OcAN+9rDorEefsKNpEuVaxlDR/ X-Received: by 2002:a17:902:2a89:: with SMTP id j9mr38672173plb.296.1549901458161; Mon, 11 Feb 2019 08:10:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901458; cv=none; d=google.com; s=arc-20160816; b=lBSIWkP9KBsT19IQ4kv3l5mpbP2DX3GXpX+P27jWIfjoWdvnG6EShO4owsm22ozksy 07zy7o0zz7Q1pSTRtkAxbx7x/LYoRm4a13TGAopMckXIKCkhUgNGjL0+tC3/MONY5zNR xBgxQd5MtfJCp955Z3wJ3R5CYJ+Ie422ZxRb/iJaPy+rzNg+R+4P3U9UsPrP1RSFOxrn idMzPqPfj0OdkY5BEgH7gMAPJbqRKzDHEnQnTnJ7wUdsJfKmXTi2X6TRc7YNYZg9wzXt dA4NT8/PZp9RHn9IZ7pXm3H8ZSvWzx3/dhCEpCfgXvWILq/FTvaQ9KrFWui3lMhmnSvA e3Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=O6Dwna13LoLxtAoYG5n5lDIOwXWdYMPGkBwjXbwmoIo=; b=nGL1DpH80qnobYdeJBIa+t01AhlKbHo8zXC55CF068KwDo6MZRgonrs+2YzTVIR62M gJgz8sDWsxtBJPfPni5JB3RWgCiFDAzFRapu5b7GV2Sa1sApi0nNGKpa2ktUh6rZUeMJ EKkj1Fzh9cMpsHq+dPek6BA+81hkdyTAjSdayKRKNXKi/Yh+ThHcssDRyj+tt99rr/UW 2SxkpEjADNTLsHiGLHBC8yj3pM2PnVlfURaLW0qH1E01FFNW00/5OBVbx5zNM24nhWU8 Rz4MqlqrGPH6isYkn8V7nK3apyYGq8pPSdRGh7tSuaLGTa0AHnN5jwMyUinGoa2LqDXI WkdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T3p7d+Kj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u129si10336772pfu.117.2019.02.11.08.10.41; Mon, 11 Feb 2019 08:10:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T3p7d+Kj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729503AbfBKO0G (ORCPT + 99 others); Mon, 11 Feb 2019 09:26:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:59736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729496AbfBKO0B (ORCPT ); Mon, 11 Feb 2019 09:26:01 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C6A0420838; Mon, 11 Feb 2019 14:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895161; bh=+c8H/4PhBFpXjEKwoUqnPTiLlow8yrWs/Z9VJgzdqN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T3p7d+Kjl46j9ZIYfzlHY8Z52r8efBJAxJZnm98P1Fe3CfZeS60s85rttcKCex1FZ rFldC33Gc+zhG1QIHt5qAQzfddi9CAP4Ow5ZuwMVzLvJ/QaYTdMSgmRn5mIVj5AHaW GgcSIC79r1nPhMa+juSjj7a9fgB5B5q/N47EfbkM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tiezhu Yang , Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.20 083/352] f2fs: fix wrong return value of f2fs_acl_create Date: Mon, 11 Feb 2019 15:15:10 +0100 Message-Id: <20190211141851.273521223@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit f6176473a0c7472380eef72ebeb330cf9485bf0a ] When call f2fs_acl_create_masq() failed, the caller f2fs_acl_create() should return -EIO instead of -ENOMEM, this patch makes it consistent with posix_acl_create() which has been fixed in commit beaf226b863a ("posix_acl: don't ignore return value of posix_acl_create_masq()"). Fixes: 83dfe53c185e ("f2fs: fix reference leaks in f2fs_acl_create") Signed-off-by: Tiezhu Yang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin --- fs/f2fs/acl.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index fa707cdd4120..22f0d17cde43 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c @@ -352,12 +352,14 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode, return PTR_ERR(p); clone = f2fs_acl_clone(p, GFP_NOFS); - if (!clone) - goto no_mem; + if (!clone) { + ret = -ENOMEM; + goto release_acl; + } ret = f2fs_acl_create_masq(clone, mode); if (ret < 0) - goto no_mem_clone; + goto release_clone; if (ret == 0) posix_acl_release(clone); @@ -371,11 +373,11 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode, return 0; -no_mem_clone: +release_clone: posix_acl_release(clone); -no_mem: +release_acl: posix_acl_release(p); - return -ENOMEM; + return ret; } int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage, -- 2.19.1