Skip to content

Commit

Permalink
Trunk Build 851
Browse files Browse the repository at this point in the history
  • Loading branch information
datalight-devops committed Oct 31, 2019
1 parent 695f443 commit 4acdc17
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions core/driver/inodedata.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,10 +599,13 @@ static REDSTATUS TruncDindir(
uint16_t uStart = pInode->uDindirEntry; /* pInode->uDindirEntry will change. */
uint32_t ulDindirOffset = (uint32_t)pInode->uIndirEntry + ((uint32_t)uStart * INDIR_ENTRIES);
uint32_t ulDindirDataBlock = ulBlock - ulDindirOffset;
uint32_t ulDindirEntriesMax = ((INODE_DATA_BLOCKS - ulDindirDataBlock) + (INDIR_ENTRIES - 1U)) / INDIR_ENTRIES;
uint32_t ulDindirEntries = REDMIN(INDIR_ENTRIES, ulDindirEntriesMax);
uint32_t ulBlocksTillMax = INODE_DATA_BLOCKS - ulDindirDataBlock;
uint32_t ulDindirEntriesMax = (ulBlocksTillMax / INDIR_ENTRIES)
/* Rounding up in this way avoids 32-bit overflow. */
+ (((ulBlocksTillMax % INDIR_ENTRIES) != 0U) ? (uint32_t)1U : (uint32_t)0U);
uint16_t uDindirEntries = (uint16_t)REDMIN(INDIR_ENTRIES, ulDindirEntriesMax);

for(uEntry = uStart; uEntry < ulDindirEntries; uEntry++)
for(uEntry = uStart; uEntry < uDindirEntries; uEntry++)
{
/* Seek so that TruncIndir() has the correct indirect
buffer and indirect entry.
Expand Down
2 changes: 1 addition & 1 deletion include/redver.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<!-- This macro is updated automatically: do not edit! -->
*/
#define RED_BUILD_NUMBER "850"
#define RED_BUILD_NUMBER "851"

#define RED_KIT_GPL 0U /* Open source GPL kit. */
#define RED_KIT_COMMERCIAL 1U /* Commercially-licensed kit. */
Expand Down

0 comments on commit 4acdc17

Please sign in to comment.