[kpatch] kpatch Digest, Vol 31, Issue 2(Internet mail)

xiaoggchen(陈小光) xiaoggchen at tencent.com
Wed Sep 13 06:33:55 UTC 2017



________________________________
xiaoggchen(陈小光)

From: kpatch-request at redhat.com<mailto:kpatch-request at redhat.com>
Date: 2017-09-13 00:01
To: kpatch at redhat.com<mailto:kpatch at redhat.com>
Subject: kpatch Digest, Vol 31, Issue 2(Internet mail)

Send kpatch mailing list submissions to
        kpatch at redhat.com

To subscribe or unsubscribe via the World Wide Web, visit
        https://www.redhat.com/mailman/listinfo/kpatch
or, via email, send a message with subject or body 'help' to
        kpatch-request at redhat.com

You can reach the person managing the list at
        kpatch-owner at redhat.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of kpatch digest..."


Today's Topics:

   1. Re: [PATCH] kpatch: fix kpatch-build matching changed object
      bug (Joe Lawrence)


----------------------------------------------------------------------

Message: 1
    Date: Mon, 11 Sep 2017 17:18:58 -0400
    From: Joe Lawrence <joe.lawrence at redhat.com>
    To: kpatch at redhat.com
    Subject: Re: [kpatch] [PATCH] kpatch: fix kpatch-build matching
            changed object bug
    Message-ID: <27a493ee-0d34-fb70-9a63-b91eb5beee80 at redhat.com>
    Content-Type: text/plain; charset=gbk

    On 09/10/2017 10:36 PM, xiaoggchen(???) wrote:
    >> When there are ".." in source object path then current kpatch-gcc can not handle it correctly:
    >> kpatch-gcc use the following logic to check the objects who got recompiled and would write the changed
    >> objects to "chagned_objs". But if the path of the input obj is something like"arch/x86/kvm/../../../virt/kvm/.tmp_kvm_main.o"
    >> then the following logic can not handle it properly, the kvm_main.o will fall into the "*.*.o" branch.
    >> And kpatch-build will end up with "ERROR: no changed objects found. Check /root/.kpatch/build.log for more details."
    >>
    >> kpatch/kpatch-build/kpatch-gcc:
    >>  ......
    >>  case "$obj" in
    >>                                 *.mod.o|\
    >>                                 *built-in.o|\
    >>                                 vmlinux.o|\
    >>                                 .tmp_kallsyms1.o|\
    >>                                 .tmp_kallsyms2.o|\
    >>                                 init/version.o|\
    >>                                 arch/x86/boot/version.o|\
    >>                                 arch/x86/boot/compressed/eboot.o|\
    >>                                 arch/x86/boot/header.o|\
    >>                                 arch/x86/boot/compressed/efi_stub_64.o|\
    >>                                 arch/x86/boot/compressed/piggy.o|\
    >>                                 kernel/system_certificates.o|\
    >>                                 arch/x86/vdso/*|\
    >>                                 arch/x86/entry/vdso/*|\
    >>                                 drivers/firmware/efi/libstub/*|\
    >>                                 arch/powerpc/kernel/prom_init.o|\
    >>                                 *.*.o)
    >>                                         break
    >>                                         ;;
    >>                                 *.o)
    >>                                         mkdir -p "$KPATCH_GCC_TEMPDIR/orig/$(dirname $obj)"
    >>                                         [[ -e $obj ]] && cp -f "$obj" "$KPATCH_GCC_TEMPDIR/orig/$obj"
    >>                                         echo "$obj" >> "$KPATCH_GCC_TEMPDIR/changed_objs"
    >>                                         break
    >>                                         ;;
    >>                                 *)
    >>                                         break
    >>                                         ;;
    >>                         esac
    >>  ......
    >>
    >> Signed-off-by: chen xiaoguang <xiaoggchen at tencent.com>
    >>
    >> ---
    >>  kpatch-build/kpatch-gcc | 3 ++-
    >>  1 file changed, 2 insertions(+), 1 deletion(-)
    >>
    >> diff --git a/kpatch-build/kpatch-gcc b/kpatch-build/kpatch-gcc
    >> index e91f4b2..ffa9bc3 100755
    >> --- a/kpatch-build/kpatch-gcc
    >> +++ b/kpatch-build/kpatch-gcc
    >> @@ -38,7 +38,8 @@ if [[ "$TOOLCHAINCMD" = "gcc" ]] ; then
    >>                                 arch/x86/entry/vdso/*|\
    >>                                 drivers/firmware/efi/libstub/*|\
    >>                                 arch/powerpc/kernel/prom_init.o|\
    >> -                               *.*.o)
    >> +                               *[^.].[^.]*.o|\
    >> +                               .*[0-9].o)
    >>                                         break
    >>                                         ;;
    >>                                 *.o)
    >> --
    >> 1.8.3.1

    > I think the modification to the glob for issue #686 [1] is inadvertently
    > added those ".." directories to its ignore list.

    > [1] https://github.com/dynup/kpatch/issues/686

    > I tinkered a little while trying to exclude the ".." patterns, including
    > enabling extended glob support (shopt -s extglob) and came away for
    > ever-more complicated patterns.

    > If I read the history of PR 686 [1] correctly, I think we added the
    > leading wildcard in front of ".*.o" when we wanted to exclude
    > .lib_exports.o files.  Maybe it would be simpler to revert back to
    > ".*.o" and add a new "*/.lib_exports.o" pattern.

    Yes. Your change is more simpler. I tested this modification and it worked.

    > But to be honest, I don't fully understand what the two new patterns
    > you've added will be matching... so perhaps an explanation will show
    > that they are simpler than my suggestion.

    My intention is to skip those objects where there is "." before a "." or after a "." for pattern "*[^.].[^.]*.o

    When I did the test I found using my modification some objects like ".357982.o" was added to the changed_objs so I added the pattern ".*[0-9]" to skip those objects.

    > Thanks,

    > -- Joe



    ------------------------------

    _______________________________________________
    kpatch mailing list
    kpatch at redhat.com
    https://www.redhat.com/mailman/listinfo/kpatch


    End of kpatch Digest, Vol 31, Issue 2
    **********************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kpatch/attachments/20170913/3bfda020/attachment.htm>


More information about the kpatch mailing list