From e7494f4954d0ee0c8e13a639fef2122a4d6c5088 Mon Sep 17 00:00:00 2001 From: Gray Liang Date: Fri, 25 Aug 2023 16:47:58 +0800 Subject: [PATCH] Revert "make fsnotify event more readable" [ upstream commit d86c148a4c74e4ce32c92e367d8ef0fd1a0ce6db ] This reverts commit 479fb7d6d5db9b89447900b8eb62d598f6ca2a62. The code changes are not equivalent. For example, event.Op=fsnotify.Create has different results. Fixes: https://github.com/cilium/cilium/pull/22903 Signed-off-by: Zhichuan Liang Signed-off-by: Fabio Falzoi --- pkg/datapath/linux/ipsec/ipsec_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/datapath/linux/ipsec/ipsec_linux.go b/pkg/datapath/linux/ipsec/ipsec_linux.go index ccab4915bf62..3907b7a1c5d9 100644 --- a/pkg/datapath/linux/ipsec/ipsec_linux.go +++ b/pkg/datapath/linux/ipsec/ipsec_linux.go @@ -917,7 +917,7 @@ func keyfileWatcher(ctx context.Context, watcher *fswatcher.Watcher, keyfilePath for { select { case event := <-watcher.Events: - if !event.Op.Has(fsnotify.Create) || !event.Op.Has(fsnotify.Write) { + if event.Op&(fsnotify.Create|fsnotify.Write) == 0 { continue }