Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux: O_TMPFILE and insert inode hash rework #16772

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snajpa
Copy link
Contributor

@snajpa snajpa commented Nov 16, 2024

Motivation and Context

Byproduct of investigation done for #16608

Description

This change:

  • reworks inode hash insert so that its in topmost layer and with inode unlock in the same order as other Linux FS implementations do it

  • reworks O_TMPFILE creation to use new linux specific zp->z_is_tmpfile, this fixes a potential unchecked error return value of zpl_xattr_security_init

  • changes igrabs to zhold where it can

  • exchanges truncate_setsize for truncate_inode_pages_final in zpl_evict_inode to follow vfs.rst's
    "the method has to use truncate_inode_pages_final()"

notes + questions:

  • not sure about the change from "working with inode" to "working with znode", can remove that, that's a bit of a leftover
  • I'd like to eliminate the txg_wait_synced in zfs_link in the tmpfile case, I'd log it as a new file creation, is that ok?

How Has This Been Tested?

Localy during development and via the bots also

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

This change:

- reworks inode hash insert so that its in topmost layer and with inode
unlock in the same order as other Linux FS implementations do it

- reworks O_TMPFILE creation to use new linux specific zp->z_is_tmpfile,
this fixes a potential unchecked error return value of
zpl_xattr_security_init

- changes igrabs to zhold where it can

- exchanges truncate_setsize for truncate_inode_pages_final in
zpl_evict_inode to follow vfs.rst's
"the method has to use truncate_inode_pages_final()"

Signed-off-by: Pavel Snajdr <[email protected]>
@github-actions github-actions bot added the Status: Work in Progress Not yet ready for general review label Nov 16, 2024
@snajpa snajpa marked this pull request as ready for review November 16, 2024 21:40
@github-actions github-actions bot added Status: Code Review Needed Ready for review and testing and removed Status: Work in Progress Not yet ready for general review labels Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Code Review Needed Ready for review and testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant