summaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_vnops.c
diff options
context:
space:
mode:
authorGeorge Melikov <[email protected]>2017-02-03 01:13:41 +0300
committerBrian Behlendorf <[email protected]>2017-02-02 14:13:41 -0800
commit9b7b9cd370ed2ec4c8ee346bcb95cb30ba7e9ba9 (patch)
tree54fc7c65aefc2e3457aafb789794dab0f2f9a753 /module/zfs/zfs_vnops.c
parent96f1b347f8f726163c105704576110a4a8be4b84 (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/zfs_vnops.c')
-rw-r--r--module/zfs/zfs_vnops.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index 7344c9a80..b55445e0a 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -18,11 +18,12 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 by Delphix. All rights reserved.
- * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2015 by Chunwei Chen. All rights reserved.
+ * Copyright 2017 Nexenta Systems, Inc.
*/
/* Portions Copyright 2007 Jeremy Teo */
@@ -1157,7 +1158,15 @@ zfs_lookup(struct inode *dip, char *nm, struct inode **ipp, int flags,
zfs_sb_t *zsb = ITOZSB(dip);
int error = 0;
- /* fast path */
+ /*
+ * Fast path lookup, however we must skip DNLC lookup
+ * for case folding or normalizing lookups because the
+ * DNLC code only stores the passed in name. This means
+ * creating 'a' and removing 'A' on a case insensitive
+ * file system would work, but DNLC still thinks 'a'
+ * exists and won't let you create it again on the next
+ * pass through fast path.
+ */
if (!(flags & (LOOKUP_XATTR | FIGNORECASE))) {
if (!S_ISDIR(dip->i_mode)) {
@@ -1175,7 +1184,9 @@ zfs_lookup(struct inode *dip, char *nm, struct inode **ipp, int flags,
}
return (error);
#ifdef HAVE_DNLC
- } else {
+ } else if (!zdp->z_zfsvfs->z_norm &&
+ (zdp->z_zfsvfs->z_case == ZFS_CASE_SENSITIVE)) {
+
vnode_t *tvp = dnlc_lookup(dvp, nm);
if (tvp) {