From patchwork Tue Nov 12 17:55:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 13872729 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 3F025D42BBA for ; Tue, 12 Nov 2024 17:56:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3146B6B00FD; Tue, 12 Nov 2024 12:56:36 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 29C726B00FE; Tue, 12 Nov 2024 12:56:36 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C8396B00FF; Tue, 12 Nov 2024 12:56:36 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D9E936B00FD for ; Tue, 12 Nov 2024 12:56:35 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 779BC402E9 for ; Tue, 12 Nov 2024 17:56:35 +0000 (UTC) X-FDA: 82778196186.27.99FBE21 Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) by imf19.hostedemail.com (Postfix) with ESMTP id 2475A1A0008 for ; Tue, 12 Nov 2024 17:55:41 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=Jbm94LC2; dmarc=none; spf=none (imf19.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.175) smtp.mailfrom=josef@toxicpanda.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731434131; a=rsa-sha256; cv=none; b=E84HGKDLN0FJJngk5G9C08OHdaz4jQ5qmzM2aRASaf63K15c4agkstneWKo+Gk8FsMJMp2 r/kBQpOR8QEXrV+HsqDikPxabSY904mlEPnZtJZjow1iCq/HSiDOqw0UvdinZ+aqgRT3ad lDf1FSqmjjKXGbMSPYIhdax6c/+qeSw= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=Jbm94LC2; dmarc=none; spf=none (imf19.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.175) smtp.mailfrom=josef@toxicpanda.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731434131; 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=FLBk0eY4CldnJ4xEhkKNTvdMfXwQixnxnwnrlcZUems=; b=bs2M0yFCRXCuL7pjPXsvlQof+TCCgdIsReR/R9X9XVdaFr8xYdYdEfTN7N8ILkX4narDFh aBnMjZ3qYQAaSxn//0wieBrc5W+F+HUE0VUoMGkvdWl3/pnmhn5wKFuQ0Uw8XpobMcIr+w UvHpl9d4D7+P9DBvnP7tFZjLDlEzvuM= Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-e29047bec8fso4065276.0 for ; Tue, 12 Nov 2024 09:56:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1731434193; x=1732038993; 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=FLBk0eY4CldnJ4xEhkKNTvdMfXwQixnxnwnrlcZUems=; b=Jbm94LC22hkEIpBU3d3Z3Tl3g2vXPKl4lw6p0DFeZhPG2YynLOOw6oNUVMf/LMGYR2 ZF70KkAA9FbjOWQdsTGBtvZ1UHzzeORW+cne9LehQyOfyLugPy8jpQvDe+N70dFAri4g P5KS63BsDkC7aOK9+uIEhpwiR1TzQJdgy/Gtr/G8ssxEAl/sappYn5vk05KVWDfREO+Z fLaG3/CLbpsOqe95AsoO94oCJj2krTiXdAhSriLhNeVx4m/DHYBjHFQMSyR4+saFLjFw rUn1NRCvRZwRfvL9pM5tjTUxk1Z1NBg4h4mqGCx2JA52lKx+UQnsKIMcbDUfEjna9yxR 0v8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731434193; x=1732038993; 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=FLBk0eY4CldnJ4xEhkKNTvdMfXwQixnxnwnrlcZUems=; b=xDIluu6U4XuGSrN1L67G2FNEEpcpMLm/JLt6NZOoWAWV8fgmi+lNtmC2NGzRqakaTA EoxXldVV654Wg9/AoPphVenoVlHbh6gyJx2pRUjrxLDxTJy16dtiWaKGKBBE6tWXykPH 1K7ttq0nf/kFe3tcPRw1heIpFZJRlepUHfMqR6YvfBKrND5OikgiKpEopfBuwtkDOgdq zUHKnHBEkWMjkpw07ifEboypCINwNJYrK16dCIY4Anslziq1MwT3ESR7hYjcjcKLvxiB /HFouy+kNcFI2ngjhAib3ului6VjVKeZs++dEIijzdFoTj1d8OS6ghKB7rHqAYZ5YaMN 8v9A== X-Forwarded-Encrypted: i=1; AJvYcCVfTWHnI+oYR3r6S+QPhJKFAJieCHwxlXLLm9SLJ55UU/HoXHdntPsZAS9Gwbwn2bLGFuH42Y4XCw==@kvack.org X-Gm-Message-State: AOJu0Ywm9ITeAXU+dzETpvOd6M0u4A/Oa19973rt5niVDtiO3VwXuh81 nilrvGGPIpzirLROngdmrB1GJOa7J5xi0ATlcSdSB64QDBi6nWpxJNpsp8wGoqTeOMdCq/3LBQG g X-Google-Smtp-Source: AGHT+IGq9atUwLu6yRfGGU3gZisyi+y0UAqwpKFwzP1csSwnkEjcF1T1CgCueeohLnBc8+4LN1Gtbg== X-Received: by 2002:a25:8481:0:b0:e29:2988:ecf0 with SMTP id 3f1490d57ef6-e337e102bdfmr14488297276.10.1731434192790; Tue, 12 Nov 2024 09:56:32 -0800 (PST) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id 3f1490d57ef6-e336ee1526dsm2752624276.2.2024.11.12.09.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2024 09:56:31 -0800 (PST) From: Josef Bacik 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 v7 03/18] fanotify: rename a misnamed constant Date: Tue, 12 Nov 2024 12:55:18 -0500 Message-ID: <2142cdfd0bce931024cb715b6e178f3f5c49e797.1731433903.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-Queue-Id: 2475A1A0008 X-Rspamd-Server: rspam01 X-Stat-Signature: 8gakyuhp56cpbaa6qthpguc45ecsrhkm X-HE-Tag: 1731434141-947363 X-HE-Meta: U2FsdGVkX1/hZlrrzbolWAWo3Ste8T0cJaeBw+PQRxAC0tjY6J/ljjcw/xDvfiqN5xwSclIoiUNXw9r7zjUmrTljGJSEIrXpmSbvEZPgvttvSs74s+5aDRbEEFzJNvJmAyQ1lo/EgKvPB6evNIgbvmgKawlJkkb7y1eR9DmGMVu5kW7RwPQkkKyhVl/LbpW0JOzUoiZPBpQSY/AAPszzPg6Yjo6ldXDaGLeT4mW3osoWPL4jO2ZGwU6ZE6Gm8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= 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: From: Amir Goldstein FANOTIFY_PIDFD_INFO_HDR_LEN is not the length of the header. Signed-off-by: Amir Goldstein --- 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 8528c1bfee7d..9cc4a9ac1515 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -118,7 +118,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)) @@ -173,14 +173,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; } @@ -503,7 +503,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;