mbox series

[0/2] Decomplicate file_dentry()

Message ID 20240202110132.1584111-1-amir73il@gmail.com (mailing list archive)
Headers show
Series Decomplicate file_dentry() | expand

Message

Amir Goldstein Feb. 2, 2024, 11:01 a.m. UTC
Miklos,

When posting the patches for file_user_path(), I wrote [1]:

"This change already makes file_dentry() moot, but for now we did not
 change this helper just added a WARN_ON() in ovl_d_real() to catch if we
 have made any wrong assumptions.

 After the dust settles on this change, we can make file_dentry() a plain
 accessor and we can drop the inode argument to ->d_real()."

I was going to follow your suggestion and make this change to ->d_real(),
but a recent discussion on EVM signature verification on overlay files [2]
raised the need to get the real metacopy inode instead of the real data
inode.

So instead of removing the inode argument, I replaced it with a type.
Currently, type can take D_REAL_{DATA,METADATA}, but in the future,
if the need arises, it could grow other types like D_REAL_{UPPER,LOWER}.

Please let me know what you think of the proposed API.

This work is destined to be a pull request to Christian's vfs tree,
unless someone has any objections to this route.

Thanks,
Amir.

[1] https://lore.kernel.org/r/20231009153712.1566422-1-amir73il@gmail.com/
[2] https://lore.kernel.org/r/20240130214620.3155380-5-stefanb@linux.ibm.com/

Amir Goldstein (2):
  fs: make file_dentry() a simple accessor
  fs: remove the inode argument to ->d_real() method

 Documentation/filesystems/locking.rst |  2 +-
 Documentation/filesystems/vfs.rst     | 16 ++++-----
 fs/overlayfs/super.c                  | 52 ++++++++++++---------------
 include/linux/dcache.h                | 18 ++++++----
 include/linux/fs.h                    | 13 ++++++-
 5 files changed, 53 insertions(+), 48 deletions(-)

Comments

Christian Brauner Feb. 6, 2024, 4:02 p.m. UTC | #1
On Fri, 02 Feb 2024 13:01:30 +0200, Amir Goldstein wrote:
> Miklos,
> 
> When posting the patches for file_user_path(), I wrote [1]:
> 
> "This change already makes file_dentry() moot, but for now we did not
>  change this helper just added a WARN_ON() in ovl_d_real() to catch if we
>  have made any wrong assumptions.
> 
> [...]

Applied. Let me know in case this needs to go somewhere else.
Added the enum change as discussed. Please double check ofc.

---

Applied to the vfs.misc branch of the vfs/vfs.git tree.
Patches in the vfs.misc branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc

[1/2] fs: make file_dentry() a simple accessor
      https://git.kernel.org/vfs/vfs/c/c6c14f926fbe
[2/2] fs: remove the inode argument to ->d_real() method
      https://git.kernel.org/vfs/vfs/c/2109cc619e73