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: s_op: use .free_inode #16788

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

Conversation

snajpa
Copy link
Contributor

@snajpa snajpa commented Nov 20, 2024

Motivation and Context

#16608

Description

as per Documentation/filesystems/porting.rst:

quote:

**strongly recommended**

take the RCU-delayed parts of ->destroy_inode() into a new method - ->free_inode().  If ->destroy_inode() becomes empty - all the better, just get rid of it.

endquote.

How Has This Been Tested?

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:

@snajpa snajpa marked this pull request as ready for review November 20, 2024 17:23
@snajpa snajpa mentioned this pull request Nov 20, 2024
13 tasks
@github-actions github-actions bot added Status: Work in Progress Not yet ready for general review Status: Code Review Needed Ready for review and testing and removed Status: Work in Progress Not yet ready for general review labels Nov 20, 2024
as per Documentation/filesystems/porting.rst:

quote:

**strongly recommended**

take the RCU-delayed parts of ->destroy_inode() into a new method -
->free_inode().  If ->destroy_inode() becomes empty - all the better,
just get rid of it.

endquote.

Signed-off-by: Pavel Snajdr <[email protected]>
.destroy_inode = zpl_inode_destroy,
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we still want to register .destroy_inode even when .free_inode is available. It's just that the RCU-delayed parts have been moved in to .free_inode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I tried to adhere to the note in porting.rst to the fullest extent possible, as it doesn't even say that .free_inode is now required if one doesn't want to run into unexplainable behavior (perhaps only with some kernel releases along the way to full folio conversion); I was wondering what more in terms of problems can we expect if I try to go against that note, in a sense of leaving .destroy_inode as it was.

Do you see any consequences of merging destroy_inode into evict_inode from the ZFS point of view? I couldn't think of anything so that's why I decided to do away with destroy_inode by merging it, just an abundance of caution, aka "what else aren't they telling me in the note, when they didn't even say it's mandatory but just recommended"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, if the inode gets as far as evict_inode being called on it, it's already done and zfs_zget is going to keep looping until it disappears completely, isn't it so?

zfs_inode_free(ip);
}

static void __maybe_unused
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__maybe_unused shouldn't be needed here or above. We can use the guard macro's here to build the required functions, or not.

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.

2 participants