summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2013-10-12 17:33:28 -0500
committerBrian Behlendorf <[email protected]>2013-10-22 08:31:20 -0700
commitfbcb768c8fd1f32653f46ed4a8a9ceafe139087b (patch)
tree28910b11bdf22c93daf5d11c8a8acaea92cc70e6
parent7a6144076166944655d86f1449be8566d1a3c71a (diff)
Add missing dsl pool configuration lock
The semantics introduced by the restructured sync task of illumos 3464 require this lock when calling dmu_snapshot_list_next(). The pool is locked/unlocked for each iteration to reduce the chance of long-running locks. This was accidentally missed when doing the original port because ZoL's control directory code is Linux-specific and is in a different file than in illumos. Signed-off-by: Richard Yao <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #1785
-rw-r--r--module/zfs/zpl_ctldir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/zpl_ctldir.c b/module/zfs/zpl_ctldir.c
index 1bb646fdf..96157ec78 100644
--- a/module/zfs/zpl_ctldir.c
+++ b/module/zfs/zpl_ctldir.c
@@ -261,8 +261,10 @@ zpl_snapdir_iterate(struct file *filp, struct dir_context *ctx)
goto out;
while (error == 0) {
+ dsl_pool_config_enter(dmu_objset_pool(zsb->z_os), FTAG);
error = -dmu_snapshot_list_next(zsb->z_os, MAXNAMELEN,
- snapname, &id, &(ctx->pos), &case_conflict);
+ snapname, &id, &ctx->pos, &case_conflict);
+ dsl_pool_config_exit(dmu_objset_pool(zsb->z_os), FTAG);
if (error)
goto out;