Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp701263pxb; Thu, 23 Sep 2021 08:55:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxouzWOkin4MP/+0gbvr1QbabVXSe8XUDpU/MZiS9H9Tsul6iyqTSTH2KGlUZNtBUu+rA3A X-Received: by 2002:aa7:c1d7:: with SMTP id d23mr6252439edp.228.1632412542858; Thu, 23 Sep 2021 08:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632412542; cv=none; d=google.com; s=arc-20160816; b=0E9iC9agGA++WbHz5YBFPCod55Tjns1FpVxE00g44csWlNxYtsx121YSp6aeWcgFN0 3of2pa9aEL48gvS1xF9VlR8NEV8TY+dmf9O5ndbNN7T0p6qdMr9xnZJqrhBnmTVVUQ4U XjMHaq3EfYug8LcPhZwxnwEm8H2k0WI8nC8WTcgfWJ+bx9s/bo7h5NgqURenSWd7BByS sSHu/xGrKDq/2mAdzbSUZ3xoKNP9llHmkjbfjaom7Qd+l17f2iZJhGojVY5MuIBj6L5J 3POKDCoN5DtcVT27ZP9rOtnOZwuELZYYF4ZdxqOz2dLs4Y1FH3gIwBx7YiZk4Er9tbUy hAdA== 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=AGAk4jUzbizS+IaTUDiD3JKzGN2DMd2TWW71KsQVmt0=; b=j2fnP5F+OHEEPtaqzWc+gcgRgyaHOw01QEQMcbZ0uskXCRb8GcIuoj8VqmHNQVxbvw Zots7x63C0rN8d52wpkF33PRHXqBH0rEwzgt31ScnQD+2dWspKXKueb9ku+0QQJf4tKZ gGkYXnSdWUNu7VZzsNUu0clKb3k/vcSMtRaOvxm50nrWjWRYMQNpviKwb9U8P2o6LVyQ A++gfaGOXTK2WML3J3A46xewZ+PFKqtU3g8J4RN15F9yEJmssSwAr9mQIPzkg88SbWqQ 9ryJ7de0zqC9HnvMG/ubBPk6bFVnKdC4vL12/GAcl5pB5g0gVURoLcH0qrLVHmdnYjqE L2Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=oZa2EsKE; 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 lf12si5900847ejb.35.2021.09.23.08.55.18; Thu, 23 Sep 2021 08:55:42 -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=oZa2EsKE; 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 S242093AbhIWPyr (ORCPT + 99 others); Thu, 23 Sep 2021 11:54:47 -0400 Received: from relaydlg-01.paragon-software.com ([81.5.88.159]:42284 "EHLO relaydlg-01.paragon-software.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242238AbhIWPyn (ORCPT ); Thu, 23 Sep 2021 11:54:43 -0400 Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relaydlg-01.paragon-software.com (Postfix) with ESMTPS id E98B682328; Thu, 23 Sep 2021 18:42:57 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1632411777; bh=AGAk4jUzbizS+IaTUDiD3JKzGN2DMd2TWW71KsQVmt0=; h=Date:Subject:From:To:References:CC:In-Reply-To; b=oZa2EsKEgsLE3gds6ickzdO/+E4rcjOqgKht/Gstf83dRln8Jx79Y9aqaVhdtSV4q CVefcsDlYClzlmBmqWMpbN2/ygY3TppSid6lxiYg5DOXIQx1kHxg8GPkXgMgE0AnJC y785bjqZ/JQ2gldMV/uJrQEAsHqtki86r/wg+Oss= Received: from [192.168.211.73] (192.168.211.73) 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; Thu, 23 Sep 2021 18:42:57 +0300 Message-ID: <3df9fdcb-5941-b2ca-0ba9-65dcad8bce22@paragon-software.com> Date: Thu, 23 Sep 2021 18:42:56 +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 v2 3/6] fs/ntfs3: Refactor ntfs_get_acl_ex for better readability Content-Language: en-US From: Konstantin Komarov To: References: CC: , In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.211.73] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We can safely move set_cached_acl because it works with NULL acl too. 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