Skip to content

Commit

Permalink
fs/ntfs3: Write immediately updated ntfs state
Browse files Browse the repository at this point in the history
[ Upstream commit 06ccfb0 ]

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
aalexandrovich authored and gregkh committed Nov 8, 2023
1 parent 8d3d7db commit 28ece3b
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions fs/ntfs3/fsntfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 28ece3b

Please sign in to comment.