Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2680351imj; Mon, 11 Feb 2019 06:57:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ+e1DiOVZ1qMmt+9fkVwV5F8mQDd/eLU08REkE4WntFWRIFOo96EB84T0J0DrKOrwDRJv7 X-Received: by 2002:a63:f816:: with SMTP id n22mr20551079pgh.146.1549897034944; Mon, 11 Feb 2019 06:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897034; cv=none; d=google.com; s=arc-20160816; b=siCqcAk61g7FNo5AXTp7d4NFW4JPTnWor2nFtW/ujLkY8QjmVfeHcnBna8VxtmK+jJ 8OhmsiiCtB2La6TlFfwBf58tBjqG3TKPsWAmjGpJn2DWVZQwZ/b98NcFcCLpQBQVurbs khiHGYpHSWY5r9V1lcTrmxHgJI1fzHMr8lxUmX6LNzgx1Rn3Tu7T+sEQtHxCCfeHzVBA 3codfsjBwxsBoeqaoC5KV4a0nN6Mep7Roq0hFQPwC58Cmqp3IodRQO0xy1b9+frH0tr9 d675IcDtk4gODwY5RZyw/DCq+HEFw46L9LgVLlvP1leiyF+B//NG0W/L1Mx3MmyT0uqh D+Wg== 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=V/zENIlld6I+QPUb0MtmaTFaya9Q2z6Qt6CTkJk/G58=; b=XwEoReIYpFf51uXzRfblz0G8qyGhO9qkqThn5IeMv42GfVKtBtCb0hWZplm8KKh5Xr P3J7q3nkAe940/TyILjZ33N5QqStdyj9R9ecTnoyRrC3UzE7A0G2f3tCOsJnykJiicX4 atMvMKSGXTCFJ6mATxkYHQKA7cixRrm7wyTL7hq7RnInIfXYw0/HO0gVtmO6+p2b1VcU dyTFXlj96bHJestJblLLXI+iocW+82jLVHCFch47Su64mV55LdTMy75o73QcQyGzK8aB MPn2UIdc7rH4pxXrQNu6sTreG876WG/ak32g85ff7DX97H/4KqjoFDvvZrS0n+wMKuTn dWZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="ZH/sSRsQ"; 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 v11si691433pgo.11.2019.02.11.06.56.58; Mon, 11 Feb 2019 06:57:14 -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="ZH/sSRsQ"; 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 S2388737AbfBKO4D (ORCPT + 99 others); Mon, 11 Feb 2019 09:56:03 -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