Ext4 Contributing
From Ext4
OBSOLETE CONTENT
This wiki has been archived and the content is no longer updated.
For latest ext4 documentation, see Kernel Docs.
Overview
This page summarizes the process of contributing code to the ext4 kernel driver or to e2fsprogs.
e2fsprogs
- Clone the e2fsprogs git repo (git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git)
- (Optional) if you have a new enough gcc (4.8?), try configuring with
./configure --enable-gcovfor automatic code coverage reporting. - Make your code modifications as you see fit.
- Write some functional tests (see tests/ for examples, and use
make testnewto generate a new test) if you're writing new code. - Run the regression suite:
make check. If you enabled gcov in step 2, runmake coverage.txtto generate the coverage report. - Wash, rinse, repeat until your code does what you want it to do.
- Static analysis, part 1: Run
make gcc-wall-newto compile with all GCC warnings enabled. - Static analysis, part 2: Run
make clean; make C=1to check your code against sparse. - Regression tests: Run
cd tests/; make test_script; ./test_script --valgrind-leakcheckto look for memory leaks. - When writing up your patches, please follow the guidelines in https://www.kernel.org/doc/Documentation/SubmittingPatches
- Run your patches through the kernel's style checker in
scripts/checkpatch.pl. - Send patches to the mailing list linux-ext4 at vger.kernel.org.
While Eric Sandeen and Ted T'so occasionally upload code snapshots to Coverity as an additional checkpoint, these steps can be performed by any developer.
ext4 kernel
- Clone the kernel git repo (git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)
- Make your code modifications as you see fit.
- Build your code with static analysis enabled:
make C=1. Please fix the things it complains about, or discuss with the sparse developers if you think you have a false-positive. - Run the appropriate testing suites against the kernel. For functional testing of ext4, run xfstests (http://xfs.org/index.php/Getting_the_latest_source_code). The tests in generic/, shared/, and ext4/ should all pass. For interface testing of ext4, also consider running LTP (http://ltp.sourceforge.net/).
- Wash, rinse, repeat until your code does what you want it to do.
- When writing up your patches, please follow the guidelines in https://www.kernel.org/doc/Documentation/SubmittingPatchesn
- Run your patches through the kernel's style checker in
scripts/checkpatch.pl. - Send patches to the mailing list linux-ext4 at vger.kernel.org.