diff --git a/ChangeLog b/ChangeLog index e33b3424..5cd6163e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -60,6 +60,7 @@ xx/xx/2005 - 1.12.0-WIP when calling ntfs_attr_get_search_ctx() except a very few cases which genuinely need this functionality as they work on a too low level. Make sure all those cases are ok. + - ntfsclone: fix saving by sectors during --rescue (Scott Hansen, Szaka) 08/08/2005 - 1.11.2 - ntfsdecrypt now works and lots of fixes and improvements. diff --git a/ntfsprogs/ntfsclone.c b/ntfsprogs/ntfsclone.c index 6e929e43..190dd7c2 100644 --- a/ntfsprogs/ntfsclone.c +++ b/ntfsprogs/ntfsclone.c @@ -496,18 +496,21 @@ static void rescue_sector(void *fd, off_t pos, void *buff) } -static void copy_cluster(int rescue, off_t rescue_pos) +static void copy_cluster(int rescue, u64 rescue_lcn) { char buff[NTFS_MAX_CLUSTER_SIZE]; /* overflow checked at mount time */ /* vol is NULL if opt.restore_image is set */ u32 csize = image_hdr.cluster_size; void *fd = (void *)&fd_in; + off_t rescue_pos; if (!opt.restore_image) { csize = vol->cluster_size; fd = vol->dev; } + rescue_pos = (off_t)(rescue_lcn * csize); + if (read_all(fd, buff, csize) == -1) { if (errno != EIO)