From patchwork Mon Nov 11 20:17: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: 13871220 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 A71BCD3ABF5 for ; Mon, 11 Nov 2024 20:19:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CD6B16B009C; Mon, 11 Nov 2024 15:19:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C87D96B009D; Mon, 11 Nov 2024 15:19:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A65936B009E; Mon, 11 Nov 2024 15:19:13 -0500 (EST) 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 86E116B009C for ; Mon, 11 Nov 2024 15:19:13 -0500 (EST) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 0AF6581ADB for ; Mon, 11 Nov 2024 20:19:13 +0000 (UTC) X-FDA: 82774927326.26.0E75826 Received: from mail-ot1-f50.google.com (mail-ot1-f50.google.com [209.85.210.50]) by imf18.hostedemail.com (Postfix) with ESMTP id 0E87C1C0015 for ; Mon, 11 Nov 2024 20:18:52 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=xbjEZKht; spf=none (imf18.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.210.50) 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=1731356297; 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=lFLPxoJTcjCEj1ORcqyvSgazShZk3E55Emf6HOBV3dQ=; b=3TfAvnJUOGxIxrBvqrAKe9Y2IvaQHVs0VJFVgYfpf1rNgPsSwu80th2f0pl4hY/lh7etMZ Y/LdWjzlCviWFJDKvsfDmyc+W6Lx6PQwlm8JOWWC+P+tT7X3PeByuuTftJWrMjTpEMoUBa QRMYgfBEn1RD3gTg8Lj8iTuqogvYKgk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731356297; a=rsa-sha256; cv=none; b=3GebYQ/NvBQGgWVu35rOuis1XzvbWGv8RJGk4ARX6U/aCH+58Hv6pgQptbLT9DuwCt7OYC cRX438z5TwiODesx2AtRo7ArMwQnUKxeKtR7bUuhCwVQlmvx6/G0Br9Kr/rxbgdqsklnf1 KimH9HeziYRss0LyvHqHaYldieYlQpo= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=xbjEZKht; spf=none (imf18.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.210.50) smtp.mailfrom=josef@toxicpanda.com; dmarc=none Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-71817c40110so2892606a34.1 for ; Mon, 11 Nov 2024 12:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1731356350; x=1731961150; 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=lFLPxoJTcjCEj1ORcqyvSgazShZk3E55Emf6HOBV3dQ=; b=xbjEZKhtohiY0V5wUPmKwop+3jHRe6k42oqa7Ekndpbo49W4QvYK+cQamujvg6FCIA XEqbydbHC4SL39DJ/gwgNsks3bcb6dWAEF3qXZB5GNCvIFGpO/2UtlyqYKuOPVk6P+i7 xRLZglgEkzqz31p3Z+lRzTlTcYADqTeNDnMdhKoda9gKt2KPL9Xbj3JlFO8/p2l9G5VX oleuY/N3//ZElW+IbbZgg3MkYal5kjpka3T75G7kugCUkamtsCvE+g3VVYi2fSWdzrMA Sk7phdVWBReronZ005x5Lft/YYdyNcIPRYqRzC2w5poqxRTft+0kwRL6BjFv3lKoLkRj newA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731356350; x=1731961150; 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=lFLPxoJTcjCEj1ORcqyvSgazShZk3E55Emf6HOBV3dQ=; b=fbOIMRlel0+CbIpCXopxlSeBdnJnU/vjil/5DrPwmoO+v8b6TQiGHV50RgVM3IRI4E Jk4k0nche4Kh6ENLkoq2wRKAwwpcqAPBl3kHH9ONm5ZBUE0Kz8L5ltXMBwvgMQ1HdDbj y7r5OfBLfwNDg5VvFRnDJODWTqnhnSvjp0nk2v5AckNRsyOgXlxwv9ClymwfoA4I6n5n di7I/vxmW38h+88BbB0ZXMo/atms3f3AMpSZ+Z5fxrJJ/HvqPjvsytdA12+cGFn8sE/g NYV738hBa6+xoPEM0p/cveyl4YdBDRD5wbsdsJKDbXou+p0zQFjYupRCApJ0K7enuUiM mfeg== X-Forwarded-Encrypted: i=1; AJvYcCXoE7UQV0qQYJoLgl/1MOXKF5iWbJkqu+yPmYFSVja2Qe1af4Ag02Szx/wBqA7bi08JqE8iyxlKxg==@kvack.org X-Gm-Message-State: AOJu0YzMHQCAwEeaINeAvEmHeqy6M1f9UfOfqkOHvg2XpY6ExcGfhYPG cqTLqIpoHG7y2I1e37Q9nyPkddw3LH9xsRFwmtdIxKp0mSR7jVzxxOIlTIZ2Q94= X-Google-Smtp-Source: AGHT+IG2MV5qcj0/qv1T8GLtm7r8mUhtQUE4d7uFXdf1Vo811CIBSN+1LBAjgReufZYAxzjdCeh83g== X-Received: by 2002:a05:6830:6081:b0:718:12af:c89b with SMTP id 46e09a7af769-71a51545819mr54277a34.1.1731356350161; Mon, 11 Nov 2024 12:19:10 -0800 (PST) Received: from localhost (syn-076-182-020-124.res.spectrum.com. [76.182.20.124]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b32acae562sm528957285a.83.2024.11.11.12.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 12:19:09 -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 v6 02/17] fanotify: rename a misnamed constant Date: Mon, 11 Nov 2024 15:17:51 -0500 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: q8dshmc5uoast4sn8q1hdjf9ky4756iu X-Rspam-User: X-Rspamd-Queue-Id: 0E87C1C0015 X-Rspamd-Server: rspam02 X-HE-Tag: 1731356332-963186 X-HE-Meta: U2FsdGVkX193Ff0GxjCLQkP99YaHpeVKg/rvzUueDDmneXTAywSIRrC5CGkB0m75fz88VK0mMh6PWzyzDg7rfxcEXnKxHOL7eE8M/ZnHEHGsJZl5AbXLn6ZfxrM8cqsxHK4dnuaDntWJVZmrj6oZnuRUayjYlmMWvD5DfMO8R2pn1Ezb6OcuDFTx1oCYkjkSHYx5icTuBXUEijdZu4gKPygzIK/KOeqLjSVsWYJ37TUA5L0tdKVvS4Iy963FVxRAYwJXQqP9/duHJ/HMC87LKuMYwl2piNCoHyJ5Ttaqi9Gje+RraDKuv/H9oknCxjxtiSWnId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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 d4dd34690fc6..0ae4cd87e712 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; } @@ -504,7 +504,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;