mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
NTFS: Fix several occurences of a bug where we would perform 'var & ~const'
with a 64-bit variable and a int, i.e. 32-bit, constant. This causes the higher order 32-bits of the 64-bit variable to be zeroed. To fix this cast the 'const' to the same 64-bit type as 'var'. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
This commit is contained in:
parent
ca8fd7a0c6
commit
3bd1f4a173
5 changed files with 12 additions and 7 deletions
|
@ -293,7 +293,7 @@ runlist_element *ntfs_cluster_alloc(ntfs_volume *vol, const VCN start_vcn,
|
|||
buf_size = i_size - last_read_pos;
|
||||
buf_size <<= 3;
|
||||
lcn = bmp_pos & 7;
|
||||
bmp_pos &= ~7;
|
||||
bmp_pos &= ~(LCN)7;
|
||||
ntfs_debug("Before inner while loop: buf_size %i, lcn 0x%llx, "
|
||||
"bmp_pos 0x%llx, need_writeback %i.", buf_size,
|
||||
(unsigned long long)lcn,
|
||||
|
@ -311,7 +311,7 @@ runlist_element *ntfs_cluster_alloc(ntfs_volume *vol, const VCN start_vcn,
|
|||
(unsigned int)*byte);
|
||||
/* Skip full bytes. */
|
||||
if (*byte == 0xff) {
|
||||
lcn = (lcn + 8) & ~7;
|
||||
lcn = (lcn + 8) & ~(LCN)7;
|
||||
ntfs_debug("Continuing while loop 1.");
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue