git/list[1] front-page[2] threads[3] people[4] search[5] about
 

problem about 'git am --rej'

From
Yyangerkun <yangerkun@huawei.com>
Date
Jul 27, 2020, 11:50 UTC
Message-ID
<ebec6423-20f9-d866-1d07-9e6c94ce845c@huawei.com>
Hi,

Trying 'git am --rej'(git version 2.25.4) to apply patch eead1c2ea250 ("netlabel: cope with NULL catmap") with linux stable branch 4.4.y(git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git), it seems the patch has been applied with wrong function(should be cipso_v4_parsetag_rbm or cipso_v4_parsetag_rng, but cipso_v4_parsetag_enum). Does this a bug or a expected result?

[xxx@code-website linux-stable]$ git am 
0001-netlabel-cope-with-NULL-catmap.patch --rej
Applying: netlabel: cope with NULL catmap
Checking patch net/ipv4/cipso_ipv4.c...
Hunk #1 succeeded at 1435 (offset 177 lines).
error: while searching for:
                         return ret_val;
                 }
                 secattr->flags |= NETLBL_SECATTR_MLS_CAT;
         }
         return 0;
error: patch failed: net/ipv4/cipso_ipv4.c:1439
Checking patch net/ipv6/calipso.c...
error: net/ipv6/calipso.c: does not exist in index
Checking patch net/netlabel/netlabel_kapi.c...
error: while searching for:
         if ((off & (BITS_PER_LONG - 1)) != 0)
                 return -EINVAL;
         if (off < catmap->startbit) {
                 off = catmap->startbit;
                 *offset = off;

error: patch failed: net/netlabel/netlabel_kapi.c:734 Applying patch net/ipv4/cipso_ipv4.c with 1 reject... Hunk #1 applied cleanly. Rejected hunk #2. Applying patch net/netlabel/netlabel_kapi.c with 1 reject... Rejected hunk #1. Patch failed at 0001 netlabel: cope with NULL catmap hint: Use 'git am --show-current-patch' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". [xxx@code-website linux-stable]$ git diff

diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 0e83c5b08e0e..375733b96bdf 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -1435,7 +1435,8 @@ static int cipso_v4_parsetag_enum(const struct 
cipso_v4_doi *doi_def,
                         return ret_val;
                 }

-               secattr->flags |= NETLBL_SECATTR_MLS_CAT;
+               if (secattr->attr.mls.cat)
+                       secattr->flags |= NETLBL_SECATTR_MLS_CAT;
         }

         return 0;
Next: yangerkun
Message 1 of 2 in “problem about 'git am --rej'”
  1. yangerkunJul 27, 2020
  2. yangerkunJul 27, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.