lwext4.git
3 months agoFix order of variables. carl
Carl Hetherington [Thu, 1 Feb 2024 23:34:52 +0000 (00:34 +0100)]
Fix order of variables.

11 months agoBetter error log.
Carl Hetherington [Fri, 2 Jun 2023 14:43:30 +0000 (16:43 +0200)]
Better error log.

15 months agoReturn platform-specific errors via ext4_blockdev_errno 2400-ext-errors
Carl Hetherington [Thu, 29 Dec 2022 22:37:32 +0000 (23:37 +0100)]
Return platform-specific errors via ext4_blockdev_errno

15 months agoAdd a little more logging to mkfs.
Carl Hetherington [Sun, 29 Jan 2023 19:56:31 +0000 (20:56 +0100)]
Add a little more logging to mkfs.

22 months agoFix free block count in last block group.
Carl Hetherington [Mon, 20 Jun 2022 10:38:29 +0000 (12:38 +0200)]
Fix free block count in last block group.

This calculation is done when making the group bitmaps but wasn't
being done here, so e2fsck would give an error with certain partition
sizes.

22 months agoAdd local build script.
Carl Hetherington [Sun, 19 Jun 2022 20:52:36 +0000 (22:52 +0200)]
Add local build script.

22 months agoFix potential buffer overwrite.
Carl Hetherington [Sun, 19 Jun 2022 20:52:28 +0000 (22:52 +0200)]
Fix potential buffer overwrite.

22 months agoRevert "Don't initialise inode tables during format."
Carl Hetherington [Sat, 18 Jun 2022 16:42:08 +0000 (18:42 +0200)]
Revert "Don't initialise inode tables during format."

I think the flag which we were using here (to ask the OS to fill
in the inode tables when the drive is first mounted) is only
supported by ext4, so will be ignored when the disk is mounted
as ext2.

This means that e2fsck gives a long list of errors (DoM bug #2274).

This reverts commit 6d34064b3a4b07218b01f6cc7700ee2ce68a7542.

2 years agoFix some overflows when making larger partitions (e.g. 2TB) (DoM bug #2021)
Carl Hetherington [Fri, 28 May 2021 09:14:06 +0000 (11:14 +0200)]
Fix some overflows when making larger partitions (e.g. 2TB) (DoM bug #2021)

3 years agoMerge branch 'carl2-opt' into carl2
Carl Hetherington [Fri, 12 Mar 2021 22:24:01 +0000 (23:24 +0100)]
Merge branch 'carl2-opt' into carl2

Apply various optimisations, tested only on macOS.

3 years agoUse posix open/read/write/close as it seems to be much faster than stdio. carl2-opt
Carl Hetherington [Fri, 12 Mar 2021 21:09:57 +0000 (22:09 +0100)]
Use posix open/read/write/close as it seems to be much faster than stdio.

3 years agoAdd progress reporting for formatting.
Carl Hetherington [Mon, 8 Mar 2021 22:42:09 +0000 (23:42 +0100)]
Add progress reporting for formatting.

3 years agoDon't initialise inode tables during format.
Carl Hetherington [Mon, 8 Mar 2021 23:16:48 +0000 (00:16 +0100)]
Don't initialise inode tables during format.

3 years agoUse writebytes when writing group descriptors.
Carl Hetherington [Mon, 8 Mar 2021 23:24:39 +0000 (00:24 +0100)]
Use writebytes when writing group descriptors.

This may be faster but I should test it.  The code is cleaner and
should be equivalent, as far as I can see.

3 years agoWrite block/inode bitmaps and inode tables earlier.
Carl Hetherington [Mon, 8 Mar 2021 23:21:56 +0000 (00:21 +0100)]
Write block/inode bitmaps and inode tables earlier.

Before we would write blank block/inode bitmap tables then
fill them in later.  This is a bit of a hack to set up enough
of the data structures (I think) to allow the correct block/inode
bitmaps to be written first time.

This may not be worth the hack/risk - I haven't tested the
speed improvement carefully.

3 years agoIgnore .ccls-cache
Carl Hetherington [Sun, 7 Mar 2021 22:43:54 +0000 (23:43 +0100)]
Ignore .ccls-cache

3 years agoWrite all block group headers sequentially.
Carl Hetherington [Thu, 4 Mar 2021 19:53:18 +0000 (20:53 +0100)]
Write all block group headers sequentially.

Before this the code would write:

headers for blocks 0-127 (without group descriptors)
group descriptors for blocks 0-127 to all blocks on disk
headers for blocks 128-255
group descriptors for blocks 128-255 to all blocks on disk
...

3 years agoBuild both osx and osx-arm64 versions in a directory called osx.
Carl Hetherington [Thu, 7 Jan 2021 11:04:13 +0000 (12:04 +0100)]
Build both osx and osx-arm64 versions in a directory called osx.

When DCP-o-matic makes its universal binary it assumes that the
path to the arm64 library can be found by replacing x86_64 with
arm64 in the path.  This fails if we build the x86_64 version in
build_osx and the arm64 version in build_osx-arm64.

3 years agoRevert "Add -fPIC to Linux builds so the static lwext library can be linked with...
Carl Hetherington [Mon, 4 Jan 2021 14:17:01 +0000 (15:17 +0100)]
Revert "Add -fPIC to Linux builds so the static lwext library can be linked with the dynamic libdcpomatic2.so"

This reverts commit 0b38e3e62df25a89db98e101e530edf1a4316cd3.

3 years agoNew cdist/arm64 fixes.
Carl Hetherington [Thu, 24 Dec 2020 22:47:35 +0000 (23:47 +0100)]
New cdist/arm64 fixes.

3 years agoAdd -fPIC to Linux builds so the static lwext library can be linked with the dynamic...
Carl Hetherington [Tue, 1 Dec 2020 22:04:14 +0000 (23:04 +0100)]
Add -fPIC to Linux builds so the static lwext library can be linked with the dynamic libdcpomatic2.so

4 years agoAdd some more debugging.
Carl Hetherington [Thu, 30 Apr 2020 18:00:05 +0000 (20:00 +0200)]
Add some more debugging.

4 years agoI don't think we need the whole authopen dance now we're running the writer as root.
Carl Hetherington [Mon, 27 Apr 2020 20:56:20 +0000 (22:56 +0200)]
I don't think we need the whole authopen dance now we're running the writer as root.

4 years agoBuild static on Linux.
Carl Hetherington [Fri, 24 Apr 2020 19:12:10 +0000 (21:12 +0200)]
Build static on Linux.

4 years agoFix 32-bit windows build.
cah [Fri, 24 Apr 2020 18:49:19 +0000 (20:49 +0200)]
Fix 32-bit windows build.

4 years agoUse 64-bit quantities for partition size when writing MBR.
Carl Hetherington [Sun, 12 Apr 2020 21:37:22 +0000 (23:37 +0200)]
Use 64-bit quantities for partition size when writing MBR.

This fixes attempts to make partitions > 4GB.

4 years agoUse DISK_GEOMETRY_EX instead of plain DISK_GEOMETRY so that the disk size is returned...
Carl Hetherington [Sun, 12 Apr 2020 21:18:16 +0000 (23:18 +0200)]
Use DISK_GEOMETRY_EX instead of plain DISK_GEOMETRY so that the disk size is returned explicitly.

I'm not sure if this fixes any bugs but it makes the code cleaner.

4 years agoUse authopen to acquire permissions to write to drives on macOS.
Carl Hetherington [Sat, 4 Apr 2020 22:24:32 +0000 (00:24 +0200)]
Use authopen to acquire permissions to write to drives on macOS.

4 years agoFix for finding device sizes on macOS.
Carl Hetherington [Sat, 4 Apr 2020 19:13:17 +0000 (21:13 +0200)]
Fix for finding device sizes on macOS.

4 years agoWindows build hack.
Carl Hetherington [Tue, 25 Jun 2019 13:19:16 +0000 (14:19 +0100)]
Windows build hack.

4 years agoHacks to allow OS X build for 32-bit.
Carl Hetherington [Mon, 24 Jun 2019 20:31:00 +0000 (21:31 +0100)]
Hacks to allow OS X build for 32-bit.

4 years agoDon't build fs_test stuff; it fails to link on OS X because it
Carl Hetherington [Mon, 24 Jun 2019 12:07:42 +0000 (13:07 +0100)]
Don't build fs_test stuff; it fails to link on OS X because it
tries to build 64-bit executables with 32-bit libraries, for
some reason.

4 years agoAdd cscript.
Carl Hetherington [Tue, 18 Jun 2019 12:53:09 +0000 (13:53 +0100)]
Add cscript.

4 years agoFix #includes and build a shared library.
Carl Hetherington [Tue, 18 Jun 2019 11:05:34 +0000 (12:05 +0100)]
Fix #includes and build a shared library.

4 years agoBasic build for OS X.
Carl Hetherington [Tue, 11 Jun 2019 22:57:56 +0000 (23:57 +0100)]
Basic build for OS X.

4 years agoPossibly dubious patch to allow writing to partitions on Windows.
Carl Hetherington [Tue, 11 Jun 2019 22:27:22 +0000 (22:27 +0000)]
Possibly dubious patch to allow writing to partitions on Windows.

5 years agoMerge pull request #49 from sirocyl/patch-1 master origin/master
Grzegorz Kostka [Sun, 28 Apr 2019 15:40:05 +0000 (17:40 +0200)]
Merge pull request #49 from sirocyl/patch-1

Change badges to reflect project license status

5 years agoChange badges to reflect project license status
Tyler True [Sat, 27 Apr 2019 04:00:42 +0000 (00:00 -0400)]
Change badges to reflect project license status

While all source files except the two mentioned (ext4_xattr.c and ext4_extents.c) are BSD-3-clause, and it seems like this project may be licensed as such by removing those two files, the project license should be reflected as GPL v2.0, in accordance with the LICENSE file at the root of the project.

5 years agoMerge pull request #47 from MaskRay/jbd_commit_header
Grzegorz Kostka [Mon, 3 Dec 2018 01:34:40 +0000 (02:34 +0100)]
Merge pull request #47 from MaskRay/jbd_commit_header

Fix jbd_commit_header::chksum_{type,size}

5 years agoMerge pull request #46 from MaskRay/ext4_mkfs_info
Grzegorz Kostka [Mon, 3 Dec 2018 01:33:44 +0000 (02:33 +0100)]
Merge pull request #46 from MaskRay/ext4_mkfs_info

Fix ext4_mkfs_info::feat_{ro_compat,compat,incompat}

5 years agoMerge pull request #43 from MaskRay/cmake
Grzegorz Kostka [Mon, 3 Dec 2018 01:33:07 +0000 (02:33 +0100)]
Merge pull request #43 from MaskRay/cmake

Raise cmake_minimum_required: 2.8 -> 3.4

5 years agoMerge pull request #45 from MaskRay/include
Grzegorz Kostka [Mon, 3 Dec 2018 01:32:28 +0000 (02:32 +0100)]
Merge pull request #45 from MaskRay/include

Don't copy include

5 years agoMerge pull request #44 from MaskRay/const-const
Grzegorz Kostka [Mon, 3 Dec 2018 01:31:27 +0000 (02:31 +0100)]
Merge pull request #44 from MaskRay/const-const

Fix "const const" warning

5 years agoFix jbd_commit_header::chksum_{type,size}
Fangrui Song [Sun, 18 Nov 2018 06:39:12 +0000 (22:39 -0800)]
Fix jbd_commit_header::chksum_{type,size}

5 years agoFix ext4_mkfs_info::feat_{ro_compat,compat,incompat}
Fangrui Song [Sun, 18 Nov 2018 06:30:16 +0000 (22:30 -0800)]
Fix ext4_mkfs_info::feat_{ro_compat,compat,incompat}

5 years agoDon't copy include
Fangrui Song [Sat, 17 Nov 2018 23:03:32 +0000 (15:03 -0800)]
Don't copy include

5 years agoFix "const const" warning
Fangrui Song [Sun, 18 Nov 2018 21:48:31 +0000 (13:48 -0800)]
Fix "const const" warning

5 years agoRaise cmake_minimum_required: 2.8 -> 3.4
Fangrui Song [Mon, 19 Nov 2018 00:35:21 +0000 (16:35 -0800)]
Raise cmake_minimum_required: 2.8 -> 3.4

See CMP0065, otherwise -rdynamic is unconditionally added to linked executable. These .dynsym symbols are not really useful.

5 years agoext4: fix ext4_fsymlink creation
Grzegorz Kostka [Wed, 26 Sep 2018 20:35:36 +0000 (22:35 +0200)]
ext4: fix ext4_fsymlink creation

Solve the problem with long symbolic links creation.
Thanks to: @cobenhan

5 years agoext4_dir: fix non existing entry creation issue
rajeshvenkataraman [Sun, 23 Sep 2018 14:49:30 +0000 (07:49 -0700)]
ext4_dir: fix non existing entry creation issue

Added the length of the name string a a parameter.
Using strlen() on the name string may not give the correct length
in case of paths like: /mountpoint/nonexistdir1/nonexistdir2.

6 years agoext4: move ext4_fs_alloc_inode result check to right place
Grzegorz Kostka [Thu, 5 Apr 2018 08:54:24 +0000 (10:54 +0200)]
ext4: move ext4_fs_alloc_inode result check to right place

6 years agoMerge pull request #36 from mmmaisel/dev
Grzegorz Kostka [Thu, 1 Mar 2018 18:58:03 +0000 (19:58 +0100)]
Merge pull request #36 from mmmaisel/dev

Improvements from ext4-browser project

6 years agoMerge pull request #35 from mmmaisel/cmake
Grzegorz Kostka [Thu, 1 Mar 2018 18:51:41 +0000 (19:51 +0100)]
Merge pull request #35 from mmmaisel/cmake

CMake: Added option whether to build static or shared library

6 years agoMerge pull request #34 from mmmaisel/master
Grzegorz Kostka [Thu, 1 Mar 2018 18:51:06 +0000 (19:51 +0100)]
Merge pull request #34 from mmmaisel/master

Fix: ext4-mkfs and ext4-mbr-write use wrong partition size in case of multiple partitions

6 years agoCMake: Added option whether to build static or shared library
Max [Thu, 1 Mar 2018 16:20:35 +0000 (17:20 +0100)]
CMake: Added option whether to build static or shared library

6 years agoext4-mkfs: Use correct partition size
Max Maisel [Thu, 1 Mar 2018 16:18:15 +0000 (17:18 +0100)]
ext4-mkfs: Use correct partition size

6 years agoext4-mbr-write: Fixed partition size calculation
Max Maisel [Thu, 1 Mar 2018 16:16:18 +0000 (17:16 +0100)]
ext4-mbr-write: Fixed partition size calculation

6 years agoext4_mkfs: Added UUID parameter to create new filesystems with non-zero UUID
Max Maisel [Thu, 1 Mar 2018 16:31:32 +0000 (17:31 +0100)]
ext4_mkfs: Added UUID parameter to create new filesystems with non-zero UUID

6 years agoext4_mbr: Added "disk_id" parameter to MBR creation function
Max Maisel [Thu, 1 Mar 2018 16:28:40 +0000 (17:28 +0100)]
ext4_mbr: Added "disk_id" parameter to MBR creation function

6 years agoext4_blockdev: Added user data pointer
Max Maisel [Thu, 1 Mar 2018 16:27:14 +0000 (17:27 +0100)]
ext4_blockdev: Added user data pointer

6 years agoMerge pull request #33 from enetor/fseek
Grzegorz Kostka [Fri, 20 Oct 2017 07:40:37 +0000 (09:40 +0200)]
Merge pull request #33 from enetor/fseek

Use int64_t as offset to ext4_fseek.

6 years agoUse int64_t as offset to ext4_fseek.
Fan Deng [Wed, 18 Oct 2017 17:54:54 +0000 (10:54 -0700)]
Use int64_t as offset to ext4_fseek.

This change makes it possible to fseek backwards in fseek.

Tested:
  make test_all

6 years agoMerge pull request #32 from enetor/useless-if
Grzegorz Kostka [Tue, 17 Oct 2017 22:47:00 +0000 (00:47 +0200)]
Merge pull request #32 from enetor/useless-if

Remove an unuseful if check in ext4.c.

6 years agoRemove an unuseful if check in ext4.c.
Fan Deng [Tue, 17 Oct 2017 18:33:18 +0000 (11:33 -0700)]
Remove an unuseful if check in ext4.c.

The if check on s_bdevices[i].name is unuseful, as 'name' always
evaluates to true:
    if (s_bdevices[i].name) {
        ...
    }
This change removes the check to be consistent with the rest of the code
(see line 124 and 144).

6 years agoMerge pull request #31 from raandoom/assert_release
Grzegorz Kostka [Sun, 8 Oct 2017 20:51:51 +0000 (22:51 +0200)]
Merge pull request #31 from raandoom/assert_release

Move function call outside assert()

6 years agomove function call outside assert()
raandoom [Sun, 8 Oct 2017 20:27:36 +0000 (23:27 +0300)]
move function call outside assert()

6 years agoFix a compile issue with big endian config & some small issues fixes
branzhu [Thu, 13 Jul 2017 10:48:43 +0000 (10:48 +0000)]
Fix a compile issue with big endian config & some small issues fixes

6 years agoSuppress gcc 7.xx warnings (fall through in switch statement)
gkostka [Tue, 11 Jul 2017 15:55:08 +0000 (17:55 +0200)]
Suppress gcc 7.xx warnings (fall through in switch statement)

6 years agoext4_journal: fix not purging enough transactions
Kaho Ng [Fri, 30 Jun 2017 12:05:07 +0000 (20:05 +0800)]
ext4_journal: fix not purging enough transactions

We have to purge all consecutive transactions that
has all its buffers written to persistent location.

6 years agoext4_balloc: fix not creating revoke records correctly
Kaho Ng [Wed, 21 Jun 2017 20:20:43 +0000 (04:20 +0800)]
ext4_balloc: fix not creating revoke records correctly

We fix ext4_balloc_free_blocks() not creating revoke records
correctly according to start block and block count parameter
from caller.

6 years agoext4_balloc: fix not invaliding cache correctly
Kaho Ng [Wed, 21 Jun 2017 18:26:19 +0000 (02:26 +0800)]
ext4_balloc: fix not invaliding cache correctly

We fix ext4_balloc_free_blocks() not invaliding cache
correctly according to start block and block count parameter
from caller.

6 years agoext4: fix transaction start/stop scopes
Grzegorz Kostka [Wed, 31 May 2017 13:12:07 +0000 (15:12 +0200)]
ext4: fix transaction start/stop scopes

Remove transaction scope from ext4_generic_open2 method.

6 years agoChange lwext4 license to GPL2
gkostka [Sat, 20 May 2017 08:01:47 +0000 (10:01 +0200)]
Change lwext4 license to GPL2

Some of the source files are licensed under GPL2. It makes whole
lwext4 GPL2 licensed. To use library as a BSD3, GPL licensed source
files must be removed first. At this point there are two files
licensed under GPL2:
* ext4_xattr.c
* ext4_extents.c

6 years agoext4_config: add defines allowing disabling xattr and extent modules
gkostka [Sat, 20 May 2017 07:35:40 +0000 (09:35 +0200)]
ext4_config: add defines allowing disabling xattr and extent modules

6 years agoext4_dir_idx: make qsort as a default dir idx sort algorithm
gkostka [Sat, 20 May 2017 07:23:54 +0000 (09:23 +0200)]
ext4_dir_idx: make qsort as a default dir idx sort algorithm

6 years agoMake ext4_xattr & ext4_extents GPL licensed
gkostka [Sat, 20 May 2017 06:39:52 +0000 (08:39 +0200)]
Make ext4_xattr & ext4_extents GPL licensed

7 years agoext4: add ext4_inode_exist method
gkostka [Wed, 19 Apr 2017 18:47:14 +0000 (20:47 +0200)]
ext4: add ext4_inode_exist method

7 years agotoolchain: add toolchain files for new MCUs & simplify makefile
gkostka [Wed, 19 Apr 2017 15:55:46 +0000 (17:55 +0200)]
toolchain: add toolchain files for new MCUs & simplify makefile

7 years agoext4_journal: fix error handling in jbd_get_fs
gkostka [Wed, 19 Apr 2017 14:35:14 +0000 (16:35 +0200)]
ext4_journal: fix error handling in jbd_get_fs

7 years agoChange include type policy
gkostka [Wed, 5 Apr 2017 18:12:52 +0000 (20:12 +0200)]
Change include type policy

Since all headers are ins separate directory, includes could be
done by using <> instead of "".

7 years agoName refactiring inside file_windows module
gkostka [Wed, 5 Apr 2017 17:47:04 +0000 (19:47 +0200)]
Name refactiring inside file_windows module

7 years agoRename ext4_filedev to file_dev
gkostka [Wed, 5 Apr 2017 17:43:19 +0000 (19:43 +0200)]
Rename ext4_filedev to file_dev

7 years agoRename io_raw module to more appropriate file_windows
gkostka [Wed, 5 Apr 2017 17:35:46 +0000 (19:35 +0200)]
Rename io_raw module to more appropriate file_windows

7 years agoRemove unused unpack_images make target
gkostka [Wed, 5 Apr 2017 17:30:44 +0000 (19:30 +0200)]
Remove unused unpack_images make target

7 years agoRemove prefix patch directory
gkostka [Wed, 5 Apr 2017 17:28:15 +0000 (19:28 +0200)]
Remove prefix patch directory

Seems to be redundant.

7 years agoRemove 7z archive with test images
gkostka [Wed, 5 Apr 2017 17:26:26 +0000 (19:26 +0200)]
Remove 7z archive with test images

Now images will be created by fsck.extN tool.

7 years agoMerge pull request #22 from branzhu/master
Grzegorz Kostka [Fri, 24 Mar 2017 07:54:22 +0000 (08:54 +0100)]
Merge pull request #22 from branzhu/master

Fix issues with big-endian system

7 years agoFix issues with big-endian system
branzhu [Fri, 24 Mar 2017 04:51:51 +0000 (00:51 -0400)]
Fix issues with big-endian system

7 years agoUpdate README.md
Grzegorz Kostka [Wed, 8 Mar 2017 09:32:52 +0000 (10:32 +0100)]
Update README.md

7 years agoext4_xattr: fix access violation if extra_isize is 0
Kaho Ng [Mon, 27 Feb 2017 16:52:03 +0000 (00:52 +0800)]
ext4_xattr: fix access violation if extra_isize is 0

7 years agoext4_fs: set i_extra_isize to ext4_sblock::min_extra_isize
Kaho Ng [Mon, 27 Feb 2017 16:17:43 +0000 (00:17 +0800)]
ext4_fs: set i_extra_isize to ext4_sblock::min_extra_isize

7 years agoext4_inode: deal with i_extra_isize depending on inode size
Kaho Ng [Mon, 27 Feb 2017 16:05:12 +0000 (00:05 +0800)]
ext4_inode: deal with i_extra_isize depending on inode size

7 years agoext4_xattr: fix trying to read EA block even if it is absent
Kaho Ng [Mon, 27 Feb 2017 14:49:53 +0000 (22:49 +0800)]
ext4_xattr: fix trying to read EA block even if it is absent

7 years agoext4_mkfs: add journal node creation support
gkostka [Tue, 21 Feb 2017 20:30:54 +0000 (21:30 +0100)]
ext4_mkfs: add journal node creation support

7 years agoext4: improve dox documentation style
gkostka [Sun, 19 Feb 2017 21:03:23 +0000 (22:03 +0100)]
ext4: improve dox documentation style

7 years agoext4: little style improvements
Grzegorz Kostka [Fri, 17 Feb 2017 13:30:30 +0000 (14:30 +0100)]
ext4: little style improvements

7 years agoext4: remove dynamic block cache allocation in ext4_mount
Grzegorz Kostka [Fri, 17 Feb 2017 12:44:05 +0000 (13:44 +0100)]
ext4: remove dynamic block cache allocation in ext4_mount

7 years agoUpdate license file (github badge)
gkostka [Fri, 17 Feb 2017 00:36:29 +0000 (01:36 +0100)]
Update license file (github badge)

7 years agoext4: remove block cache parameter from device_register function
gkostka [Fri, 17 Feb 2017 00:26:56 +0000 (01:26 +0100)]
ext4: remove block cache parameter from device_register function

This parameter is useless since cache is always initialized by malloc.

7 years agoUpdate licence file (comment scope remove)
gkostka [Fri, 17 Feb 2017 00:03:31 +0000 (01:03 +0100)]
Update licence file (comment scope remove)