aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_dir.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-08-04 13:30:20 -0700
committerBrian Behlendorf <[email protected]>2014-08-11 16:11:43 -0700
commit0a50679ce9eb8ded7bf20685e9d32724ded9cb8d (patch)
tree0087b2570d24eb85e710051c4c3721bc22469069 /module/zfs/zfs_dir.c
parent4dd18932ba4cfdcf9b16609f6a80c2d6c239cb15 (diff)
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 <[email protected]> Signed-off-by: Richard Yao <[email protected]> Closes #457
Diffstat (limited to 'module/zfs/zfs_dir.c')
-rw-r--r--module/zfs/zfs_dir.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/module/zfs/zfs_dir.c b/module/zfs/zfs_dir.c
index 448a8727e..d2b5bc408 100644
--- a/module/zfs/zfs_dir.c
+++ b/module/zfs/zfs_dir.c
@@ -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