public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Matthew Wilcox <willy@infradead.org>,
	Pablo Neira Ayuso <pablo@netfilter.org>,
	NetFilter <netfilter-devel@vger.kernel.org>
Cc: Linux-Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Varsha Rao <rvarsha016@gmail.com>
Subject: linux-next: build failure after merge of the ida tree
Date: Wed, 18 Jul 2018 16:54:06 +1000	[thread overview]
Message-ID: <20180718165406.6f262266@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 2174 bytes --]

Hi Matthew,

After merging the ida tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

net/netfilter/nf_tables_api.c: In function 'nf_tables_set_alloc_name':
net/netfilter/nf_tables_api.c:3014:8: error: implicit declaration of function 'ida_get_new_above'; did you mean 'idr_get_next_ul'? [-Werror=implicit-function-declaration]
    n = ida_get_new_above(&inuse, tmp, &id);
        ^~~~~~~~~~~~~~~~~
        idr_get_next_ul

Caused by commit

  3f2668c1e101 ("ida: Remove old API")

interacting with commit

  9679150a0bd5 ("netfilter: nf_tables: Use id allocation")

from the netfilter-next tree.

I took a guess and applied the following merge fix patch.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 18 Jul 2018 16:42:26 +1000
Subject: [PATCH] ida: merge fix for ida_get_new_above() removal

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 net/netfilter/nf_tables_api.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index b7b5fbcda8dd..151b89174979 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2995,7 +2995,7 @@ static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set,
 {
 	const struct nft_set *i;
 	const char *p;
-	unsigned int n = 0, id = 0;
+	int id = 0;
 	DEFINE_IDA(inuse);
 
 	p = strchr(name, '%');
@@ -3011,22 +3011,22 @@ static int nf_tables_set_alloc_name(struct nft_ctx *ctx, struct nft_set *set,
 			if (!sscanf(i->name, name, &tmp))
 				continue;
 
-			n = ida_get_new_above(&inuse, tmp, &id);
-			if (n < 0) {
-				if (n == -EAGAIN)
+			id = ida_alloc_min(&inuse, tmp, GFP_KERNEL);
+			if (id < 0) {
+				if (id == -EAGAIN)
 					return -ENOMEM;
 
-				return n;
+				return id;
 			}
 		}
 
-		n = ida_get_new_above(&inuse, 0, &id);
+		id = ida_alloc(&inuse, GFP_KERNEL);
 		ida_destroy(&inuse);
 
-		if (n < 0) {
-			if (n == -EAGAIN)
+		if (id < 0) {
+			if (id == -EAGAIN)
 				return -ENOMEM;
-			return n;
+			return id;
 		}
 
 	}

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2018-07-18  6:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-18  6:54 Stephen Rothwell [this message]
2018-07-18  9:24 ` linux-next: build failure after merge of the ida tree Pablo Neira Ayuso
2018-07-18 11:59   ` Matthew Wilcox
2018-07-18 13:25     ` Pablo Neira Ayuso
2018-07-18 13:14   ` Matthew Wilcox
2018-07-18 13:27     ` Pablo Neira Ayuso
2018-07-18 13:31       ` Matthew Wilcox
2018-07-18 14:25         ` Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2018-08-10  6:36 Stephen Rothwell
2018-07-05  5:13 Stephen Rothwell
2018-07-05  4:36 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180718165406.6f262266@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=rvarsha016@gmail.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox