Changes by: aia21
Update of /cvs/linux-ntfs/ntfsprogs/ntfsprogs
In directory delta357:/tmp/cvs-serv27001/ntfsprogs
Modified Files:
ntfsresize.c
Log Message:
Disable unmounting at the point of no return when we start doing serious
modifications to the volume. Hopefully Szaka will be happy now. (-:
Index: ntfsresize.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/ntfsprogs/ntfsresize.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -p -r1.125 -r1.126
--- ntfsresize.c 28 Nov 2006 11:00:53 -0000 1.125
+++ ntfsresize.c 28 Nov 2006 13:45:42 -0000 1.126
@@ -215,6 +215,9 @@ s64 max_free_cluster_range = 0;
#define NTFS_MAX_CLUSTER_SIZE (65536)
+/* Global volume variable pointer for atexit() unmount purposes. */
+static ntfs_volume *g_vol;
+
static s64 rounded_up_division(s64 numer, s64 denom)
{
return (numer + (denom - 1)) / denom;
@@ -2291,6 +2294,11 @@ static void prepare_volume_fixup(ntfs_vo
NVolSetWasDirty(vol);
if (vol->dev->d_ops->sync(vol->dev) == -1)
perr_exit("Failed to sync device");
+ /*
+ * We are starting to do irreversible volume changes now, thus we no
+ * longer consider it safe to perform a unmount of the volume.
+ */
+ g_vol = NULL;
}
@@ -2359,8 +2367,6 @@ static void check_cluster_allocation(ntf
compare_bitmaps(vol, &fsck->lcn_bitmap);
}
-static ntfs_volume *g_vol;
-
static void ntfsresize_atexit(void) {
if (g_vol && ntfs_umount(g_vol, 0) < 0)
perror("Failed to unmount volume");
|