]> granicus.if.org Git - zfs/commitdiff
Add missing dsl pool configuration lock
authorTim Chase <tim@chase2k.com>
Sat, 12 Oct 2013 22:33:28 +0000 (17:33 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 22 Oct 2013 15:31:20 +0000 (08:31 -0700)
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 <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1785

module/zfs/zpl_ctldir.c

index 1bb646fdf728ac1a0e3d041dbf1d97372c143c89..96157ec780f45b678a25162f90f389d9737898cc 100644 (file)
@@ -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;