From 227ddfdd8f8accdba28cd357261011c5ace2ed72 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Sat, 4 Oct 2014 07:49:06 +0000 Subject: [PATCH] 5150 zfs clone of a defer_destroy snapshot causes strangeness Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Max Grossman Reviewed by: Saso Kiselkov Reviewed by: Richard Elling Approved by: Robert Mustacchi Author: Matthew Ahrens illumos/illumos-gate@42fcb65ea4f2c6f8cc5a3c6142a486cb49871fd2 --- uts/common/fs/zfs/dsl_dataset.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/uts/common/fs/zfs/dsl_dataset.c b/uts/common/fs/zfs/dsl_dataset.c index c075c6ac3dd5..f1b92f3eaa33 100644 --- a/uts/common/fs/zfs/dsl_dataset.c +++ b/uts/common/fs/zfs/dsl_dataset.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2014 RackTop Systems. */ @@ -692,7 +692,13 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd, dsl_dataset_t *origin, dsphys->ds_uncompressed_bytes = origin->ds_phys->ds_uncompressed_bytes; dsphys->ds_bp = origin->ds_phys->ds_bp; - dsphys->ds_flags |= origin->ds_phys->ds_flags; + + /* + * Inherit flags that describe the dataset's contents + * (INCONSISTENT) or properties (Case Insensitive). + */ + dsphys->ds_flags |= origin->ds_phys->ds_flags & + (DS_FLAG_INCONSISTENT | DS_FLAG_CI_DATASET); dmu_buf_will_dirty(origin->ds_dbuf, tx); origin->ds_phys->ds_num_children++;