diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index 0f992815..382badb1 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -1397,7 +1397,7 @@ static void mount_volume(unsigned long new_mntflag) exit(1); } - if (NVolWasDirty(vol)) + if (vol->flags & VOLUME_IS_DIRTY) if (opt.force-- <= 0) err_exit(dirty_volume_msg, opt.volume); diff --git a/ntfsprogs/ntfscp.c b/ntfsprogs/ntfscp.c index f85b372a..f6090f25 100644 --- a/ntfsprogs/ntfscp.c +++ b/ntfsprogs/ntfscp.c @@ -357,7 +357,7 @@ int main(int argc, char *argv[]) return 1; } - if (NVolWasDirty(vol) && !opts.force) + if ((vol->flags & VOLUME_IS_DIRTY) && !opts.force) goto umount; { diff --git a/ntfsprogs/ntfsfix.c b/ntfsprogs/ntfsfix.c index ba5c522f..a0220e6f 100644 --- a/ntfsprogs/ntfsfix.c +++ b/ntfsprogs/ntfsfix.c @@ -248,7 +248,9 @@ static int set_dirty_flag(ntfs_volume *vol) { le16 flags; - if (NVolWasDirty(vol)) + /* Porting note: We test for the current state of VOLUME_IS_DIRTY. This + * should actually be more appropriate than testing for NVolWasDirty. */ + if (vol->flags | VOLUME_IS_DIRTY) return 0; ntfs_log_info("Setting required flags on partition... "); /* diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index 680f2567..8f0d4e26 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -2262,7 +2262,7 @@ static ntfs_volume *mount_volume(void) exit(1); } - if (NVolWasDirty(vol)) + if (vol->flags & VOLUME_IS_DIRTY) if (opt.force-- <= 0) err_exit("Volume is scheduled for check.\nRun chkdsk /f" " and please try again, or see option -f.\n"); diff --git a/ntfsprogs/ntfswipe.c b/ntfsprogs/ntfswipe.c index 7b0578b7..93392dce 100644 --- a/ntfsprogs/ntfswipe.c +++ b/ntfsprogs/ntfswipe.c @@ -1348,7 +1348,7 @@ int main(int argc, char *argv[]) if (!vol) goto free; - if (NVolWasDirty(vol) && !opts.force) + if ((vol->flags & VOLUME_IS_DIRTY) && !opts.force) goto umount; if (opts.info) { diff --git a/ntfsprogs/utils.c b/ntfsprogs/utils.c index f3fe533c..947bddec 100644 --- a/ntfsprogs/utils.c +++ b/ntfsprogs/utils.c @@ -237,7 +237,11 @@ ntfs_volume * utils_mount_volume(const char *device, ntfs_mount_flags flags) return NULL; } - if (NVolWasDirty(vol)) { + /* Porting notes: + * libntfs-3g does not record whether the volume log file was dirty + * before mount, so we can only warn if the VOLUME_IS_DIRTY flag is set + * in VOLUME_INFORMATION. */ + if (vol->flags & VOLUME_IS_DIRTY) { if (!(flags & NTFS_MNT_FORCE)) { ntfs_log_error("%s", dirty_volume_msg); ntfs_umount(vol, FALSE);