Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1883679pxb; Fri, 22 Oct 2021 09:25:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6bzzKKzzChChhAvxwmEaDBWR57/F/xBsF30EyIpn1626Pe5ZdwUBjFXVTo9pxvzgU+XuY X-Received: by 2002:a50:da45:: with SMTP id a5mr1288359edk.306.1634919912406; Fri, 22 Oct 2021 09:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634919912; cv=none; d=google.com; s=arc-20160816; b=R7ouKwKv6vd6Zc7x0xheAqzbtck/Bmtv7QXgcdBbnEl6MuWZ9pPBXwARJp1Mef1xYz 0OqAa1/74zn12y1dCCXIXlVVaUn28w9K0moVEyEzznJWhpIvtMTqhU51YuZ0JyhNiYsV 5V/ifrDsA6OHbYD0NbdVmhkGt2SKSqdu9ZSlmUwpmIkqy1mrKoF64LDegnw9yqFBQcbi 9wNEPuS9WLEjKbUAdfeecimGJfAwAgYF4ZDsgzzucAWkr+DRtrYN5nx7KjiT1Ucswj2w tHNm7/3WbVCAgjhxEc3qjoj0UxoEFEe6+haGoRLrdTQoLz0YK+ZpVScJAzKv0vTiviwU F3PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=gym3OLjVmCdYiT3Kqd1o7DLHQNkb3ODW18UhYICf9rI=; b=PlDwnf2U4+rorLpQXIAyVTplaT+SKIfU7wlGdXtU4zovgEsz5RrH+YWQY8hfr37HxZ JIH6HS2gc0PJOZqXlwKljIci75xMRbPL0i3WouwEva/3QZ0JVp9YP75XeHYwLUF1jrT1 VXG/dINa3vHjzZIWscZNPPW6kU6vZZpAww1cFClTp5pJXTlF8UUItZIPl6haVW5iSafW phBb4PNf/bJZe7MlEYYIv+dZsMhI63Symn8Ts7Baa4xn6FEklG4f3RHi2bq+sn6x9AgH twJayUJjKnUjLSIhTSsmUCCp3etjV7FAwOUys9AIqxPzA1ipuR4XwbyiDxAQoWUi4hm/ ZY/w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si12497927ejy.617.2021.10.22.09.24.46; Fri, 22 Oct 2021 09:25:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233508AbhJVQZB (ORCPT + 99 others); Fri, 22 Oct 2021 12:25:01 -0400 Received: from smtprelay0101.hostedemail.com ([216.40.44.101]:57290 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231651AbhJVQZB (ORCPT ); Fri, 22 Oct 2021 12:25:01 -0400 Received: from omf02.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id B5FA439F24; Fri, 22 Oct 2021 16:22:42 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA id D40FF1D42F8; Fri, 22 Oct 2021 16:22:41 +0000 (UTC) Message-ID: Subject: Re: [PATCH 3/4] fs/ntfs3: Optimize locking in ntfs_save_wsl_perm From: Joe Perches To: Konstantin Komarov , ntfs3@lists.linux.dev Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Date: Fri, 22 Oct 2021 09:22:40 -0700 In-Reply-To: References: <09b42386-3e6d-df23-12c2-23c2718f766b@paragon-software.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.4-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspamout03 X-Rspamd-Queue-Id: D40FF1D42F8 X-Spam-Status: No, score=-1.68 X-Stat-Signature: xjbgjke43susyq6wmjqmzzo73gupk3tm X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19pUH21oGkxLq/QnEwTrJOsBhBf+KCPFCY= X-HE-Tag: 1634919761-37637 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-10-22 at 18:55 +0300, Konstantin Komarov wrote: > Right now in ntfs_save_wsl_perm we lock/unlock 4 times. > This commit fixes this situation. > We add "locked" argument to ntfs_set_ea. [] > diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c [] > @@ -259,7 +259,7 @@ static int ntfs_get_ea(struct inode *inode, const char *name, size_t name_len, > > static noinline int ntfs_set_ea(struct inode *inode, const char *name, > size_t name_len, const void *value, > - size_t val_size, int flags) > + size_t val_size, int flags, bool locked) [] > @@ -595,7 +597,7 @@ static noinline int ntfs_set_acl_ex(struct user_namespace *mnt_userns, > flags = 0; > } > > - err = ntfs_set_ea(inode, name, name_len, value, size, flags); > + err = ntfs_set_ea(inode, name, name_len, value, size, flags, 0); generally is nicer to use true/false for bool rather than true/0 > err = ntfs_set_ea(inode, "$LXGID", sizeof("$LXGID") - 1, &value, > - sizeof(value), 0); > + sizeof(value), 0, true);