Message ID | 75a56ed1-eafc-0a18-9c2d-db4e423c3f26@paragon-software.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp201159wrn; Wed, 15 Feb 2023 05:52:02 -0800 (PST) X-Google-Smtp-Source: AK7set8QTlTbxzAdj2OOaf8zjOgOthu6zZ99/2tw164mkx8GfZSGRhoABPWMPZhlwiR8SZ8BivPH X-Received: by 2002:aa7:d9c5:0:b0:4aa:a9c7:4224 with SMTP id v5-20020aa7d9c5000000b004aaa9c74224mr2028777eds.30.1676469122159; Wed, 15 Feb 2023 05:52:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676469122; cv=none; d=google.com; s=arc-20160816; b=Yv7XaswATDjMPldPmWOiSXjldCETnaCZeCBdM/4MXs2ykoLmgvxK6f04XGlGmIIaiC A72PHSS9PXjbr6qFuSAWE/qgHwlRm7kcmZ7z7NEK2/zSdFuLI7f1L+5wxLg9ktVM5Ubc ABdlyU7bId2HV3A/i+tGE2fUMuX14tBVZv2ff5Hdq6XzXGt8q/8Odtu/zSPqA7swHIm6 /FqVvkEbnYabp+ALuDExJHpZ6svt9we4FdnjL/XTLAQ3PIqBBJw/Vf8BKjK9+M67tDTM p1A7PEiv4o4rsZ0PspoWeRyX4Gy3yUl3lL6up5d/Ue8gzLckUxM9II8LWIA2ZZfuFQ1S 0L2g== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=OatpAkpsqEkQhNlA8+4RSwXL5RSbK1GB/mfif8PSuXw=; b=jHyKLtuN/CsBY/eKYWVGkZ1jV9qAAETuhqxPXxFEXeut27uiqRaLJqaf9C5dri7aME SqNxKCOo/jnr4CXYkeAWY8ZvrzJ3Krv0kV9WbJH0ZWp7cWaveHrPAt/L45JyZw8zCslY vPkgypx4s91p+msrBq0iJw56w4A17I5XdaBwfU0suLNt92I7KFleRBRocRLfFs2EvYEZ aOSK6C2sWx/NeIDNiI57fFKgJmmiK1CdQ4r37wIHH+24yOIehlTnAzP9Q2b2ajb3+YKU SvXkiywCoMtFk+TKBGd7q3895oKmUeaf+rHcUfImilM1umIUyFbpyb73z1pCrnMi5lF5 7Qmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=iAEGNCOI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o7-20020aa7dd47000000b0049e420baaeesi20742161edw.470.2023.02.15.05.51.21; Wed, 15 Feb 2023 05:52:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=iAEGNCOI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229844AbjBONgS (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 15 Feb 2023 08:36:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjBONgQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 15 Feb 2023 08:36:16 -0500 Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C19DE358D; Wed, 15 Feb 2023 05:36:15 -0800 (PST) Received: from dlg2.mail.paragon-software.com (vdlg-exch-02.paragon-software.com [172.30.1.105]) by relayaws-01.paragon-software.com (Postfix) with ESMTPS id 7DF952147; Wed, 15 Feb 2023 13:32:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1676467923; bh=OatpAkpsqEkQhNlA8+4RSwXL5RSbK1GB/mfif8PSuXw=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=iAEGNCOIRzqY/nbzXCP4Ctrra7Efo9iOlJbi0C6An8CFHbytSmWV++wz84rTlqMmh p6zCCJnU2Eaxt6xq+4+UPXt3YnnOlkUSBK9TS0HbznaWpvyZM15P4LOYZ+WahPq81y VUWSCf+xlhJ9Nlh5mwDg+yXXj4owFmYLtU8dRK7Q= Received: from [192.168.211.36] (192.168.211.36) 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.2375.7; Wed, 15 Feb 2023 16:36:13 +0300 Message-ID: <75a56ed1-eafc-0a18-9c2d-db4e423c3f26@paragon-software.com> Date: Wed, 15 Feb 2023 17:36:12 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: [PATCH 04/11] fs/ntfs3: Optimization in ntfs_set_state() Content-Language: en-US From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com> To: <ntfs3@lists.linux.dev> CC: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, <linux-fsdevel@vger.kernel.org> References: <d7c91201-5e09-5c06-3283-7887f5a5b7f1@paragon-software.com> In-Reply-To: <d7c91201-5e09-5c06-3283-7887f5a5b7f1@paragon-software.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.211.36] X-ClientProxiedBy: vdlg-exch-02.paragon-software.com (172.30.1.105) To vdlg-exch-02.paragon-software.com (172.30.1.105) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757905286647501455?= X-GMAIL-MSGID: =?utf-8?q?1757905286647501455?= |
Series |
fs/ntfs3: Bugfix and refactoring
|
|
Commit Message
Konstantin Komarov
Feb. 15, 2023, 1:36 p.m. UTC
The current volume flags are updated only if VOLUME_FLAG_DIRTY has been
changed.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
fs/ntfs3/fsntfs.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
* Do not change state if fs was real_dirty.
@@ -957,6 +958,8 @@ int ntfs_set_state(struct ntfs_sb_info *sbi, enum
NTFS_DIRTY_FLAGS dirty)
goto out;
}
+ info_flags = info->flags;
+
switch (dirty) {
case NTFS_DIRTY_ERROR:
ntfs_notice(sbi->sb, "Mark volume as dirty due to NTFS errors");
@@ -970,8 +973,10 @@ int ntfs_set_state(struct ntfs_sb_info *sbi, enum
NTFS_DIRTY_FLAGS dirty)
break;
}
/* Cache current volume flags. */
- sbi->volume.flags = info->flags;
- mi->dirty = true;
+ if (info_flags != info->flags) {
+ sbi->volume.flags = info->flags;
+ mi->dirty = true;
+ }
err = 0;
out:
diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index 342938704cfd..d888ba14237f 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -925,6 +925,7 @@ int ntfs_set_state(struct ntfs_sb_info *sbi, enum NTFS_DIRTY_FLAGS dirty) struct VOLUME_INFO *info; struct mft_inode *mi; struct ntfs_inode *ni; + __le16 info_flags; /*