From 19c9c5dff3277e06508a017f0abb6c31d2d87a58 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Fri, 27 Dec 2002 23:14:11 +0000 Subject: [PATCH] ntfs_umount() now also does an fdatasync() on the device before closing it. (Logical change 1.64) --- libntfs/volume.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libntfs/volume.c b/libntfs/volume.c index eabc6f5a..77cca83c 100644 --- a/libntfs/volume.c +++ b/libntfs/volume.c @@ -55,12 +55,6 @@ static ntfs_volume *__ntfs_volume_allocate(void) */ static void __ntfs_volume_release(ntfs_volume *v) { - if (v->fd) - close(v->fd); - if (v->dev_name) - free(v->dev_name); - if (v->vol_name) - free(v->vol_name); if (v->lcnbmp_na) ntfs_attr_close(v->lcnbmp_na); if (v->lcnbmp_ni) @@ -75,6 +69,14 @@ static void __ntfs_volume_release(ntfs_volume *v) ntfs_attr_close(v->mftmirr_na); if (v->mftmirr_ni) ntfs_inode_close(v->mftmirr_ni); + if (v->fd) { + fdatasync(v->fd); + close(v->fd); + } + if (v->dev_name) + free(v->dev_name); + if (v->vol_name) + free(v->vol_name); if (v->upcase) free(v->upcase); free(v);