Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3709259imu; Mon, 28 Jan 2019 09:24:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN796IyEvkwVG3QhSm17Hlw7A6nNV9UFQwSK5fvoVNPObbZB5qHMZP6omG7GaW6Uw5RYQ+f1 X-Received: by 2002:a63:f1f:: with SMTP id e31mr20359411pgl.274.1548696280455; Mon, 28 Jan 2019 09:24:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696280; cv=none; d=google.com; s=arc-20160816; b=fU1Gzv0U63cS+nJ7FNq0EyRrHHUpO03nEkLDeboGylqg6YrQQiqTSKAUkQf7wvXd62 v8yfycgprNpQp+kHHhGK0kaZJnvfVBxRwIDFAXOoHE3uU4ZDwuL6ZiB03OWCXwDOTr4g R76ixzu9BlD8e0UV7HC66Xyest6miB6pfl4P/fuCd3cI3yPvoK66iaVl0vKPNEQvA3Fx 4rszIQFexELO/6nCRfJwNKAWTD1NjMz9M+pEnDdYsHAR05StBLb8pijcL0EMWrZzHyMt Xpsqe4y7Bjb/gXRTczOWnbBKW3JqZ7WlB87AFcQT0/t//1BGLZ2//xUKBLoULG6OabSh tJkA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bPcmbn6nfT8b+oGgHW2huum5Q+V1oYH3ozyoyN99H+U=; b=0XHSxJvNUGDf5hXHr6h8DqatdSOUJcsCGx+pvzf3oXkcMR/mJ+TauknjWp9SpwoFCu 2fjuhYsYvivV0pYeKVhUjoGL6UMQ/+RCbk3k4D/ZwE3K7+3q3d+qYWtznfZKMJCBLfvD Ws7lUjm/e+ujd3cu2iGsrA1TQgbcGSMgPWfkms83ZYS27tV+lreQuRL4nE46OZI4uwor 6F8taEqPnQ3zTqpZEv13QpDPsYU6AO+n/9Ane3OX3J8hieCTWeIBU+K4Ae5oNxW1mDA5 Hz5YemfpzPMlHRaoIyn9ogjtT5vKbUPUS02oSMwVs3F/09p9THELQg/TjT8z/lBzcYW3 ndeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AstEmFeJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si31702022pgj.316.2019.01.28.09.24.24; Mon, 28 Jan 2019 09:24:40 -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=AstEmFeJ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731508AbfA1RXG (ORCPT + 99 others); Mon, 28 Jan 2019 12:23:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:48386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730552AbfA1QDE (ORCPT ); Mon, 28 Jan 2019 11:03:04 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C6052175B; Mon, 28 Jan 2019 16:03:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691383; bh=SMSRi0Noe/4iDDh2D+49mXP4SZN1ulcyXleky9Ic7fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AstEmFeJFqPbI4tLbFTnn4c9R6uum3iW1SJ+rGtISjXo7kn5muZcmZKpY0ey2T4S4 8I6SFKId5RI8R0Yehzm5BWJ3SoDBXXj8gZq5zdNdNLwfC+mSKaII8DHzG7lY+gPwqC vxYF5ZhUvXbP2O0wsJ9IIU7kjUhtEa7Y183FJRLw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tiezhu Yang , Jaegeuk Kim , Sasha Levin , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH AUTOSEL 4.19 075/258] f2fs: fix wrong return value of f2fs_acl_create Date: Mon, 28 Jan 2019 10:56:21 -0500 Message-Id: <20190128155924.51521-75-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tiezhu Yang [ 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 111824199a88..b9fe937a3c70 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