From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E1A115699E; Tue, 18 Jun 2024 12:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718715592; cv=none; b=NiPSqXQnRLbnNk9BdOfQ1+jgjtukeqm3vqhHfK20qaFyacuScx8fmvjI1rJsEr37s4yVnEZMSoksRLENG+QPNMnkoo728DUU3lHaoAUsvsq8bWD5aPjj74r189a/12910rAP+TCvFeb/tm+T5Af+FA/8wJXkwqDCvqCyvYwecmM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718715592; c=relaxed/simple; bh=v0Rj0qj1eHLonV927caioEgI1Ek3SaYEVzHJVkNZZc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H2DBRMk6Up0WRzIA15fy27OIz1+2gtaUME/bCCH6I1g+dSPLDy3MPV1DSqXlxsQQIdR1bVImfgkncOc8eQCoshjmpc7esm7+v9z3X8XZ49MT8P5ueffJTp/B062gl9VQtAtPqysi/HV7GMZdCapO2ZXyTAFEQNj+RPn1XxdoMh0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=v25drcLq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="v25drcLq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78C3DC4AF48; Tue, 18 Jun 2024 12:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718715591; bh=v0Rj0qj1eHLonV927caioEgI1Ek3SaYEVzHJVkNZZc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v25drcLqqjgJv5tYV/hQCWmPOY0S/qyVk3iXEwN5D/28HJbmvdUhOKY3VKBVVt+w1 TIpW+43v6aTPR1tYRRFfuUh0n8GAF0HqGI6VgmSXlwbWT1eJcE563Qbxh5KHPKgTX2 38pFXVmCIagobQo+qClHoROm3083jaOsuGDFQ8NE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jan Kara , Amir Goldstein , Gabriel Krisman Bertazi , Chuck Lever , Sasha Levin Subject: [PATCH 5.10 361/770] fsnotify: pass data_type to fsnotify_name() Date: Tue, 18 Jun 2024 14:33:34 +0200 Message-ID: <20240618123421.203279152@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618123407.280171066@linuxfoundation.org> References: <20240618123407.280171066@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Amir Goldstein [ Upstream commit 9baf93d68bcc3d0a6042283b82603c076e25e4f5 ] Align the arguments of fsnotify_name() to those of fsnotify(). Link: https://lore.kernel.org/r/20211025192746.66445-2-krisman@collabora.com Reviewed-by: Jan Kara Signed-off-by: Amir Goldstein Signed-off-by: Gabriel Krisman Bertazi Signed-off-by: Jan Kara [ cel: adjust fsnotify_delete as well, a37d9a17f099 is already applied ] Signed-off-by: Chuck Lever Signed-off-by: Sasha Levin --- include/linux/fsnotify.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index a9477c14fad5c..211463715e29d 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h @@ -26,20 +26,21 @@ * FS_EVENT_ON_CHILD mask on the parent inode and will not be reported if only * the child is interested and not the parent. */ -static inline void fsnotify_name(struct inode *dir, __u32 mask, - struct inode *child, - const struct qstr *name, u32 cookie) +static inline int fsnotify_name(__u32 mask, const void *data, int data_type, + struct inode *dir, const struct qstr *name, + u32 cookie) { if (atomic_long_read(&dir->i_sb->s_fsnotify_connectors) == 0) - return; + return 0; - fsnotify(mask, child, FSNOTIFY_EVENT_INODE, dir, name, NULL, cookie); + return fsnotify(mask, data, data_type, dir, name, NULL, cookie); } static inline void fsnotify_dirent(struct inode *dir, struct dentry *dentry, __u32 mask) { - fsnotify_name(dir, mask, d_inode(dentry), &dentry->d_name, 0); + fsnotify_name(mask, d_inode(dentry), FSNOTIFY_EVENT_INODE, + dir, &dentry->d_name, 0); } static inline void fsnotify_inode(struct inode *inode, __u32 mask) @@ -154,8 +155,10 @@ static inline void fsnotify_move(struct inode *old_dir, struct inode *new_dir, new_dir_mask |= FS_ISDIR; } - fsnotify_name(old_dir, old_dir_mask, source, old_name, fs_cookie); - fsnotify_name(new_dir, new_dir_mask, source, new_name, fs_cookie); + fsnotify_name(old_dir_mask, source, FSNOTIFY_EVENT_INODE, + old_dir, old_name, fs_cookie); + fsnotify_name(new_dir_mask, source, FSNOTIFY_EVENT_INODE, + new_dir, new_name, fs_cookie); if (target) fsnotify_link_count(target); @@ -209,7 +212,8 @@ static inline void fsnotify_link(struct inode *dir, struct inode *inode, fsnotify_link_count(inode); audit_inode_child(dir, new_dentry, AUDIT_TYPE_CHILD_CREATE); - fsnotify_name(dir, FS_CREATE, inode, &new_dentry->d_name, 0); + fsnotify_name(FS_CREATE, inode, FSNOTIFY_EVENT_INODE, + dir, &new_dentry->d_name, 0); } /* @@ -228,7 +232,8 @@ static inline void fsnotify_delete(struct inode *dir, struct inode *inode, if (S_ISDIR(inode->i_mode)) mask |= FS_ISDIR; - fsnotify_name(dir, mask, inode, &dentry->d_name, 0); + fsnotify_name(mask, inode, FSNOTIFY_EVENT_INODE, dir, &dentry->d_name, + 0); } /** -- 2.43.0