diff options
author | Jin Qian <jinqian@google.com> | 2017-08-28 12:38:39 -0700 |
---|---|---|
committer | Jin Qian <jinqian@google.com> | 2017-08-28 12:38:39 -0700 |
commit | bb581bde62d77b367c13bd56821f279ce1701c1b (patch) | |
tree | 27a9ab0ce503d25340a19657f62493a09a58cafc | |
parent | 36e33dd549f01a773b49d6307fc5c8925ef4d768 (diff) | |
download | extras-bb581bde62d77b367c13bd56821f279ce1701c1b.tar.gz |
ext4_utils: skip symbolic links in basefs file
base_fs uses actual file size instead of size of symlink itself to
reserve data blocks. This caused extra data blocks to be reserved
and failed e2fsck.
Bug: 35262536
Change-Id: I0e9b0cc99a0f9a33596928b01468426fc2d34ab0
-rw-r--r-- | ext4_utils/make_ext4fs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c index 58069f31..0151026a 100644 --- a/ext4_utils/make_ext4fs.c +++ b/ext4_utils/make_ext4fs.c @@ -628,6 +628,13 @@ static void extract_base_fs_allocations(const char *directory, const char *mount int start_block, end_block; u32 block_file_size; u32 real_file_block_size; + struct stat buf; + + if (lstat(real_file_name, &buf) == -1) + critical_error(err_msg); + + if (!S_ISREG(buf.st_mode)) + continue; real_file_fd = open(real_file_name, O_RDONLY); if (real_file_fd == -1) { |