From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796100565; b=thRZvhqksYNMUk5wtHnsN7rNdtLylf7toc/qXRMftaqkJ46Z5I3zf33CZ26Z0Qh92Zyp 3iLoiK5F+QN2WrzDHltIrOT68xK/gbAszr6OFOt/YYQ5jo7y7hosVhtLYZcWnCC2IjgRS 39Hl/4KqSvnFNT3nBF9VBIJtGh84dU+nuD6yZkH1k7Vmq1qMgkAAnkBVHgFdjyevD9CFy AdLDPnkytepqZPI8GuD7uLWe9/FFUXmkNRMwuQi4ILKbpW6oL9O/Zxh0QPwNFX7fTlSJN 1SH/5+F1412MKWMzkuQ3FJTDah5Guj8O+/vDVsCOkeYz9q1Y6Rr1DGWD1C2nz8dhIYQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796100565; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=80d3AsRSF1gty7a6W8GNZDSAVrpZ9zl0sCg2fmMW8Uo=; b=4W6upHtbo1kjwc9J2VnJNn0WqDQi4AMUNhOtJBV2NmOWByvARAGp4Fktft8sxM/ZJzca CIJq0KtdkakRjBqJchXuf1hRMaf4v2XLnS6pza0MDigefiLcmZX1riAnP30XAv2QQzLyL jyTNgpsI/FhfNIaEsXo63wyh1eH4K/dABRyM3MeJgEjGqgO/ZQuTW2MZa0kNzSdHZOTTR pKgLH/Engoc7kPWmspD6GnHL9WGLETpKVf4637DVIyQfVlxRd2tGzZGnziStAmqiuEXAh w/tNyy1msilE9+0Z+OyKZdS9WaymPcvbDdrAOzy+vxjnjK6HAcqBycqtbOcLA8cBYoQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cEg52WMq; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E73C2606A31A for ; Tue, 1 Dec 2026 04:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=cEg52WMq Received: by smtp.kernel.org (Postfix) with ESMTPSA id 633C41F000C1; Tue, 1 Dec 2026 04:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796100564; bh=80d3AsRSF1gty7a6W8GNZDSAVrpZ9zl0sCg2fmMW8Uo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=cEg52WMqHHv6FGjFBH6MDbqhRYqVEESspn74qIVHaeFEOGEmcdbjmqGfis2M9+qM1 O4/rEZ6bPCSloeCagxFgfa5ywMsC1DvVbafadfkXrZnvkqrMK+WhoJij+aJgQ8KwUE GV876iXCBkIPNp5j7QPGA2Rtb3P5fpGS/4xADX//6H3dunxMBGkE3aDnzKdIVnMxzH XunhY88q6nFXRQLUAT9UN0fNa2P9pz4PKiVyv8ACYQx3dLimSFwC3R9+QlxpYrGKZh UI4CakRaCJJpVNTogiNvkQUkgyH3/ZTY+/lBjnd9S8vERgebHcTEtuL4riJC0Fp5mA cnQ3HeVYJuYGA== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 3/6] xfs: add BPF data placement hook at file open Reply-To: sashiko-reviews@lists.linux.dev To: "Naohiro Aota" Cc: bpf@vger.kernel.org In-Reply-To: <20261201043452.3866039-4-naohiro.aota@wdc.com> References: <20261201043452.3866039-1-naohiro.aota@wdc.com> <20261201043452.3866039-4-naohiro.aota@wdc.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 04:49:23 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] xfs: unnecessary parent dentry refcount atomic ops in xfs_bpf_file_open() -- commit 0cdaf5aa12590d62fbbcba19ad54035936a3eaaf Author: Naohiro Aota xfs: add BPF data placement hook at file open This commit adds a hook in xfs_file_open() to invoke an attached BPF data placement policy when a file is opened for writing, allowing the policy to update the inode's write lifetime hint. > diff --git a/fs/xfs/xfs_bpf.c b/fs/xfs/xfs_bpf.c > new file mode 100644 > index 0000000000000..0e7ef40d98d95 > --- /dev/null > +++ b/fs/xfs/xfs_bpf.c > @@ -0,0 +1,81 @@ [ ... ] > +void > +xfs_bpf_file_open( > + struct inode *inode, > + struct file *file) > +{ > + struct xfs_mount *mp =3D XFS_M(inode->i_sb); > + struct fs_dp_file_open_res res =3D { > + .i_write_hint =3D READ_ONCE(inode->i_write_hint), > + }; > + struct file_kattr fa =3D {}; > + struct fs_dp_ops *ops; > + struct dentry *parent; > + unsigned long parent_ino; > + > + if (!(file->f_mode & FMODE_WRITE)) > + return; > + if (!rcu_access_pointer(mp->m_dp_ops)) > + return; > + > + xfs_fileattr_get(file->f_path.dentry, &fa); > + > + parent =3D dget_parent(file->f_path.dentry); > + parent_ino =3D d_inode(parent)->i_ino; > + dput(parent); [Severity: Low] Could this use d_parent_ino(file->f_path.dentry) instead of dget_parent() and dput()? Taking and dropping a reference on the parent dentry updates parent->d_lockref on every writable file open when a policy is active, causing cacheline and lockref contention across concurrent opens in the same directory. d_parent_ino() reads the parent inode number locklessly under RCU and dentry->d_seq. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201043452.3866= 039-1-naohiro.aota@wdc.com?part=3D3