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

OS-8054 inotify watches lead to EBUSY during zfs mount #239

Closed
wants to merge 1 commit into from

Conversation

mgerdts
Copy link

@mgerdts mgerdts commented Dec 2, 2019

No description provided.

@jlevon jlevon self-requested a review December 4, 2019 15:14
Copy link

@jlevon jlevon left a comment

Choose a reason for hiding this comment

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

I'm not at all confident that the fem code is the right place to be accounting for this. There's absolutely no guarantee of a v_count / fem correlation. e.g. a FEM client could install twice if they liked, sure that they won't lose their vnode if they just have a count of one.

This accounting needs to be pushed out to the clients at the point of inotify/portfs's VN_HOLD/RELEs, with a new vnode_t::v_phantom_count or somesuch.

That won't account for all FEM users but should at least fix this case, and I'm hoping it won't get too tricky, as the fem_install/uninstall callers don't look too bad. Ideally we'd get a good paragraph and what this is and isn't fixing - in particular what the count actually means and when it's suitable to use it.

  • you've left out other file systems, presumably on purpose. Could you explicitly clarify that?
  • maybe an update to the comment in common/fs/portfs/port_fop.c ?
  • this should really get upstreamed first then we can add the inotify test after it's merged

}

void
watch_port(char *path)
Copy link

Choose a reason for hiding this comment

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

const char * please

@@ -1832,7 +1831,7 @@ zfs_mount(vfs_t *vfsp, vnode_t *mvp, struct mounta *uap, cred_t *cr)
mutex_enter(&mvp->v_lock);
if ((uap->flags & MS_REMOUNT) == 0 &&
(uap->flags & MS_OVERLAY) == 0 &&
(mvp->v_count != 1 || (mvp->v_flag & VROOT))) {
(fem_getvnrefs(mvp) != 1 || (mvp->v_flag & VROOT))) {
Copy link

Choose a reason for hiding this comment

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

So I understand that you don't want to go and fix all the filesystems right now, but could we at least abstract this check out to a general vfs function so others can use it if we ever want to fix them?

@jasonbking jasonbking closed this Jun 23, 2020
@jasonbking
Copy link

Already integrated with #305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants