[kpatch] Question about kpatch on upstream kernel

Madper Xie cxie at redhat.com
Thu Apr 24 05:37:39 UTC 2014


Zheng Liu <gnehzuil.liu at gmail.com> writes:

> 1. Install a Fedora 20 system
> 2. Build a upstream kernel and install it (3.15-rc2)
> 3. Make a patch against the upstream kernel
>
> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> index 063fc15..6f43062 100644
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -109,6 +109,7 @@ ext4_file_dio_write(struct kiocb *iocb, const struct iovec *iov,
>  
>  	/* Unaligned direct AIO must be serialized; see comment above */
>  	if (unaligned_aio) {
> +		printk("Unalign direct AIO\n");
>  		mutex_lock(ext4_aio_mutex(inode));
>  		ext4_unwritten_wait(inode);
>  	}
>
> 4. git reset --hard HEAD
> 5. sudo insmod kmod/kpatch.ko
> 6. kpatch-build -s $HOME/projects/linux -c $HOME/projects/linux/.config tmp/foo.patch
>
> $ kpatch-build -s $HOME/projects/linux -c $HOME/projects/linux/.config foo.patch
> Copying source to /home/gnehzuil/.kpatch/src
> Testing patch file
> patching file fs/ext4/file.c
> Building original kernel
> Building patched kernel
> Detecting changed objects
> Rebuilding changed objects
> Extracting new and modified ELF sections
> file.o: changed function: ext4_file_open
> file.o: changed function: ext4_file_write
> file.o: changed section __bug_table not selected for inclusion
> /usr/local/libexec/kpatch/create-diff-object: unreconcilable difference
> ERROR: kpatch build failed. Check /tmp/kpatch-build-1398311562.log for more details.
>
> How do I solve this problem?

Hi. Please update your kpatch-build. There is already a fix for
__bug_table issue from Seth. And yes the fix is already merged:
https://github.com/dynup/kpatch/commit/2e607644e149288c37dbeaff28a251e1435b54a0
Please make sure if your kpatch is the latest version. If you are using
the latest version it may be a kpatch bug. Report it on github plz.

And I'm not sure if kpatch-build works well with upstream kernel. It
depends. kpatch-build will download Fedora's kernel:
yumdownloader --source --destdir "$TEMPDIR" "kernel-$ARCHVERSION" >> "$LOGFILE" 2>&1 || die

Which means the result .ko module is aginst for Fedora's kernel. It's
difficult to say if the ko module will work for upstream
kernel. (Depends on kABI?)

-- 
Sent with my mu4e




More information about the kpatch mailing list