From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA0DFC169C4 for ; Mon, 11 Feb 2019 14:56:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0401222A8 for ; Mon, 11 Feb 2019 14:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896965; bh=yTllLikkhgrWqPYFYlgdmfkMSqwZOUEhm7X9+H/2L/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=0eCftqEQb0rMMz5foDx3sg/lIBvvTyeRXCjOlpM9dAYHc0xKAEqiqDfV9FhbpFCns /pPih9XvJ/E73IlD2YLFU+rbYG222FLYkqrJxDxAuyL3BcTR2cJWgpVsMvLKyJ5o2W X0j+fYcM3pY3L8zE7+p2EzSA1PaStmYWfW6vWWaU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389105AbfBKO4E (ORCPT ); Mon, 11 Feb 2019 09:56:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:43186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389091AbfBKO4C (ORCPT ); Mon, 11 Feb 2019 09:56:02 -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 7FFB12229E; Mon, 11 Feb 2019 14:56:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896962; bh=yTllLikkhgrWqPYFYlgdmfkMSqwZOUEhm7X9+H/2L/A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZH/sSRsQfupqVsVIn/OrI3xk30fI4CoAeAJXiFVivZ4KXB8y3NbRH7Ki882ROOuvE TRXYlL5ojYWexBgt93x9xT573K84le1lEGTup8C0hKD03dePh86s3YEe9fZGu6LcgO jq2UKDR/kyPq+wOjU9tAjqorFt+ecaJGEXwboct4= 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.14 045/205] f2fs: fix wrong return value of f2fs_acl_create Date: Mon, 11 Feb 2019 15:17:23 +0100 Message-Id: <20190211141831.838506456@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 436b3a1464d9..5e4860b8bbfc 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c @@ -349,12 +349,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); @@ -368,11 +370,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