From 89de050c94c8020c08e95c324b654de77fcee35b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 23 Apr 2014 09:47:21 +0200 Subject: [PATCH] Fixed $Bitmap size in the root index in ntfsresize When the partition is resized, the global bitmap size is adjusted accordingly, however so far the new size was not set into the parent index (only minor consequences). --- ntfsprogs/ntfsresize.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index c08d9e2f..41f27b5f 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -2357,6 +2357,8 @@ static void truncate_bitmap_data_attr(ntfs_resize_t *resize) lcnbmp_na->data_size = bm_bsize; lcnbmp_na->initialized_size = bm_bsize; lcnbmp_na->allocated_size = nr_bm_clusters << vol->cluster_size_bits; + vol->lcnbmp_ni->data_size = bm_bsize; + vol->lcnbmp_ni->allocated_size = lcnbmp_na->allocated_size; a->highest_vcn = cpu_to_sle64(nr_bm_clusters - 1LL); a->allocated_size = cpu_to_sle64(nr_bm_clusters * vol->cluster_size); a->data_size = cpu_to_sle64(bm_bsize); @@ -2554,6 +2556,12 @@ static void truncate_bitmap_file(ntfs_resize_t *resize) perr_exit("Couldn't update $Bitmap"); } + /* If successful, update cache and sync $Bitmap */ + memcpy(vol->lcnbmp_ni->mrec,resize->ctx->mrec,vol->mft_record_size); + ntfs_inode_mark_dirty(vol->lcnbmp_ni); + NInoFileNameSetDirty(vol->lcnbmp_ni); + ntfs_inode_sync(vol->lcnbmp_ni); + #if CLEAN_EXIT close_inode_and_context(resize->ctx); #else