HomeFreeBSD

Move iput() after zfs_inode_update()

Description

Move iput() after zfs_inode_update()

When replaying an unlink/remove operation via zfs_rmdir() the object
being removed will be instantiated by a call to zfs_dirent_lock().
This means that there is a single reference protecting the object.
Right before the call to zfs_inode_update() this reference is dropped
which may cause the object to be destroyed. This will result in a
NULL dereference as shown by the stack trace is issue #782.

This likely isn't an issue during normal operation because there is
always an additional reference held on the object by the VFS.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #782

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Sep 12 2012, 6:16 PM
Parents
rGcda4db408c28: Revert "Improve AF hard disk detection"
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG5915791096e6: Move iput() after zfs_inode_update() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Sep 12 2012, 9:22 PM