Message ID | a1be4ec39d230eda892191e972aa5e077d50186e.1731355931.git.josef@toxicpanda.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35BF3D3ABF6 for <linux-mm@archiver.kernel.org>; Mon, 11 Nov 2024 20:19:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A180A6B009A; Mon, 11 Nov 2024 15:19:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C64E6B009B; Mon, 11 Nov 2024 15:19:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8189E6B009C; Mon, 11 Nov 2024 15:19:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 676136B009A for <linux-mm@kvack.org>; Mon, 11 Nov 2024 15:19:11 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 14D4B1A1C05 for <linux-mm@kvack.org>; Mon, 11 Nov 2024 20:19:11 +0000 (UTC) X-FDA: 82774926780.27.C69166B Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by imf22.hostedemail.com (Postfix) with ESMTP id 6DABBC0024 for <linux-mm@kvack.org>; Mon, 11 Nov 2024 20:18:18 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=rt9IXwUA; dmarc=none; spf=none (imf22.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.160.177) smtp.mailfrom=josef@toxicpanda.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731356174; a=rsa-sha256; cv=none; b=f08XOUroIwMaMlxLLkGxxjEc6SQJzPv+pl4uyiN4kVmpZC7NH0lBCExyED1N9aDS+uvY6e y1y6jFmVog3vnf9QlrYIDi854Pqx6obM2MslqLzgifxzW06LD59EOlUYpVlz1lV5T5iMaV HpWiwCBQO7rcSlte9rfXdT5kYttyPEo= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=rt9IXwUA; dmarc=none; spf=none (imf22.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.160.177) smtp.mailfrom=josef@toxicpanda.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731356174; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=E7uBdkMZBWHBDqGd5Y6AU6Zp9KPmNzsckryemzg27pk=; b=mxZ6nh+ZNO5na2izUHrVGm1rQzBaNIvi9vkvjjsZwPDh/tYWUaly0ZYtsdjsxIXErHMVVk NNzmj3hMLIR2GKhQSFLe2p1XnbVd5pjIgVftgCFWdIiSBFDEzOA0QwDBJgq+pZQJVj3DOm WqcSUmnHfpEw90Q8X+FsFTgOO2k6Duc= Received: by mail-qt1-f177.google.com with SMTP id d75a77b69052e-46090640f0cso40333251cf.0 for <linux-mm@kvack.org>; Mon, 11 Nov 2024 12:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1731356348; x=1731961148; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=E7uBdkMZBWHBDqGd5Y6AU6Zp9KPmNzsckryemzg27pk=; b=rt9IXwUAkMmMBAq893TE2/DRWlMlzYHvQBgG2ebxaUj08DsTXC7CO/8nuDU23kMbtE L1qyA+gvouEb65060Y87kCGqx66Bv1R8cBtnRq2uBrY+qyrSxfE4FnCJUEMqAC4KBA5T GjSploiSjnkp1K2vtHlENcHUyB5lmZ5zP0DivC4rI0cGymF9e8gFIPaVpwaDnLeJBDcL am4Qi/YHY8uxJ2ZvI6MOsKRy+a5LQbJs1ClrzZNXy7SlDo9XPnAnl1HPwB9Y+/KieJIa g8EaFnMj09dzuLBYrByWgk24PbANLkpOfH9famQnPImo9DnGxiKzZ3cBtwxqUKOcB7O1 +VTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731356348; x=1731961148; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E7uBdkMZBWHBDqGd5Y6AU6Zp9KPmNzsckryemzg27pk=; b=VMA3kw7BhjniCVx0z8+XjND7P0lCs1EFKADPfqS2rKRJAuS712rFcxHuDDsCrkF8h7 lSO8BwjTaQ+xjg6OvTp/jpH8TKYMy4erF6EkJA/HDqRplXNevjxEWi4IeIxGLtLwUKNz kEIq6u/Oh7jjmajiA4fDDjLiXhQcH1aw6OuKXrF8BnOLG7z+vTFY66EWgriRVgYISOD0 Z435tx7MRMwSneVjh5NfjmRDNxbphuu5kB7EW1hM28ELeiOXHLHDaiTlSQi9oc6YAAem 1cDDuSQUVSGbX6w0HzRtxxXRYnHCcj1TB2KzxkLtYUhGIoptk7Py/3nQiHNKwyCUiUNS ujFA== X-Forwarded-Encrypted: i=1; AJvYcCWvlXoMEYezblTZZx6/cpJA/rHiPTeAy0uhFEkrwiwlektfMFK4XkdFgHyo7kyPbKFghqvk9LBWXA==@kvack.org X-Gm-Message-State: AOJu0YzysS0K9ZNaCLz2eJl2/UBq6lRdJdgmjljWY+wNtFL+L2Q5RdgJ NN8gdGeCxYAjJ6PxIYkQxVruLXaeGDXptgnuFTxc9aGB035CUn/66q5Z969/7lo= X-Google-Smtp-Source: AGHT+IEBguTWGGBpfMXX3i8vnE5t3UsJSDJvfVnQMRYjxbDOQbaxUPSmwC+HZSzOw+awlnAlKaw9jA== X-Received: by 2002:ac8:7390:0:b0:463:eef:baaf with SMTP id d75a77b69052e-4630eefbc12mr132991331cf.29.1731356348402; Mon, 11 Nov 2024 12:19:08 -0800 (PST) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-462ff3df534sm66530971cf.10.2024.11.11.12.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 12:19:07 -0800 (PST) From: Josef Bacik <josef@toxicpanda.com> To: kernel-team@fb.com, linux-fsdevel@vger.kernel.org, jack@suse.cz, amir73il@gmail.com, brauner@kernel.org, torvalds@linux-foundation.org, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org Subject: [PATCH v6 01/17] fanotify: don't skip extra event info if no info_mode is set Date: Mon, 11 Nov 2024 15:17:50 -0500 Message-ID: <a1be4ec39d230eda892191e972aa5e077d50186e.1731355931.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <cover.1731355931.git.josef@toxicpanda.com> References: <cover.1731355931.git.josef@toxicpanda.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Stat-Signature: 8u8sxgkkw7get5z64x8tkb3zpexwb5ub X-Rspamd-Queue-Id: 6DABBC0024 X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1731356298-306991 X-HE-Meta: U2FsdGVkX19zWyAnVOwrXK6ox9RKitR4r41CVZSSQiRzfkG3fPH14KSNiC5fz3PoJMqCgc+lwZDapuGcY+buvbJDlshmjgUNPG9Ah339EUx+n8TKKvgCnCvMhXcBCxjHoi3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5xVHCVU01y3JTVU9Rngd2/xHntg+JuVfeMkhUhXLdWZ/twnL4yMKbFgTS2vLGoPduDJnWYqNF1Ut7NGWmE9kFx5gCKS2lpOF/++dPuWgTunbbK71DXiRfLYJ1QJekmM5iVuydMe3AV95dst0jKiPSrNOJhsPK6b1Zd0+MoWZuY/CTx9LVC2BtjNDRZgsN X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
fanotify: add pre-content hooks
|
expand
|
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 8e2d43fc6f7c..d4dd34690fc6 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -160,9 +160,6 @@ static size_t fanotify_event_len(unsigned int info_mode, int fh_len; int dot_len = 0; - if (!info_mode) - return event_len; - if (fanotify_is_error_event(event->mask)) event_len += FANOTIFY_ERROR_INFO_LEN; @@ -757,12 +754,10 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, buf += FAN_EVENT_METADATA_LEN; count -= FAN_EVENT_METADATA_LEN; - if (info_mode) { - ret = copy_info_records_to_user(event, info, info_mode, pidfd, - buf, count); - if (ret < 0) - goto out_close_fd; - } + ret = copy_info_records_to_user(event, info, info_mode, pidfd, + buf, count); + if (ret < 0) + goto out_close_fd; if (f) fd_install(fd, f);
New pre-content events will be path events but they will also carry additional range information. Remove the optimization to skip checking whether info structures need to be generated for path events. This results in no change in generated info structures for existing events. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- fs/notify/fanotify/fanotify_user.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)