summaryrefslogtreecommitdiff
path: root/mkfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mkfs.c')
-rw-r--r--mkfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mkfs.c b/mkfs.c
index 2dc90c24..2f7dfef7 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -619,6 +619,9 @@ static int add_file_items(struct btrfs_trans_handle *trans,
struct extent_buffer *eb = NULL;
int fd;
+ if (st->st_size == 0)
+ return 0;
+
fd = open(path_name, O_RDONLY);
if (fd == -1) {
fprintf(stderr, "%s open failed\n", path_name);