From patchwork Fri Nov 15 15:30: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: 13876448 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 371DED68BC6 for ; Fri, 15 Nov 2024 15:31:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 454156B009D; Fri, 15 Nov 2024 10:31:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DC256B009E; Fri, 15 Nov 2024 10:31:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 20A406B009F; Fri, 15 Nov 2024 10:31:44 -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 F3BAB6B009D for ; Fri, 15 Nov 2024 10:31:43 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 9214CC182C for ; Fri, 15 Nov 2024 15:31:43 +0000 (UTC) X-FDA: 82788717228.19.93240B0 Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) by imf22.hostedemail.com (Postfix) with ESMTP id EAC6CC0010 for ; Fri, 15 Nov 2024 15:30:44 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=DtJQjLN0; dmarc=none; spf=none (imf22.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.54) smtp.mailfrom=josef@toxicpanda.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731684522; a=rsa-sha256; cv=none; b=sSNzWvagjry1fmOAhvrkk2Kc4P2EL+x4Y3YB1pnRhpEjtlfOPHENYgvS4f6tGkJdopteg+ fSFFrDWnUxiscsjrM7iOSHchH5phGlMELgp5Gb98cMrcq+d6yESKLHTYX86ou2d2DPtqsO tw3I/xV8EiSEgk9hz2swsK3c8EaXqVQ= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=toxicpanda-com.20230601.gappssmtp.com header.s=20230601 header.b=DtJQjLN0; dmarc=none; spf=none (imf22.hostedemail.com: domain of josef@toxicpanda.com has no SPF policy when checking 209.85.219.54) smtp.mailfrom=josef@toxicpanda.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731684522; 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=QSuoTi14zhdgmEJ2e8nj/BNpHIFoytvzNxhl/LStwJg=; b=CZrNg4DlH6EnLqIWlgXdO0O4qePMhA2fm37F6V0WkDo+4q+yUtxMN6ALW1RAS3wZYgL1hZ R+QKNdx/Fz9rmV0nYuVFjwaY4xrznnBFT8rz+c5zbxJ3JhvmcKnHEuzi+VquOTOO5qOD1q l8+mCu9EHVU1UYeyXU+wU3+CdAwhMRk= Received: by mail-qv1-f54.google.com with SMTP id 6a1803df08f44-6d4035f2d18so2372756d6.1 for ; Fri, 15 Nov 2024 07:31:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20230601.gappssmtp.com; s=20230601; t=1731684701; x=1732289501; 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=QSuoTi14zhdgmEJ2e8nj/BNpHIFoytvzNxhl/LStwJg=; b=DtJQjLN076V0hI9IqMmeWY2TQUm5JZJLdXRLTFwj7/bxzF7ZfgvUmVLc865EHk/4f1 uR0trpst0iXCpY93IO1Xd/1OC5MVyLJJ5w+q6wP54+UERAt4WtsK7/NVcxyyqf2hebdt mvOJpFqOmw/q43UZUrAr7MKwyCODMcYb1sydGMf2U5eHe6mGxVZYNEqLwSt3oSJxx+0i S4Ok8MfA6moLuM7NOElleE44a3f+jihUGnCiYUpWeTJcW+TdHUlDXonPqtOOpLiBK6Ps jAtEaAoD02XcCsY5u/6+gEHlvguHx2A12FzBk83MfYSrJaLF2DF7WLOqxaD+e4DFNvUI GyBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731684701; x=1732289501; 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=QSuoTi14zhdgmEJ2e8nj/BNpHIFoytvzNxhl/LStwJg=; b=SdTnVWZooHHN98ANnceesVn8xCMTUnthrI2QciGBhVq9V+24ErF9zGv2Hx1wb9Bk1m SVjkP3wz3huSdcL69WHd21IfCmqu9RxqNF7JIvBNbbE0DilDdkpOjgEMNG4h55BpWiTG 9dYpE0n29aWuvJsZzmrvuivUYw3VHHRMJNtSW9177g6ecniFQNulfsMHgorgbjLHg5Fq 7Um3moCE7ah0HCXRYOK/kVjLQPlS1UL9Mo7eFs+uNv+0qCy8uLW/86NNWCp+jIbTmEsF yVY/jo25ppjpvvhSUP3Ol6dHxZdwsFnNVVheDIpCQi7WB3O8og9/vsEcWIgW8kG7OpGQ kv8Q== X-Forwarded-Encrypted: i=1; AJvYcCVs6+y46nT7APjJcFthS506kkU3hoc//kA+c4oaO/3k8QE5wX/hvj9x4qoP3HHRT/sJX/sUwBP/gw==@kvack.org X-Gm-Message-State: AOJu0YysFuTbbwlu3Fm9qnYw9AbSt0hAoIT2oMwbkarW8EwR0Tlv7oEc gnXJE7mm98lbymCe+ZDZkEero6g+rkxMLQl26OaL7RMAwg34/1DfI52mKT6vQ0WZXo5+004O5bU D X-Google-Smtp-Source: AGHT+IHJEyVOG62NvWa9d1qggTtMCjzt+EKNCXFckK971VFGqKmUTAI/9H3Oo1mgh59gFKizdUDdeA== X-Received: by 2002:a05:6902:1242:b0:e35:e173:3341 with SMTP id 3f1490d57ef6-e3825bdd813mr3265588276.0.1731684690002; Fri, 15 Nov 2024 07:31:30 -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-e38152c61d4sm989132276.5.2024.11.15.07.31.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 07:31:29 -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, viro@zeniv.linux.org.uk, linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org Subject: [PATCH v8 05/19] fanotify: rename a misnamed constant Date: Fri, 15 Nov 2024 10:30:18 -0500 Message-ID: <8776ab90fe538225aeb561c560296bafd16b97c4.1731684329.git.josef@toxicpanda.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Stat-Signature: 6xgkkhampw8uzcsobto87jjtnz38msdq X-Rspamd-Queue-Id: EAC6CC0010 X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1731684644-307240 X-HE-Meta: U2FsdGVkX1/ow4aPYzqoyG72nOpwwHZJdrFLadCmG0huQTjz5pcfLZsRwCZX8YCoHzjt6Po83UAY6wF/CcVxM2IPd+EzhBU/V+7duaCxK+Ocp8PZwQbwVjztVGuN2tH9MOFIXgpXTkJahFzhbKzSLVDGbqGvrpIjU6dtFxXi7jMG/su84shQE/elijxFw3x4NN6Xca3pG0aZQ04IzbAvTt82f4RFKR+1HbcrkHlKI0+U2VwCiiJKSQq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ofilter, spamicity=0.000000, 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 8fca5ec442e4..456cc3e92c88 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -117,7 +117,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)) @@ -172,14 +172,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; } @@ -501,7 +501,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;