diff options
author | Colin Cross <ccross@android.com> | 2012-11-26 13:01:12 -0800 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2012-11-26 13:01:13 -0800 |
commit | 3861978ea090352f80bc4b50cb1c2d0fa6dc08da (patch) | |
tree | 0e5d12447367544c56cd27e3243706feeb118f6f | |
parent | 1eda334e947485b6b406a087167b9fb311933d32 (diff) | |
parent | 8748938228acad9e53c4f3cdfa132d2aff7917bf (diff) | |
download | extras-3861978ea090352f80bc4b50cb1c2d0fa6dc08da.tar.gz |
Merge "make_ext4fs: fix dentry padding when dentry size is 4088 or 4092"
-rw-r--r-- | ext4_utils/contents.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c index 8d20eb2f..63006808 100644 --- a/ext4_utils/contents.c +++ b/ext4_utils/contents.c @@ -44,11 +44,6 @@ static u32 dentry_size(u32 entries, struct dentry *dentries) len += dentry_len; } - /* include size of the dentry used to pad until the end of the block */ - if (len % info.block_size + 8 > info.block_size) - len += info.block_size - (len % info.block_size); - len += 8; - return len; } @@ -160,11 +155,8 @@ u32 make_directory(u32 dir_inode_num, u32 entries, struct dentry *dentries, } } - dentry = (struct ext4_dir_entry_2 *)(data + offset); - dentry->inode = 0; - dentry->rec_len = len - offset; - dentry->name_len = 0; - dentry->file_type = EXT4_FT_UNKNOWN; + /* pad the last dentry out to the end of the block */ + dentry->rec_len += len - offset; return inode_num; } |