summaryrefslogtreecommitdiff
path: root/ext4_utils
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-08-04 15:11:53 -0700
committerColin Cross <ccross@android.com>2010-08-04 15:11:53 -0700
commitcf5c39c1851f8826264822414dbab31c1aeaeec6 (patch)
treea296cf6ed40cb66dba2ff298ceb4062bd5baa375 /ext4_utils
parentde61f980c7b034eefac6e0ace718b3c1eb3f6252 (diff)
downloadextras-cf5c39c1851f8826264822414dbab31c1aeaeec6.tar.gz
Fix zero length files
Zero length files should just skip the block allocation so the inode extent fields are empty. Change-Id: I40a6ba32b0a7f842e5d752e8cd70dfda878b8998
Diffstat (limited to 'ext4_utils')
-rw-r--r--ext4_utils/contents.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c
index 8bed822d..9fcd3b30 100644
--- a/ext4_utils/contents.c
+++ b/ext4_utils/contents.c
@@ -173,7 +173,8 @@ u32 make_file(const char *filename, u64 len)
return EXT4_ALLOCATE_FAILED;
}
- inode_allocate_file_extents(inode, len, filename);
+ if (len > 0)
+ inode_allocate_file_extents(inode, len, filename);
inode->i_mode = S_IFREG;
inode->i_links_count = 1;