From a0bd735adb1b1eb81fef10b4db102ee051c4d4ff Mon Sep 17 00:00:00 2001 From: Boris Protopopov Date: Sat, 22 Mar 2014 05:07:14 -0400 Subject: Add support for asynchronous zvol minor operations zfsonlinux issue #2217 - zvol minor operations: check snapdev property before traversing snapshots of a dataset zfsonlinux issue #3681 - lock order inversion between zvol_open() and dsl_pool_sync()...zvol_rename_minors() Create a per-pool zvol taskq for asynchronous zvol tasks. There are a few key design decisions to be aware of. * Each taskq must be single threaded to ensure tasks are always processed in the order in which they were dispatched. * There is a taskq per-pool in order to keep the pools independent. This way if one pool is suspended it will not impact another. * The preferred location to dispatch a zvol minor task is a sync task. In this context there is easy access to the spa_t and minimal error handling is required because the sync task must succeed. Support for asynchronous zvol minor operations address issue #3681. Signed-off-by: Boris Protopopov Signed-off-by: Brian Behlendorf Closes #2217 Closes #3678 Closes #3681 --- module/zfs/dmu_objset.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module/zfs/dmu_objset.c') diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c index acfc7f048..f9c534eb5 100644 --- a/module/zfs/dmu_objset.c +++ b/module/zfs/dmu_objset.c @@ -26,6 +26,7 @@ * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2015 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2015, STRATO AG, Inc. All rights reserved. + * Copyright (c) 2016 Actifio, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -868,6 +869,8 @@ dmu_objset_create_sync(void *arg, dmu_tx_t *tx) } spa_history_log_internal_ds(ds, "create", tx, ""); + zvol_create_minors(dp->dp_spa, doca->doca_name, B_TRUE); + dsl_dataset_rele(ds, FTAG); dsl_dir_rele(pdd, FTAG); } @@ -961,6 +964,7 @@ dmu_objset_clone_sync(void *arg, dmu_tx_t *tx) dsl_dataset_name(origin, namebuf); spa_history_log_internal_ds(ds, "clone", tx, "origin=%s (%llu)", namebuf, origin->ds_object); + zvol_create_minors(dp->dp_spa, doca->doca_clone, B_TRUE); dsl_dataset_rele(ds, FTAG); dsl_dataset_rele(origin, FTAG); dsl_dir_rele(pdd, FTAG); -- cgit v1.2.3