Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp623045pxb; Wed, 22 Sep 2021 09:20:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJA4JFJDt4aqc6wrSHLFeuoSo9Js0TWKz9zDi5bCLr+5xOlRCl6EbI38rI0SJrc9wcS/qr X-Received: by 2002:a05:6638:1389:: with SMTP id w9mr574687jad.138.1632327609757; Wed, 22 Sep 2021 09:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632327609; cv=none; d=google.com; s=arc-20160816; b=gI1foUcWCRIBZGm7YzZWZqA68SCjwzKFOCrKPzB/VSsZFHuS2fowr4odcaJlibb6MF sH/qTQEP0pJiDsMZm0aIJfQbyJl7jgpAAokdUw8uSstp0Y/hW7xvhyLmS2d9iRlHciQQ X4Uk0sudmUe4X78BLe5/MpI3cdSFXOEGmODEKGZPFJsU2bydYQhDl8Of7/1WoYLP1C8y MdyR8QImwznLaN/t5D5xVLzuJXZl7i8fqVfkkJue0H974SfcNOtvj34+Kgmcj7Fp/JYB 7WMkrucQOz7uD/loJ0YRP9X3ZVcb2ktbHN3xe+4AJ3iT800daCKG9h+b7MbAZVb4loMP yKvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:cc :references:to:from:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=P0QxpD6OvYLGv8lTPq3qwBSTDBJSkeBOFJ4WRSqNZgU=; b=pFiLsr7egnkgAiD5WtnwRSvoAkbwARobxWuZ+dT8MMmBkQdxiRVGP3+YVvBXgWYmDE nfSt9CEdQiJMG/WlORCbJpX6rxQsKwormXR1ky3WUy/1qqlhY8s0Y+tilcyqxK/PPx7u 9sDxEkBtkAbB+zmxPnQ8wyNKCyEi49U9bb+v9Xiw1qlVoyiWPXVDGLk+bsGqiIo5NAKD ln4jH6yN9vtMxYr3icMyk0YkgzYu8xghN/Zsp0jBj7psi/ODAD9h7kjIqfySh5XqO9lS L11cjcQqqzW9+L/0GaX+1IdoyydbyghPlErrRDh2gTvwWPgMgArx8khhBsQxerGE2JMz EEdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=rhVCNHnm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v3si2908957jao.112.2021.09.22.09.19.52; Wed, 22 Sep 2021 09:20:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@paragon-software.com header.s=mail header.b=rhVCNHnm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=paragon-software.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236557AbhIVQTv (ORCPT + 99 others); Wed, 22 Sep 2021 12:19:51 -0400 Received: from relayfre-01.paragon-software.com ([176.12.100.13]:44158 "EHLO relayfre-01.paragon-software.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236478AbhIVQTv (ORCPT ); Wed, 22 Sep 2021 12:19:51 -0400 Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayfre-01.paragon-software.com (Postfix) with ESMTPS id 81FB81D1D; Wed, 22 Sep 2021 19:18:19 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1632327499; bh=P0QxpD6OvYLGv8lTPq3qwBSTDBJSkeBOFJ4WRSqNZgU=; h=Date:Subject:From:To:References:CC:In-Reply-To; b=rhVCNHnmjznucc/VVrqdOfXiULPqrb/ZOmVoPnibCIdlswya729l4z9hR3EGhDw4s sNyBF2B9FbZTgA8Y+jWkVti8ybbPWAhBi9QZ9AK07ZO144B+lOlnMmBY6wI9oq14sM U4KjBnL47FTlYvVd+3och7ueaCJ5E0q+kWPNhOwo= Received: from [192.168.211.195] (192.168.211.195) by vdlg-exch-02.paragon-software.com (172.30.1.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 22 Sep 2021 19:18:19 +0300 Message-ID: <994cb658-d2f8-a797-e947-35ac0a203ea2@paragon-software.com> Date: Wed, 22 Sep 2021 19:18:18 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: [PATCH 2/5] fs/ntfs3: Refactor ntfs_get_acl_ex for better readability Content-Language: en-US From: Konstantin Komarov To: References: <2771ff62-e612-a8ed-4b93-5534c26aef9e@paragon-software.com> CC: , In-Reply-To: <2771ff62-e612-a8ed-4b93-5534c26aef9e@paragon-software.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.211.195] X-ClientProxiedBy: vobn-exch-01.paragon-software.com (172.30.72.13) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Konstantin Komarov --- fs/ntfs3/xattr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c index 5c7c5c7a5ec1..3795943efc8e 100644 --- a/fs/ntfs3/xattr.c +++ b/fs/ntfs3/xattr.c @@ -518,12 +518,15 @@ static struct posix_acl *ntfs_get_acl_ex(struct user_namespace *mnt_userns, /* Translate extended attribute to acl. */ if (err >= 0) { acl = posix_acl_from_xattr(mnt_userns, buf, err); - if (!IS_ERR(acl)) - set_cached_acl(inode, type, acl); + } else if (err == -ENODATA) { + acl = NULL; } else { - acl = err == -ENODATA ? NULL : ERR_PTR(err); + acl = ERR_PTR(err); } + if (!IS_ERR(acl)) + set_cached_acl(inode, type, acl); + __putname(buf); return acl; -- 2.33.0