diff options
author | Colin Cross <ccross@android.com> | 2012-05-06 23:19:33 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-05-06 23:19:33 -0700 |
commit | f3ae92dddc7f5d4afe23bae9e2382d15224b0d6d (patch) | |
tree | a7d6d6d28b41eecb3ca6f5f68ee18b133ee6fe0f | |
parent | eb213e7201b7288df2d2ec7e785349d993828bd3 (diff) | |
parent | 16052ec56a0836db7de51d6ea4173c6b53f0a9b9 (diff) | |
download | extras-f3ae92dddc7f5d4afe23bae9e2382d15224b0d6d.tar.gz |
am 16052ec5: Merge "ext4_utils: Fix long symbolic links"
* commit '16052ec56a0836db7de51d6ea4173c6b53f0a9b9':
ext4_utils: Fix long symbolic links
-rw-r--r-- | ext4_utils/indirect.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext4_utils/indirect.c b/ext4_utils/indirect.c index 4e768a16..70f04d6e 100644 --- a/ext4_utils/indirect.c +++ b/ext4_utils/indirect.c @@ -484,9 +484,10 @@ u8 *inode_allocate_data_indirect(struct ext4_inode *inode, unsigned long len, unsigned long backing_len) { struct block_allocation *alloc; + u32 block_len = DIV_ROUND_UP(len, info.block_size); u8 *data = NULL; - alloc = do_inode_allocate_indirect(inode, len); + alloc = do_inode_allocate_indirect(inode, block_len); if (alloc == NULL) { error("failed to allocate extents for %lu bytes", len); return NULL; @@ -498,6 +499,10 @@ u8 *inode_allocate_data_indirect(struct ext4_inode *inode, unsigned long len, error("failed to create backing for %lu bytes", backing_len); } + rewind_alloc(alloc); + if (do_inode_attach_indirect(inode, alloc, block_len)) + error("failed to attach blocks to indirect inode"); + free_alloc(alloc); return data; |