mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-26 04:07:45 +03:00
OpenZFS 1300 - filename normalization doesn't work for removes
Authored by: Kevin Crowe <kevin.crowe@nexenta.com> Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com> Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed by: Matt Ahrens <mahrens@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Ported-by: George Melikov <mail@gmelikov.ru> 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`
This commit is contained in:
committed by
Brian Behlendorf
parent
96f1b347f8
commit
9b7b9cd370
@@ -18,6 +18,7 @@
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2016 by Delphix. All rights reserved.
|
||||
@@ -26,6 +27,7 @@
|
||||
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
|
||||
* Copyright (c) 2016 Actifio, Inc. All rights reserved.
|
||||
* Copyright 2016, OmniTI Computer Consulting, Inc. All rights reserved.
|
||||
* Copyright 2017 Nexenta Systems, Inc.
|
||||
*/
|
||||
|
||||
#include <sys/dmu_objset.h>
|
||||
@@ -360,17 +362,15 @@ dsl_dataset_snap_lookup(dsl_dataset_t *ds, const char *name, uint64_t *value)
|
||||
{
|
||||
objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset;
|
||||
uint64_t snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj;
|
||||
matchtype_t mt;
|
||||
matchtype_t mt = 0;
|
||||
int err;
|
||||
|
||||
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, snapobj, name, 8, 1,
|
||||
value, mt, NULL, 0, NULL);
|
||||
if (err == ENOTSUP && mt == MT_FIRST)
|
||||
if (err == ENOTSUP && (mt & MT_NORMALIZE))
|
||||
err = zap_lookup(mos, snapobj, name, 8, 1, value);
|
||||
return (err);
|
||||
}
|
||||
@@ -381,18 +381,16 @@ dsl_dataset_snap_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 snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj;
|
||||
matchtype_t mt;
|
||||
matchtype_t mt = 0;
|
||||
int err;
|
||||
|
||||
dsl_dir_snap_cmtime_update(ds->ds_dir);
|
||||
|
||||
if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET)
|
||||
mt = MT_FIRST;
|
||||
else
|
||||
mt = MT_EXACT;
|
||||
mt = MT_NORMALIZE;
|
||||
|
||||
err = zap_remove_norm(mos, snapobj, name, mt, tx);
|
||||
if (err == ENOTSUP && mt == MT_FIRST)
|
||||
if (err == ENOTSUP && (mt & MT_NORMALIZE))
|
||||
err = zap_remove(mos, snapobj, name, tx);
|
||||
|
||||
if (err == 0 && adj_cnt)
|
||||
|
||||
Reference in New Issue
Block a user