On Wed, Aug 24, 2016 at 04:23:14PM +0200, Pablo Neira Ayuso wrote: > This patch modifies __rhashtable_insert_fast() so it returns the > existing element that clashes with the one that you want to insert. > This adds a new rhashtable_lookup_get_insert_key() interface to fetch > this existing element. > > nf_tables needs this change to improve handling of EEXIST cases via > honoring the NLM_F_EXCL flag and by checking if the data part of the > mapping matches what we have. > > Cc: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> > Cc: Thomas Graf <tgraf@xxxxxxx> > Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> I would prefer an interface where you returned the object if it exists, NULL if it does not and the insertion was successful, and an ERR_PTR otherwise. But it's not a deal-breaker. However, you missed the rhashtable_insert_slow path. It too needs to be updated to incorporate your new logic. Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html