-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
synchronous open count in zfs_close() needs to be decremented #237
Comments
Thanks, for catching this. I'll commit a fix shortly which is exactly what you suggest. Did you just happen to stumble across this in the code or did it cause a problem on your system somehow? |
Actually, I take it back. This isn't quite so simple, I believe the original code is correct but it could certainly use a comment. Unlike Solaris Linux only calls its close/release callback once after everyone who has the file has closed it. For Solaris it is called per-close. So we really do want to set it to zero since this will not be symmetric with open. |
I was going through the code and thats when got to it. |
Authored by: George Wilson <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed by: Steve Gonczi <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> We need to prevent any reader whenever we're about the zero out all the blkptrs. To do this we need to grab the dn_struct_rwlock as writer in dbuf_write_children_ready and free_children just prior to calling bzero. Closes openzfs#237 Ported-by: George Melikov <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7580 OpenZFS-commit: openzfs/openzfs@3105d95
Authored by: George Wilson <[email protected]> Reviewed by: Pavel Zakharov <[email protected]> Reviewed by: Steve Gonczi <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> We need to prevent any reader whenever we're about the zero out all the blkptrs. To do this we need to grab the dn_struct_rwlock as writer in dbuf_write_children_ready and free_children just prior to calling bzero. Closes openzfs#237 Ported-by: George Melikov <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7580 OpenZFS-commit: openzfs/openzfs@3105d95
openzfs#227) (openzfs#237) ...d during data connection Signed-off-by: Vitta <[email protected]>
Fix P2ALIGN overflow in dmu_object_alloc_impl
Hi Brian,
A small issue : -
z_sync_count needs to be decremented in zfs_close() if O_SYNC flag is specified.
Bug : -
/* Decrement the synchronous opens in the znode */
if (flag & O_SYNC)
zp->z_sync_cnt = 0;
Probable fix : -
/* Decrement the synchronous opens in the znode */
if (flag & O_SYNC)
atomic_dec_32(&zp->z_sync_cnt);
The text was updated successfully, but these errors were encountered: