From a38ead2f2056f442b3fd008efa0e4f7db60f8755 Mon Sep 17 00:00:00 2001 From: aia21 Date: Mon, 11 Dec 2006 10:41:34 +0000 Subject: [PATCH] Szaka prefers to have the lofgile reset and dirty bit setting done even if they are already done so remove the conditionals I added. --- ntfsprogs/ntfsfix.8.in | 4 ++-- ntfsprogs/ntfsfix.c | 2 +- ntfsprogs/ntfsresize.c | 32 +++++++++++++------------------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/ntfsprogs/ntfsfix.8.in b/ntfsprogs/ntfsfix.8.in index dfe1b485..1890e35e 100644 --- a/ntfsprogs/ntfsfix.8.in +++ b/ntfsprogs/ntfsfix.8.in @@ -14,14 +14,14 @@ is a utility that fixes some common NTFS problems. .B ntfsfix is .B NOT -a Linux version of chkdsk. It only repairs some fundamental NTFS +a Linux version of chkdsk. It only repairs some fundamental NTFS inconsistencies, resets the NTFS journal file and schedules an NTFS consistency check for the first boot into Windows. .sp You may run .B ntfsfix on an NTFS volume if you think it was damaged by Windows or some other way -and it can't be mounted. +and it cannot be mounted. .SH OPTIONS Below is a summary of all the options that .B ntfsfix diff --git a/ntfsprogs/ntfsfix.c b/ntfsprogs/ntfsfix.c index 50efe8ac..5aca7a9e 100644 --- a/ntfsprogs/ntfsfix.c +++ b/ntfsprogs/ntfsfix.c @@ -259,8 +259,8 @@ static int set_dirty_flag(ntfs_volume *vol) return -1; } vol->flags = flags; - ntfs_log_info(OK); NVolSetWasDirty(vol); + ntfs_log_info(OK); return 0; } diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index 62e28bb6..b5cbeddb 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -2289,25 +2289,19 @@ static ntfs_volume *mount_volume(void) */ static void prepare_volume_fixup(ntfs_volume *vol) { - /* No need to schedule chkdsk if it is already scheduled. */ - if (!NVolWasDirty(vol)) { - printf("Schedule chkdsk for NTFS consistency check at Windows " - "boot time ...\n"); - vol->flags |= VOLUME_IS_DIRTY; - if (ntfs_volume_write_flags(vol, vol->flags)) - perr_exit("Failed to set the volume dirty"); - NVolSetWasDirty(vol); - if (vol->dev->d_ops->sync(vol->dev) == -1) - perr_exit("Failed to sync device"); - } - /* No need to empty the journal if it is already empty. */ - if (!NVolLogFileEmpty(vol)) { - printf("Resetting $LogFile ... (this might take a while)\n"); - if (ntfs_logfile_reset(vol)) - perr_exit("Failed to reset $LogFile"); - if (vol->dev->d_ops->sync(vol->dev) == -1) - perr_exit("Failed to sync device"); - } + printf("Schedule chkdsk for NTFS consistency check at Windows boot " + "time ...\n"); + vol->flags |= VOLUME_IS_DIRTY; + if (ntfs_volume_write_flags(vol, vol->flags)) + perr_exit("Failed to set the volume dirty"); + NVolSetWasDirty(vol); + if (vol->dev->d_ops->sync(vol->dev) == -1) + perr_exit("Failed to sync device"); + printf("Resetting $LogFile ... (this might take a while)\n"); + if (ntfs_logfile_reset(vol)) + perr_exit("Failed to reset $LogFile"); + if (vol->dev->d_ops->sync(vol->dev) == -1) + perr_exit("Failed to sync device"); } static void set_disk_usage_constraint(ntfs_resize_t *resize)