From d016f808d52c577172db0a6057d5ab6850860b9f Mon Sep 17 00:00:00 2001 From: szaka Date: Mon, 18 Jul 2005 22:09:47 +0000 Subject: [PATCH] Fix read-only shrinkage failure if new size was too small by relocating and writing $Bitmap:$DATA only once. This also improves performance. --- ntfsprogs/ntfsresize.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index d7aa3a20..54098c63 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -750,6 +750,9 @@ static void collect_relocation_info(ntfs_resize_t *resize, runlist *rl) if (lcn + lcn_length <= new_vol_size) return; + if (inode == FILE_Bitmap && resize->ctx->attr->type == AT_DATA) + return; + start = lcn; len = lcn_length; @@ -1639,6 +1642,10 @@ static void relocate_attributes(ntfs_resize_t *resize) else if (ret == 1) break; + if (resize->mref == FILE_Bitmap && + resize->ctx->attr->type == AT_DATA) + break; + relocate_attribute(resize); }