fs/ntfs3: Don't clear upper bits accidentally in log_replay()

The "vcn" variable is a 64 bit.  The "log->clst_per_page" variable is a
u32.  This means that the mask accidentally clears out the high 32 bits
when it was only supposed to clear some low bits.  Fix this by adding a
cast to u64.

Fixes: b46acd6a6a ("fs/ntfs3: Add NTFS journal")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
Dan Carpenter 2022-05-09 12:03:00 +03:00 committed by Konstantin Komarov
parent 19e890ff3b
commit 926034353d
No known key found for this signature in database
GPG Key ID: A9B0331F832407B6

View File

@ -5057,7 +5057,7 @@ undo_action_next:
goto add_allocated_vcns; goto add_allocated_vcns;
vcn = le64_to_cpu(lrh->target_vcn); vcn = le64_to_cpu(lrh->target_vcn);
vcn &= ~(log->clst_per_page - 1); vcn &= ~(u64)(log->clst_per_page - 1);
add_allocated_vcns: add_allocated_vcns:
for (i = 0, vcn = le64_to_cpu(lrh->target_vcn), for (i = 0, vcn = le64_to_cpu(lrh->target_vcn),