Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 451970 - sys-fs/aufs3-3_p20130107: aufs3-base-7.patch fails to un-apply after aufs3-standalone-7.patch has been applied.
Summary: sys-fs/aufs3-3_p20130107: aufs3-base-7.patch fails to un-apply after aufs3-st...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Justin Lecher (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-14 04:51 UTC by eroen
Modified: 2013-01-14 08:55 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description eroen 2013-01-14 04:51:04 UTC
Both the patches ${FILESDIR}/3_p20130107/aufs3-base-7.patch and ${FILESDIR}/3_p20130107/aufs3-standalone-7.patch modify fs/file_table.c with an overlapping hunk near line 36. Thus, they can only be applied in the correct order, and un-applied in the correct, opposite order. 

The aufs3 ebuild wants to know if the patches have been applied or not, and tries to determine this by un-applying each of them separately (with patch). It then assumes the patches are not applied unless both can (separately) be un-applied without patch giving any errors. 

To reiterate; 3_p20130107/aufs3-base-7.patch can't be un-applied after both patches are applied to the kernel tree, unless you modify files in the tree.

Note:
This does not break basic functionality of the ebuild, as it still works if kernel-patch is enabled AND the kernel tree has not yet been submitted to any aufs patches yet. 

I have not tested what would happen if kernel-patch is enabled and the tree already patched. Presumably, patching is attempted and either fails, or produces a corrupted kernel tree. 


Reproducible: Always

Steps to Reproduce:
1. emerge gentoo-sources:3.7.2 ; eselect kernel set <some non-arbitrary number>
2. emerge aufs3[kernel-patch]
3. emerge aufs3[-kernel-patch]
Actual Results:  
>>> Emerging (1 of 1) sys-fs/aufs3-3_p20130107
 * aufs3-3_p20130107.tar.xz SHA256 SHA512 WHIRLPOOL size ;-) ...         [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     3.7.2-gentoo-occam1
 * Checking for suitable kernel configuration options...                 [ ok ]
 * You need to apply a patch to your kernel to compile and run the aufs3 module
 * Either enable the kernel-patch useflag to do it with this ebuild
 * or apply /usr/portage/sys-fs/aufs3/files/aufs3-base-7.patch and
 * /usr/portage/sys-fs/aufs3/files/aufs3-standalone-7.patch by hand
 * ERROR: sys-fs/aufs3-3_p20130107 failed (setup phase):
 *   missing kernel patch, please apply it first
 * 
 * Call stack:
 *                  ebuild.sh, line  93:  Called pkg_setup
 *   aufs3-3_p20130107.ebuild, line  81:  Called die
 * The specific snippet of code:
 *   			die "missing kernel patch, please apply it first"
 * 
 * If you need support, post the output of `emerge --info '=sys-fs/aufs3-3_p20130107'`,
 * the complete build log and the output of `emerge -pqv '=sys-fs/aufs3-3_p20130107'`.
 * The complete build log is located at '/tmp/portage/sys-fs/aufs3-3_p20130107/temp/build.log'.
 * The ebuild environment file is located at '/tmp/portage/sys-fs/aufs3-3_p20130107/temp/die.env'.
 * Working directory: '/tmp/portage/sys-fs/aufs3-3_p20130107'
 * S: '/tmp/portage/sys-fs/aufs3-3_p20130107/work/aufs3-3_p20130107/aufs3-standalone'


Expected Results:  
Build and install the aufs kernel module without incorrect error messages.


Offending hunk in 3_p20130107/aufs3-base-7.patch:
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -36,7 +36,7 @@ struct files_stat_struct files_stat = {
        .max_files = NR_FILE
 };

-DEFINE_STATIC_LGLOCK(files_lglock);
+DEFINE_LGLOCK(files_lglock);

 /* SLAB cache for file structures */
 static struct kmem_cache *filp_cachep __read_mostly;

Offending hunk in 3_p20130107/aufs3-standalone-7.patch:
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -37,6 +37,7 @@ struct files_stat_struct files_stat = {
 };

 DEFINE_LGLOCK(files_lglock);
+EXPORT_SYMBOL(files_lglock);

 /* SLAB cache for file structures */
 static struct kmem_cache *filp_cachep __read_mostly;
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2013-01-14 08:55:20 UTC
+*aufs3-3_p20130114 (14 Jan 2013)
+
+  14 Jan 2013; Justin Lecher <jlec@gentoo.org>
+  -files/3_p20121112/aufs3-base-0.patch, -files/3_p20121112/aufs3-base-1.patch,
+  -files/3_p20121112/aufs3-base-2.patch, -aufs3-3_p20121015.ebuild,
+  -aufs3-3_p20121015-r1.ebuild, -aufs3-3_p20121112.ebuild,
+  -aufs3-3_p20121129.ebuild, +aufs3-3_p20130114.ebuild,
+  -files/3_p20121112/aufs3-base-3.patch, -files/3_p20121112/aufs3-base-4.patch,
+  -files/3_p20121112/aufs3-base-5.patch, -files/3_p20121112/aufs3-base-6.patch,
+  -files/3_p20121112/aufs3-base-x-rcN.patch,
+  -files/3_p20121112/aufs3-standalone-0.patch,
+  -files/3_p20121112/aufs3-standalone-1.patch,
+  -files/3_p20121112/aufs3-standalone-2.patch,
+  -files/3_p20121112/aufs3-standalone-3.patch,
+  -files/3_p20121112/aufs3-standalone-4.patch,
+  -files/3_p20121112/aufs3-standalone-5.patch,
+  -files/3_p20121112/aufs3-standalone-6.patch,
+  -files/3_p20121112/aufs3-standalone-x-rcN.patch,
+  -files/3_p20121129/aufs3-base-0.patch, -files/3_p20121129/aufs3-base-1.patch,
+  -files/3_p20121129/aufs3-base-2.patch, -files/3_p20121129/aufs3-base-3.patch,
+  -files/3_p20121129/aufs3-base-4.patch, -files/3_p20121129/aufs3-base-5.patch,
+  -files/3_p20121129/aufs3-base-6.patch,
+  -files/3_p20121129/aufs3-base-x-rcN.patch,
+  -files/3_p20121129/aufs3-standalone-0.patch,
+  -files/3_p20121129/aufs3-standalone-1.patch,
+  -files/3_p20121129/aufs3-standalone-2.patch,
+  -files/3_p20121129/aufs3-standalone-3.patch,
+  -files/3_p20121129/aufs3-standalone-4.patch,
+  -files/3_p20121129/aufs3-standalone-5.patch,
+  -files/3_p20121129/aufs3-standalone-6.patch,
+  -files/3_p20121129/aufs3-standalone-x-rcN.patch:
+  Drop old and refactor patching procedure to reduce size of FILESDIR, #450800
+  and reliability, #368385 & #451970
+