Hi Rakesh,

Sounds good.

My feeling however is that the identification of
actions which have to be redone or redone needs
reworking.

Jean-Pierre

Rakesh Pandit wrote:
> If start buffer is latest then restart, we update committed LSN with
> last record LSN of block (last_end_lsn) while applying action but
> forget about it while printing records with -f for investigation
> purpose.
>
> Note that while applying actions we use start_buffer to calculate
> latest page out of block 2 and block 3 and then from latest take
> committed LSN. For -f we don't need buffers so we just compare
> directly with committed LSN from restart.
> ---
>   ntfsprogs/ntfsrecover.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/ntfsprogs/ntfsrecover.c b/ntfsprogs/ntfsrecover.c
> index 567db15..47e01d7 100644
> --- a/ntfsprogs/ntfsrecover.c
> +++ b/ntfsprogs/ntfsrecover.c
> @@ -3720,6 +3720,20 @@ static int walk(CONTEXT *ctx)
>                               }
>               if (!done) {
>                       buf = nextbuf;
> +                     if (blk >= RSTBLKS && blk < BASEBLKS) {
> +                             /* The latest buf may be more recent
> +                                than restart */
> +                             rph = &buf->block.record;
> +                             if ((s64)(le64_to_cpu(rph->last_end_lsn)
> +                                       - committed_lsn) > 0) {
> +                                     committed_lsn =
> +                                             le64_to_cpu(rph->last_end_lsn);
> +                                     if (optv)
> +                                             printf("* Restart page was "
> +                                                    "obsolete, updated "
> +                                                    "committed lsn\n");
> +                             }
> +                     }
>                       if (optv)
>                               printf("\n* block %d at 0x%llx\n",(int)blk,
>                                       (long long)loclogblk(ctx, blk));
>


------------------------------------------------------------------------------
_______________________________________________
ntfs-3g-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to