From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steffen Klassert Subject: Re: [PATCH net] xfrm: do the garbage collection after flushing policy Date: Thu, 27 Apr 2017 09:27:13 +0200 Message-ID: <20170427072713.GW2649@secunet.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: network dev , , Herbert Xu , To: Xin Long Return-path: Received: from a.mx.secunet.com ([62.96.220.36]:53554 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933592AbdD0H1p (ORCPT ); Thu, 27 Apr 2017 03:27:45 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Mon, Apr 24, 2017 at 03:33:39PM +0800, Xin Long wrote: > Now xfrm garbage collection can be triggered by 'ip xfrm policy del'. > These is no reason not to do it after flushing policies, especially > considering that 'garbage collection deferred' is only triggered > when it reaches gc_thresh. > > It's no good that the policy is gone but the xdst still hold there. > The worse thing is that xdst->route/orig_dst is also hold and can > not be released even if the orig_dst is already expired. > > This patch is to do the garbage collection if there is any policy > removed in xfrm_policy_flush. > > Signed-off-by: Xin Long Applied to the ipsec tree, thanks!