Print this page
5610 zfs clone from different source and target pools produces coredump

@@ -22,10 +22,11 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
  */
 
 /* Portions Copyright 2010 Robert Milkowski */
 
 #include <sys/cred.h>

@@ -903,15 +904,11 @@
                 return (error);
         if (tail == NULL) {
                 dsl_dir_rele(pdd, FTAG);
                 return (SET_ERROR(EEXIST));
         }
-        /* You can't clone across pools. */
-        if (pdd->dd_pool != dp) {
-                dsl_dir_rele(pdd, FTAG);
-                return (SET_ERROR(EXDEV));
-        }
+
         error = dsl_fs_ss_limit_check(pdd, 1, ZFS_PROP_FILESYSTEM_LIMIT, NULL,
             doca->doca_cred);
         if (error != 0) {
                 dsl_dir_rele(pdd, FTAG);
                 return (SET_ERROR(EDQUOT));

@@ -920,16 +917,10 @@
 
         error = dsl_dataset_hold(dp, doca->doca_origin, FTAG, &origin);
         if (error != 0)
                 return (error);
 
-        /* You can't clone across pools. */
-        if (origin->ds_dir->dd_pool != dp) {
-                dsl_dataset_rele(origin, FTAG);
-                return (SET_ERROR(EXDEV));
-        }
-
         /* You can only clone snapshots, not the head datasets. */
         if (!origin->ds_is_snapshot) {
                 dsl_dataset_rele(origin, FTAG);
                 return (SET_ERROR(EINVAL));
         }