From d96ae8d7daf680a06da52f59e5376c6c1a1fbec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 17 Apr 2015 10:27:24 +0200 Subject: [PATCH] Removed the double try to unmount partition in ntfsfix When the unmounting of the partition fails after running ntfsfix, a second try was attempted. This cannot be done and leads to more errors because some essential records have been freed, so better quit without making a second try. --- ntfsprogs/ntfsfix.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ntfsprogs/ntfsfix.c b/ntfsprogs/ntfsfix.c index 59b8a98f..add14d06 100644 --- a/ntfsprogs/ntfsfix.c +++ b/ntfsprogs/ntfsfix.c @@ -4,7 +4,7 @@ * Copyright (c) 2000-2006 Anton Altaparmakov * Copyright (c) 2002-2006 Szabolcs Szakacsits * Copyright (c) 2007 Yura Pakhuchiy - * Copyright (c) 2011-2014 Jean-Pierre Andre + * Copyright (c) 2011-2015 Jean-Pierre Andre * * This utility fixes some common NTFS problems, resets the NTFS journal file * and schedules an NTFS consistency check for the first boot into Windows. @@ -154,7 +154,7 @@ static void version(void) "Copyright (c) 2000-2006 Anton Altaparmakov\n" "Copyright (c) 2002-2006 Szabolcs Szakacsits\n" "Copyright (c) 2007 Yura Pakhuchiy\n" - "Copyright (c) 2011-2014 Jean-Pierre Andre\n\n", + "Copyright (c) 2011-2015 Jean-Pierre Andre\n\n", EXEC_NAME, VERSION); ntfs_log_info("%s\n%s%s", ntfs_gpl, ntfs_bugs, ntfs_home); exit(0); @@ -1646,8 +1646,10 @@ int main(int argc, char **argv) /* Set return code to 0. */ ret = 0; error_exit: - if (ntfs_umount(vol, 0)) - ntfs_umount(vol, 1); + if (ntfs_umount(vol, 1)) { + ntfs_log_info("Failed to unmount partition\n"); + ret = 1; + } if (ret) exit(ret); return ret;