From patchwork Mon Jul 3 07:25:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Konstantin Komarov X-Patchwork-Id: 115201 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp345934vqx; Mon, 3 Jul 2023 00:33:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlFzfOSrXwjluqiCMX6up0gRQwTZ2jA3IWMjNx08aGWdj5kabmNnyT8f9SQEbO8mwKqkC+Y8 X-Received: by 2002:a17:903:786:b0:1b3:ec39:f42c with SMTP id kn6-20020a170903078600b001b3ec39f42cmr10076592plb.5.1688369616575; Mon, 03 Jul 2023 00:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688369616; cv=none; d=google.com; s=arc-20160816; b=qC3A/bfSlbAeJNIRkUMQEScVaTkXzMA8OWNg9RR+1WWrZMTKcdoblwWsPbdyLNsVxI ug8+Ff9yJCNXJh7hX8T3LZhbczyIKb5DP8U2vlQx6IHKPhZKGqwotRtVwd/k/qhq3KpS vuxrgC9l05wp13quVSeZLG946lVKc9TmmOV0jCiEBhI+r8pkS0KUX+bKo9CUlaqqDbJV MWJZttrd/EUkcvSENAuAc1B7VfJB7mOlcDwUtk6AOm1voSXrAJCZWQWZ1Wv8odvbn0rR 3ai4DJNdeSwuPS+ALt8Mf/8ol3/fs+r+d5g1p/VR1TtuZ0zMcTyeNJsVU9XCRozcQCDI eBow== 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=HNQF4HBbkbbtfs/+y+hwwE6jqL+QQ9MoDuKoaujlRVA=; fh=+YFVdCJq57+piIgB3kUO3LUIuYykw/jnC0zhAUs0Z14=; b=EVZBllE5x+EcmJFZ1A4wWhUvU4CtPhD3aBVHd+qUBwEQ1D+hk+DhfT/L6QccdLiFh/ J4pjDgjrRPaiih5xP8JAJox3ZpsO537uoWBuzJlCYFCAKGPIkcG0jXXgVweyjTrPvxay dbnoScJkztmOF6+Vtlon5NPw2NBHhXn2I5taAJuE9SSaizKxgRpeFM9Isf1N/cltQyh9 AU6d+ff8aSXAld+cOGs+rVhpOAdu8SmCLInjCqOqS96vR1bGXFjB0C1SgFQYU/S+B07p fQyhEtajg0/cLAjJBg1nK6N3WJmNbISKzCqUoGPCuzYR3bvEyVy6rFl2HQN4oznKdb+p uBlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@paragon-software.com header.s=mail header.b=hOGcwcG1; 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 e17-20020a17090301d100b001b89bd6fd59si964804plh.215.2023.07.03.00.33.24; Mon, 03 Jul 2023 00:33:36 -0700 (PDT) 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=hOGcwcG1; 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 S230351AbjGCHZU (ORCPT + 99 others); Mon, 3 Jul 2023 03:25:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230394AbjGCHZQ (ORCPT ); Mon, 3 Jul 2023 03:25:16 -0400 X-Greylist: delayed 78 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 03 Jul 2023 00:25:11 PDT Received: from relayaws-01.paragon-software.com (relayaws-01.paragon-software.com [35.157.23.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A192DE44; Mon, 3 Jul 2023 00:25:11 -0700 (PDT) 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 4FC781D74; Mon, 3 Jul 2023 07:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paragon-software.com; s=mail; t=1688368798; bh=HNQF4HBbkbbtfs/+y+hwwE6jqL+QQ9MoDuKoaujlRVA=; h=Date:Subject:From:To:CC:References:In-Reply-To; b=hOGcwcG1jbJ4se1vlTg/W5WaRKGWc44Bq9SzAw5Jb9TxByG1vGa3Mr+Iwd5Ly5i1B VbZuU0TYKlIOIwqTe6c9wx+0Em4Ug+UbOJQCEOesR9KWgDJo1zr/d3WKzDBMyFI6WV BSWaDR92yG1LPRDrgP2xQTjvWGpnMaU/ea6jfyk0= Received: from [192.168.211.138] (192.168.211.138) 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; Mon, 3 Jul 2023 10:25:09 +0300 Message-ID: <55b51679-e500-353c-d670-74e2f7697155@paragon-software.com> Date: Mon, 3 Jul 2023 11:25:08 +0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: [PATCH 2/8] fs/ntfs3: Write immediately updated ntfs state Content-Language: en-US From: Konstantin Komarov To: CC: Linux Kernel Mailing List , References: In-Reply-To: X-Originating-IP: [192.168.211.138] 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, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770383859162652043?= X-GMAIL-MSGID: =?utf-8?q?1770383859162652043?= Signed-off-by: Konstantin Komarov ---  fs/ntfs3/fsntfs.c | 13 +++----------  1 file changed, 3 insertions(+), 10 deletions(-)  } diff --git a/fs/ntfs3/fsntfs.c b/fs/ntfs3/fsntfs.c index 33afee0f5559..edb51dc12f65 100644 --- a/fs/ntfs3/fsntfs.c +++ b/fs/ntfs3/fsntfs.c @@ -983,18 +983,11 @@ int ntfs_set_state(struct ntfs_sb_info *sbi, enum NTFS_DIRTY_FLAGS dirty)      if (err)          return err; -    mark_inode_dirty(&ni->vfs_inode); +    mark_inode_dirty_sync(&ni->vfs_inode);      /* verify(!ntfs_update_mftmirr()); */ -    /* -     * If we used wait=1, sync_inode_metadata waits for the io for the -     * inode to finish. It hangs when media is removed. -     * So wait=0 is sent down to sync_inode_metadata -     * and filemap_fdatawrite is used for the data blocks. -     */ -    err = sync_inode_metadata(&ni->vfs_inode, 0); -    if (!err) -        err = filemap_fdatawrite(ni->vfs_inode.i_mapping); +    /* write mft record on disk. */ +    err = _ni_write_inode(&ni->vfs_inode, 1);      return err;