OSDN Git Service

make_ext4fs: fix dentry padding when dentry size is 4088 or 4092
authorColin Cross <ccross@android.com>
Tue, 20 Nov 2012 22:07:39 +0000 (14:07 -0800)
committerColin Cross <ccross@android.com>
Wed, 28 Nov 2012 21:23:22 +0000 (13:23 -0800)
commitcb95c864fe069eecb88807cbbb456baf9ee2c44d
treeee19b6a6c4e33c4b9328265c1f2943b69c022721
parentc3dc8929286e3f3b46d4d014c5b7aeecb416f4e0
make_ext4fs: fix dentry padding when dentry size is 4088 or 4092

When the total dentry size is N * 4096 - 4 or N * 4096 - 8, there is
not enough room in the block to insert an extra padding dentry.
Instead, switch to always padding the previous dentry out to the end
of the block, which matches what the kernel does when creating new
directory entries.

Also fix dentry_size to return the size of all the dentries
without the padding, the len + 8 padding is incorrect, and the
DIV_ROUND_UP will round up to the correct number of blocks.

Change-Id: If11f90e4ee172c135a0eae2a50b8be213e2dd0dc
ext4_utils/contents.c