Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4152645pxj; Tue, 15 Jun 2021 16:57:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd0fpfGcHes9jPPCa47es0uH2qFpAlxY6oJilJ4knTUcWabQobQPlDCeUfjwW6OLZ9klpK X-Received: by 2002:aa7:c450:: with SMTP id n16mr776772edr.386.1623801427688; Tue, 15 Jun 2021 16:57:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623801427; cv=none; d=google.com; s=arc-20160816; b=KICgiaye9roplFWOdTfWgNAtozxex007seQnGqFlKm8Jp8tOnsQXch3Zchh1l48aQs +KysAaem5a+qbUIQYP0UkvnyiAOOmS0SgWQpPfOZ5OYaY1TGShwYQrYleRI2iT778MoK TJm5KIE3wQqEzJAKaIncmEOPgcnPtRK1xrjQbJmI9ohnlaEpeJoFCYc9LD7mrew4rssU CBf7l3N2Q3eMhv72nG209y+8Wku8R6rWd7DsQTWywaCwgmIYHEMUNMpeGtO6fnpkWSV3 pIJY9S6MxWKiNxayO0PlpH17YFIiCSV/q3S3WVRKblv3vVa6c5OdKocb0f0Q0DeqNHBd H1rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5LRe+I9q0AWjHfVKvPmTSNeJtVs6M+O33ZoYUrYKudU=; b=tRHfSGs42K9gGE/JrSJT9j6i63PiXLu0XvHR4xIbl0LNvxhI5pzzKHJUFQq8I1tOKV IsbD4ycD5JLPmhg385mPxiGjMcrggrKJrR99s3PJDpNcKSGRRTX6o9ZKXGnAAIGQ38sd 22tHFLu6LaSrEPHjbHhPhLxZZZQezHJ1W+xaQQS0AuqzUEnk7NZYWEQc+8cGyP5yrEiv +Ek7WiQrYBj1VkRl3EV/DykasHDtxsb5p4pbolov76G54ClxqZYakTfrdRxVRqz1DjsY vQx1SUHHVlSn5cFPWQoO8zM4f9kY60sgDiiqRdxq+ibHVG3RyGoGOxlq0i201Kf+5mBj YVgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 4si366421ejr.388.2021.06.15.16.56.16; Tue, 15 Jun 2021 16:57:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231143AbhFOX6N (ORCPT + 99 others); Tue, 15 Jun 2021 19:58:13 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:39898 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhFOX6M (ORCPT ); Tue, 15 Jun 2021 19:58:12 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id A7E861F432D9 From: Gabriel Krisman Bertazi To: amir73il@gmail.com Cc: kernel@collabora.com, djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, jack@suse.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi Subject: [PATCH v2 01/14] fsnotify: Don't call insert hook for overflow events Date: Tue, 15 Jun 2021 19:55:43 -0400 Message-Id: <20210615235556.970928-2-krisman@collabora.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210615235556.970928-1-krisman@collabora.com> References: <20210615235556.970928-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Overflow events are not mergeable, so they are not hashed_events. But, when failing inside fsnotify_add_event, for lack of space, fsnotify_add_event() still calls the insert hook, which adds the overflow event to the merge list. Avoid calling the insert hook when adding an overflow event. Fixes: 94e00d28a680 ("fsnotify: use hash table for faster events merge") Signed-off-by: Gabriel Krisman Bertazi --- fs/notify/notification.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/notify/notification.c b/fs/notify/notification.c index 32f45543b9c6..033294669e07 100644 --- a/fs/notify/notification.c +++ b/fs/notify/notification.c @@ -106,6 +106,11 @@ int fsnotify_add_event(struct fsnotify_group *group, return ret; } event = group->overflow_event; + /* + * Since overflow events are not mergeable, don't insert + * them in the merge hash. + */ + insert = NULL; goto queue; } -- 2.31.0