Whamcloud - gitweb
LU-2473 ldiskfs: Reorganize ldiskfs kernel patches
[fs/lustre-release.git] / ldiskfs / kernel_patches / README
1 This directory contains the patches needed to convert ext4 into ldiskfs.
2
3 We need to be able to create a version of ldiskfs from the ext4 source
4 code found in multiple versions of the kernel.  That ext4 source code can
5 vary quite a bit between different versions of the kernel, which means
6 that it is impossible to maintain one set of patches that will cleanly
7 apply to all versions of ext4.
8
9 Where to put a new patch
10 ------------------------
11
12 Therefore, we split the patches into multiple subdirectories in the
13 "patches" directory.  These subdirecotories are named after the
14 version of the Linux distribution against which they were developed.
15 For instance, "patches/rhel6.3" and "patches/sles11sp1".
16
17 When creating a new patch, put it in the subdirectory for the
18 distribution for which it was first created.
19
20 Sharing patches
21 ---------------
22
23 Often a patch will apply cleanly to multiple kernel's ext4 code.
24
25 If a patch from a different distribution's subdirectory applies cleanly,
26 it should be included directly in that distribution's series file rather
27 than making a copy of the patch.  As an example, lets consider two
28 distribution directories:
29
30   patches/rhel6.3
31   patches/sles11sp1
32
33 If a patch named "patches/rhel6.3/foo.patch" applies cleanly and is
34 needed by the sles11sp1 ext4 code, the sles11sp1 series file should
35 directly list "patches/rhel6.3/foo.patch".  A copy of the same patch
36 should only be made when the patch will not apply without changes.
37
38 Refreshing patches for a new kernel/distribution
39 ------------------------------------------------
40
41 When adding support for a new OS distribution release and its new
42 version of the kernel, it is common to begin by copying the patch
43 series file from a similar OS release.  For instance, when beginning
44 to add support for the RHEL 6.4 kernel, one might copy the
45 series/ldiskfs-2.6-rhel6.3.series file to the new name
46 series/ldiskfs-2.6-rhel6.4.series.
47
48 When applying that series, some patches are likely to succeed and others
49 to fail to apply.  When a patch fails to apply, a copy of it should be
50 made into a new distribution subdirectory before refreshing that patch.
51 In this way, support for the new kernel may be added without breaking
52 support for the previous kernel.  As an example, if the patch:
53
54   patches/rhel6.3/foo.patch
55
56 fails to apply as part of series/ldiskfs-2.6-rhel6.4.series, the developer
57 would copy the patch to:
58
59   patches/rhel6.4/foo.patch
60
61 The next step would be to edit series/ldiskfs-2.6-rhel6.4.series to point
62 to the new patch.  Finally, the developer may edit files and "quilt refresh"
63 the new patch.