diff options
author | George Melikov <[email protected]> | 2017-02-03 01:13:41 +0300 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-02-02 14:13:41 -0800 |
commit | 9b7b9cd370ed2ec4c8ee346bcb95cb30ba7e9ba9 (patch) | |
tree | 54fc7c65aefc2e3457aafb789794dab0f2f9a753 /module/zfs/dsl_bookmark.c | |
parent | 96f1b347f8f726163c105704576110a4a8be4b84 (diff) |
OpenZFS 1300 - filename normalization doesn't work for removes
Authored by: Kevin Crowe <[email protected]>
Reviewed by: Yuri Pankov <[email protected]>
Reviewed by: Pavel Zakharov <[email protected]>
Reviewed by: Matt Ahrens <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Ported-by: George Melikov <[email protected]>
OpenZFS-issue: https://www.illumos.org/issues/1300
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/8f1750d
Closes #5725
Porting notes:
- zap_micro.c: all `MT_EXACT` are replaced by `0`
Diffstat (limited to 'module/zfs/dsl_bookmark.c')
-rw-r--r-- | module/zfs/dsl_bookmark.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/module/zfs/dsl_bookmark.c b/module/zfs/dsl_bookmark.c index 5a7f034ce..64f5788c4 100644 --- a/module/zfs/dsl_bookmark.c +++ b/module/zfs/dsl_bookmark.c @@ -12,8 +12,10 @@ * * CDDL HEADER END */ + /* * Copyright (c) 2013, 2014 by Delphix. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. */ #include <sys/zfs_context.h> @@ -59,16 +61,14 @@ dsl_dataset_bmark_lookup(dsl_dataset_t *ds, const char *shortname, { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; uint64_t bmark_zapobj = ds->ds_bookmarks; - matchtype_t mt; + matchtype_t mt = 0; int err; if (bmark_zapobj == 0) return (SET_ERROR(ESRCH)); if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) - mt = MT_FIRST; - else - mt = MT_EXACT; + mt = MT_NORMALIZE; err = zap_lookup_norm(mos, bmark_zapobj, shortname, sizeof (uint64_t), sizeof (*bmark_phys) / sizeof (uint64_t), bmark_phys, mt, @@ -342,12 +342,10 @@ dsl_dataset_bookmark_remove(dsl_dataset_t *ds, const char *name, dmu_tx_t *tx) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; uint64_t bmark_zapobj = ds->ds_bookmarks; - matchtype_t mt; + matchtype_t mt = 0; if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) - mt = MT_FIRST; - else - mt = MT_EXACT; + mt = MT_NORMALIZE; return (zap_remove_norm(mos, bmark_zapobj, name, mt, tx)); } |