From patchwork Wed Sep 4 20:27:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13791355 Return-Path: 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 06AE0CD4F24 for ; Wed, 4 Sep 2024 20:29:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 789446B0346; Wed, 4 Sep 2024 16:29:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7129D6B0347; Wed, 4 Sep 2024 16:29:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 53D966B0348; Wed, 4 Sep 2024 16:29:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2F67E6B0346 for ; Wed, 4 Sep 2024 16:29:19 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 9AF3F81645 for ; Wed, 4 Sep 2024 20:29:18 +0000 (UTC) X-FDA: 82528195596.29.C0C7609 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) by imf25.hostedemail.com (Postfix) with ESMTP id CE849A0010 for ; Wed, 4 Sep 2024 20:29:16 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=hfHQHtfn; spf=none (imf25.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.160.176) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725481732; 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=rE3z53SxlgArsKnVp16449O9VmLlGGSseshi4KP5xk8=; b=1ltz8HGGuXi/Q8gGIVDt2nQCpUIgcFcMHI5+kDD/RjF1NgcqLkbMVcuqllMICepuPs869L ACkxXtDjXV3KbytF/ddkuQA0LUiXKRnv3N2ZKiLoo3tL7J7BKsR61O5qyi1RFkK/UvBraj 9NfXBWFr7JPcNBgA+OnkSIVB3bDg2B4= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=hfHQHtfn; spf=none (imf25.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.160.176) smtp.mailfrom=josef@toxicpanda.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725481732; a=rsa-sha256; cv=none; b=iGgeBWV/nipiC+niX5g77b41jGC1hxo+uXOt1crp7NmnwyQff0e0xDlPIWmVjbcsXNGD6r Dhyg04d4hsm3zv8ONwdOR3rLZ8D5V2XMFT6Lybh+w3azTrE4MI4rWcwzTFCvece6kSPx+b OQ0m8+0Yaecm5xfknpdbfAj/PphKRNo= Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-4568780a168so364471cf.0 for ; Wed, 04 Sep 2024 13:29:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1725481756; x=1726086556; 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=rE3z53SxlgArsKnVp16449O9VmLlGGSseshi4KP5xk8=; b=hfHQHtfntwFYajHGRxCxyfoZuw1lOB8LQE9wSFxFN5lVYiVyVnNuZGV8UfH+gmGBx3 qxA/11aYH/Z+bSgY0IhNG00et1Kokf2vSRRR6AzkJlqb9F6U1RAJxhtGBUrg6VLYuIQA ACSDdw+3wh06po/QcGITJpzm4EvHCjUfkuEz7S47BCzuxZhn25juncDtOkiX5lHreUAM nyTK6wUTozadfjB46xLKeFpj10hmWwo8lAdKAYRsyqZBdE+gIrCwCxEVHKrgxbyDDBKS o1w6EUzNL7pXYsSNb4t1VdE/EO+tI6JbN5yFwsuKJIM1QfkCWcpCYyvm489/ZaW8hElo 7qAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725481756; x=1726086556; 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=rE3z53SxlgArsKnVp16449O9VmLlGGSseshi4KP5xk8=; b=oQk9Wr62EZ+8jigJYixXqPgw2mQHyEqQIeoM+cEAjqDLOfftkeFzjROfGbyZTtjox5 R7nG85ZUdoZGnVYLWxbVAwECT2RYumWuaycWjNE4BEX6/cSanZHr0YD5nFYGjwRNTYUw 3HqMY1mHah78uSTvLX0Z1GBG/JIbywnJ/SwzEUtwmBIWJGDpzkvSh1vlgIsXCwB3dlOB vb7zNPEIn0AXDhS0/J849EFuBbh7muBeL1pdsqNhM6OWWqAGosbBXu6uMDODjuhMjPqg BS4o5VX2VImlVdv9whaKLnuilUF3PGFCZZYJ142safjVHiQ8fk7H7e4/1kEydRUNv9kd p7TQ== X-Forwarded-Encrypted: i=1; AJvYcCVLJm2mN2NxQ0ZZ4iLDNZOD01ytAprPam/1+mPEba53ZjnGmNFoez2dsdjcGqaJcjevLMA+g78ymA==@kvack.org X-Gm-Message-State: AOJu0YxkJrqRZGsP0/edKO3UezzC13ffNmHAsg3Xa4AYWld4290xJfZa r67n30iP6txdfZdlXXd2TnN5oi4ruGgYkIWqZE1n1CB/0ltrJBX5K8h8/2f7kxY= X-Google-Smtp-Source: AGHT+IHwW5fXaHWnF6X5TRV/cQ4dUOF+w2NPeKDvoOEkYHuq6qKl8uAhehzsgXTy2K4uj8CzjjebGQ== X-Received: by 2002:a05:622a:2292:b0:456:7877:1e91 with SMTP id d75a77b69052e-456965f44ebmr193409851cf.27.1725481755768; Wed, 04 Sep 2024 13:29:15 -0700 (PDT) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-45801b52ea3sm1489771cf.53.2024.09.04.13.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 13:29:15 -0700 (PDT) From: Josef Bacik To: kernel-team@fb.com, linux-fsdevel@vger.kernel.org, jack@suse.cz, amir73il@gmail.com, brauner@kernel.org, linux-xfs@vger.kernel.org, linux-bcachefs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH v5 01/18] fanotify: don't skip extra event info if no info_mode is set Date: Wed, 4 Sep 2024 16:27:51 -0400 Message-ID: <6a659625a0d08fae894cc47352453a6be2579788.1725481503.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: 6b69hyby44uxas9fijkd1jijk9yfsniq X-Rspamd-Queue-Id: CE849A0010 X-Rspamd-Server: rspam11 X-HE-Tag: 1725481756-563775 X-HE-Meta: U2FsdGVkX1+HpQS4bLAb180SKJcdXT+NBEcb4DC+uBXBiibQLVOxMsCXNqI2EjWhxI9yP3lxOcEHWCBT/zptWJkvHGWh6ZjTXMZ+WHXLNjZJ2jEJoGXOGxhWanyUM8GAB0SosbN0atMbjLhveXNJAKMhxEaVK6PBnygkpPVQks9pAcOSMrjLh0hEmxuz+AdxfTTxKv4klZshnG/hXp+RgTI1/HM1f79FMUKk5h+sRwLGDiW0WRDsAYVN5pLR82ZYeU/GhLl4r7ONUGZrCzQsVDA644aLYB6SWJhSONQ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DF8F/x92TT9zO2aoulZnSg9ZIRtrj X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Amir Goldstein --- fs/notify/fanotify/fanotify_user.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 9ec313e9f6e1..2e2fba8a9d20 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; @@ -740,12 +737,10 @@ static ssize_t copy_event_to_user(struct fsnotify_group *group, if (fanotify_is_perm_event(event->mask)) FANOTIFY_PERM(event)->fd = fd; - 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);