From patchwork Wed Sep 4 20:27:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13791361 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 84812CD4F24 for ; Wed, 4 Sep 2024 20:29:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1BEAB6B012E; Wed, 4 Sep 2024 16:29:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 146BA6B012F; Wed, 4 Sep 2024 16:29:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EDE6C6B0130; Wed, 4 Sep 2024 16:29:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id C8E7C6B012E for ; Wed, 4 Sep 2024 16:29:28 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8A8BF16040F for ; Wed, 4 Sep 2024 20:29:28 +0000 (UTC) X-FDA: 82528196016.24.571FAAB Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) by imf05.hostedemail.com (Postfix) with ESMTP id C030510000D for ; Wed, 4 Sep 2024 20:29:26 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=nKtu3pB+; spf=none (imf05.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.44) 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=1725481670; 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=JmFE9zypkxWwtjgDkL/vbyJWxHrdDWRoGs2W5KUFOnA=; b=bhh5M0RRxzXK0hlbNp0+9idQ5b/mrQ97dFT6XaEu8mXnif0t6S3MyyNxawdenph7hUfEoM gq8t/ndSmZqXNnVYGeiOP9f5SoGyoEsjc8bSMeico17sN28/0nJLu94INAFfu3fWmfK629 OEEF8WK0gEmMOIp0oX5mp40XJFfRQb4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725481670; a=rsa-sha256; cv=none; b=kavWWwaXDg5Xf4175oXC9naavHyyipMMoaHTvEAEI7IvGm0hBaMz+96jovZUdLD9GjcBOY /EiUF5FoGrtVDY/yDznJF2mNigJ6UziA22TkRqC2bZWeM8rdB/j3HoERgKDNxA2N/7UfcP i2ocKnqcm8SLZWWzru2Zdy/hAvdHlt4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=nKtu3pB+; spf=none (imf05.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.44) smtp.mailfrom=josef@toxicpanda.com; dmarc=none Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-6c35427935eso28746d6.3 for ; Wed, 04 Sep 2024 13:29:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1725481766; x=1726086566; 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=JmFE9zypkxWwtjgDkL/vbyJWxHrdDWRoGs2W5KUFOnA=; b=nKtu3pB+HDt2EOaZPep+ObkycI9Z2PdzwWy39+vwt4A7Hp5RLuN8/1/+u+9faE72Sm MXEuV3zrjKJf80Ymn7UekrZZX1wFBjIw4fgzcN38LBqQkvPscB9iZvg3u4bHNWhi9frl lODSELmOSQ77zj+Qe/QsBsVsyAmh3xbj5I6ZE16n/sTb3HomV4VbQGZj+8fxlKFIwgw4 tHo981PVLziTMOgGkqxJ7xLrRL9GUakFz0/Xg96Zj/90VCEt072JeFIvarmG5DYaN4jw s9iVnsXdtRehz6o4BXkHuq88HpbGzTLa9cd3AZexXBbkfV85R8v6QaG0LwFERvUTNXFJ 8Ttw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725481766; x=1726086566; 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=JmFE9zypkxWwtjgDkL/vbyJWxHrdDWRoGs2W5KUFOnA=; b=Rf5LNALQadmEmQi8J+LJRvdgX9xFwzs8oEO/qAWBwZph0OesTUMX+5/Gp/slG3Q3kP 9Vuq0QDBbjM2K2CmbQQtEumtzHbp+AwamEYjoHh4fL2OiPHxMA+Z7AQ7FYHqUhTvQgc7 FBA4KzNI0wlw5xTS6eyYB+7osWUT/uyBvgEVW6qFcoU9UtOJMeJPx428QOEFOWyXNcE3 H7BINyOX3/AZ5u4N7Zf2BvSl24+QDy7Wi5sI2aMDXbx6eJYQsbYIfn9/WI9FOcemCyzW zdlJUGc+jn3ESPsshUhhro8d9ptuiMkVGrDM/IQS15sixbBt/95GnDwwtUKcm2Y0lCVl oZmg== X-Forwarded-Encrypted: i=1; AJvYcCUt0pQk+1MMmKRxEEJD6RqlYi9StepH3VvztTVUbO3dWBkMcMRgUSqB0InEQ7wBnRh16qACmuwUig==@kvack.org X-Gm-Message-State: AOJu0Yxm+jLNkwUJcShIuXyXJjHBzCeON6jZBAArRUtwZEwU4RV1+sIW 3BVRuQb9U+Qa3Llm6TLk/fOdhAtDLKfquehz4sydDRnv1rCg/zezEvwCxvjLII0= X-Google-Smtp-Source: AGHT+IFz/IUidwqQ59xRLvRnlzpJcJ1KGg9KuPmXBEEett+13VoyzgSnYGWxrufSaJ5p3j4xy3X2+w== X-Received: by 2002:a05:6214:4b09:b0:6c3:54fe:ebef with SMTP id 6a1803df08f44-6c3558359fbmr194853636d6.43.1725481765951; Wed, 04 Sep 2024 13:29:25 -0700 (PDT) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6c5201dedd8sm1621726d6.7.2024.09.04.13.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 13:29:25 -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 07/18] fanotify: rename a misnamed constant Date: Wed, 4 Sep 2024 16:27:57 -0400 Message-ID: <13c1df955c0e8af0aee2afce78b1ea1f2e3f8f66.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-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C030510000D X-Stat-Signature: h1km4xfnqkoyaoh8fae4hwgy64xndy1b X-HE-Tag: 1725481766-782020 X-HE-Meta: U2FsdGVkX19DNDAZvNkZJiiyc0KZeZtdceCmWtIjUQD7sq3ob1F2g5pWm/n/dc8xcqELLDWGR6MlXM35nvspCHUZ8dHlWyy73/1v1fAxRe8iLqRdtiIbyqEQ5A6g+486N/XErSDXHJIJaYbrpqFjYmM7k8PRvnThPuI6+tErHByj7c85jguiN/1L/Km2HA7Sk7xP87y3/l5XtYwlJ52GXo+735gJEetPC+Xd2221XrGt7E/TgqgXSJd4sAcZlOfE8uYisZTGzk4fET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: Ham, tests=bogofilter, spamicity=0.001442, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Amir Goldstein FANOTIFY_PIDFD_INFO_HDR_LEN is not the length of the header. Signed-off-by: Amir Goldstein Reviewed-by: Christian Brauner --- fs/notify/fanotify/fanotify_user.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 3a7101544f30..5ece186d5c50 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -119,7 +119,7 @@ struct kmem_cache *fanotify_perm_event_cachep __ro_after_init; #define FANOTIFY_EVENT_ALIGN 4 #define FANOTIFY_FID_INFO_HDR_LEN \ (sizeof(struct fanotify_event_info_fid) + sizeof(struct file_handle)) -#define FANOTIFY_PIDFD_INFO_HDR_LEN \ +#define FANOTIFY_PIDFD_INFO_LEN \ sizeof(struct fanotify_event_info_pidfd) #define FANOTIFY_ERROR_INFO_LEN \ (sizeof(struct fanotify_event_info_error)) @@ -174,14 +174,14 @@ static size_t fanotify_event_len(unsigned int info_mode, dot_len = 1; } - if (info_mode & FAN_REPORT_PIDFD) - event_len += FANOTIFY_PIDFD_INFO_HDR_LEN; - if (fanotify_event_has_object_fh(event)) { fh_len = fanotify_event_object_fh_len(event); event_len += fanotify_fid_info_len(fh_len, dot_len); } + if (info_mode & FAN_REPORT_PIDFD) + event_len += FANOTIFY_PIDFD_INFO_LEN; + return event_len; } @@ -511,7 +511,7 @@ static int copy_pidfd_info_to_user(int pidfd, size_t count) { struct fanotify_event_info_pidfd info = { }; - size_t info_len = FANOTIFY_PIDFD_INFO_HDR_LEN; + size_t info_len = FANOTIFY_PIDFD_INFO_LEN; if (WARN_ON_ONCE(info_len > count)) return -EFAULT;