From patchwork Thu Nov 21 11:22:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 13881867 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 6012FD6ED09 for ; Thu, 21 Nov 2024 11:22:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A91FB6B0092; Thu, 21 Nov 2024 06:22:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A16E46B0093; Thu, 21 Nov 2024 06:22:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 84E1E6B007B; Thu, 21 Nov 2024 06:22:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 61BC76B007B for ; Thu, 21 Nov 2024 06:22:28 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 12FD4121210 for ; Thu, 21 Nov 2024 11:22:28 +0000 (UTC) X-FDA: 82809863472.14.19B0D19 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf09.hostedemail.com (Postfix) with ESMTP id 8397E14000F for ; Thu, 21 Nov 2024 11:21:49 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of jack@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732187962; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YFmz7Gnspcl8L7JwGfPYubE8/0FxAy3rAOQHmhVX8v4=; b=sTnhuNOP7vmWkrRMpkRbddkWra4TbZr7qmMNtAQSwrAoZmBuE+QFxVln2IjVrOJY+nVGOJ HWt3yoH7cpGMkJf+Sy2GFk20Z29L+e76PmpQrLyYdn8abH/D4bMsZIMBdkEWO6XGTOZBeA OZBz3sWoZQYbjcPOhd36dCWvdQzdxpg= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=none; spf=pass (imf09.hostedemail.com: domain of jack@suse.cz designates 195.135.223.131 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732187962; a=rsa-sha256; cv=none; b=XZGlpyKIBwwh8gK8l9hYS6SVpxy1hLoIRqYzExtA/wxYMRHbdWJsNA+TnJAQDfnuZJi/oa H+SJ7e55Jg9c1rSfFUlRyORrUVGQRFz4xwKz7jlFsFg1oliw7wXCfMPZhi0oB0BVaxpeP9 LKHcQPuxju5C7BtV4k7h1cVrXACHQ4o= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 7CCDA1F7FD; Thu, 21 Nov 2024 11:22:24 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6DD9E13927; Thu, 21 Nov 2024 11:22:24 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id JSbQGvAXP2cxfwAAD6G6ig (envelope-from ); Thu, 21 Nov 2024 11:22:24 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id E454CA08FB; Thu, 21 Nov 2024 12:22:23 +0100 (CET) From: Jan Kara To: Cc: Amir Goldstein , Josef Bacik , brauner@kernel.org, Linus Torvalds , Al Viro , linux-xfs@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, Jan Kara Subject: [PATCH 05/19] fanotify: rename a misnamed constant Date: Thu, 21 Nov 2024 12:22:04 +0100 Message-Id: <20241121112218.8249-6-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20241121112218.8249-1-jack@suse.cz> References: <20241121112218.8249-1-jack@suse.cz> MIME-Version: 1.0 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 8397E14000F X-Stat-Signature: of8hbqyyxtbog6jskc5rd7x46ttkwsci X-Rspam-User: X-HE-Tag: 1732188109-167392 X-HE-Meta: U2FsdGVkX1/x9amc/bfXvoEdibGbFXBIVn8TstGzb5fcockMSbYT2LwAGtOJiiWk/kYXe6fCFX/ubANg0uKApZfydKIgxSoPGLGdj+DvdKnZAj/kbxCGeAHwOyUkar9Ywz4r5Ypy9KTQJjaN4f4ZMzxWSHR9asxVNGZyOZHSCZPutiMHHSUlAql3qSNe6qKN4AXaenQzckCIrFQb9ED2dX7mJ17dQLfedu2NUhodRVgBy/9s25lDDCPwRB26N+2ZEviAd5AdYimftsBq0b3as6Qfc8rB18jPY7RE3KeM746J0c6MGrrPnajp1wlS4+n5xBDZAGyfOJLT6Hs6NdXWaTGOfsjbMRPbUyJkzaZlIdecViqpJl9j4tAJ8rRLXX3W2z1/LxgTWqNCkSfKeQrsR6awBqZMjiZkcwCuVOZew1fx14pJUWwygZ+HLHZWMvGNXW//p1zQzF5phpAMvwXpq8jsLQ+5PIeniyrdxFI3b+F9NhREMwwclzxXjrc67zsUA6j1B60mfGDaw3nl9D7h1TWNa0TVIzGwtB7exxBvHAb8k8AogGToXpt2fc8hidgsWyt6zrIQxGdifji9wZzcwo3mPv4eGPA1ldrsc1xGzwoVwNnopPSQrqmgorqRxc2xUmJb0XV2tWU6/4GlDQxuoBQE27+9+nlZrCznhfdxDEjtQZv5MUNzWSl3j3VAZpKmSvZ52ma/CgIAUNOYOpUoi5TGC6vSLUuwkSxVKxdxp2ljaVigzwIyXjIX6Gyr7OFMihzUrK2nvQO5BjLXJPdJq9IGglhpjJrz1cffu+efD+/mTimtFJA2ij+uwwbtYXtFQaz1B7h3DI5hwiDB5R8gdFwRyghw+csXG/ifHFGDOFCKCQqTy8AwkVvZxqdjBulvWO9Mjm/tiKJusnvapZzF0XPb7Hrjb5lfH38aP0E2u70wAQ86Jc1ljG3bCw9TI/9NW61UI++oUAp/rfwufxT QaPq/FAY ar2wq4y73U5gDYRPol5R+RuZ1tuQpXVWE96xunC7LMwFNyTTy/ChyjUbcaIYHegRhXLfpUfTeiUxjxmn3BhTqy3xRmJMQveVHRIThGE/7P1vDe4a4WdHqAsFzfhUrasLJl/VFlVHE4mgvdnJ+P5iEJgFOKc3UsqWNXMVObQdUFmttmWwx58sP1bDjFUAZqCUZBxG4RGWURheqbfvxepYOerR5dFPi6a4U8PYxa8lz+nrhD89mdeACMTWm5vUbK1DnZv49unVpzxgY8Rw= X-Bogosity: Ham, tests=bogofilter, 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 Signed-off-by: Jan Kara Link: https://patch.msgid.link/8776ab90fe538225aeb561c560296bafd16b97c4.1731684329.git.josef@toxicpanda.com --- 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 8dcd46fe6964..8d8afa09560b 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; } @@ -502,7 +502,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;