mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-06-01 03:34:10 +03:00
Add zfs_iput_async() interface
Handle all iputs in zfs_purgedir() and zfs_inode_destroy() asynchronously to prevent deadlocks. When the iputs are allowed to run synchronously in the destroy call path deadlocks between xattr directory inodes and their parent file inodes are possible. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <ryao@gentoo.org> Closes #457
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include <sys/policy.h>
|
||||
#include <sys/zfs_dir.h>
|
||||
#include <sys/zfs_acl.h>
|
||||
#include <sys/zfs_vnops.h>
|
||||
#include <sys/fs/zfs.h>
|
||||
#include "fs/fs_subr.h"
|
||||
#include <sys/zap.h>
|
||||
@@ -528,7 +529,7 @@ zfs_purgedir(znode_t *dzp)
|
||||
error = dmu_tx_assign(tx, TXG_WAIT);
|
||||
if (error) {
|
||||
dmu_tx_abort(tx);
|
||||
iput(ZTOI(xzp));
|
||||
zfs_iput_async(ZTOI(xzp));
|
||||
skipped += 1;
|
||||
continue;
|
||||
}
|
||||
@@ -541,7 +542,7 @@ zfs_purgedir(znode_t *dzp)
|
||||
skipped += 1;
|
||||
dmu_tx_commit(tx);
|
||||
|
||||
iput(ZTOI(xzp));
|
||||
zfs_iput_async(ZTOI(xzp));
|
||||
}
|
||||
zap_cursor_fini(&zc);
|
||||
if (error != ENOENT)
|
||||
@@ -729,7 +730,7 @@ zfs_rmnode(znode_t *zp)
|
||||
dmu_tx_commit(tx);
|
||||
out:
|
||||
if (xzp)
|
||||
iput(ZTOI(xzp));
|
||||
zfs_iput_async(ZTOI(xzp));
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
|
||||
Reference in New Issue
Block a user