From 4f03c199dff64ff3e50eba1dc8eadc8e368eac66 Mon Sep 17 00:00:00 2001 From: jpandre Date: Wed, 14 May 2008 08:27:55 +0000 Subject: [PATCH] Adapted to ntfs-3g-1.2506 --- libntfs-3g/bootsect.c | 11 ++++++++--- libntfs-3g/lcnalloc.c | 2 +- src/utils.c | 7 ++++--- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/libntfs-3g/bootsect.c b/libntfs-3g/bootsect.c index f13a11cd..f3ffb5d1 100644 --- a/libntfs-3g/bootsect.c +++ b/libntfs-3g/bootsect.c @@ -151,6 +151,13 @@ not_ntfs: return ret; } +static const char *last_sector_error = +"HINTS: Either the volume is a RAID/LDM but it wasn't setup yet,\n" +" or it was not setup correctly (e.g. by not using mdadm --build ...),\n" +" or a wrong device is tried to be mounted,\n" +" or the partition table is corrupt (partition is smaller than NTFS),\n" +" or the NTFS boot sector is corrupt (NTFS size is not valid).\n"; + /** * ntfs_boot_sector_parse - setup an ntfs volume from an ntfs boot sector * @vol: ntfs_volume to setup @@ -198,9 +205,7 @@ int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs) SEEK_SET) == -1) { ntfs_log_perror("Failed to read last sector (%lld)", (long long)sectors); - ntfs_log_error("Perhaps the volume is a RAID/LDM but it wasn't " - "setup yet, or the\nwrong device was used, " - "or the partition table is incorrect.\n" ); + ntfs_log_error("%s", last_sector_error); return -1; } diff --git a/libntfs-3g/lcnalloc.c b/libntfs-3g/lcnalloc.c index 1e38fb66..abbd83de 100644 --- a/libntfs-3g/lcnalloc.c +++ b/libntfs-3g/lcnalloc.c @@ -316,7 +316,7 @@ runlist *ntfs_cluster_alloc(ntfs_volume *vol, VCN start_vcn, s64 count, bmp_pos &= ~7; writeback = 0; - while (1) { + while (lcn < buf_size) { byte = buf + (lcn >> 3); bit = 1 << (lcn & 7); if (has_guess) { diff --git a/src/utils.c b/src/utils.c index cb01ac53..f59683d0 100644 --- a/src/utils.c +++ b/src/utils.c @@ -85,9 +85,10 @@ static const char *opened_volume_msg = "could be identified for example by the help of the 'fuser' command.\n"; static const char *fakeraid_msg = -"You seem to have a SoftRAID/FakeRAID hardware and must use an activated,\n" -"different device under /dev/mapper/, (e.g. /dev/mapper/nvidia_eahaabcc1)\n" -"to mount NTFS. Please see the 'dmraid' documentation for help.\n"; +"Either the device is missing or it's powered down, or you have\n" +"SoftRAID hardware and must use an activated, different device under\n" +"/dev/mapper/, (e.g. /dev/mapper/nvidia_eahaabcc1) to mount NTFS.\n" +"Please see the 'dmraid' documentation for help.\n"; static const char *access_denied_msg = "Please check '%s' and the ntfs-3g binary permissions,\n"