filename normalization doesn't work for removes
We can create invisible file in ZFS.
How to reproduce:
0. Prepare normalization formD ZFS.
# cat cat /etc/release cat: cat: No such file or directory OpenIndiana Development oi_151 X86 (powered by illumos) Copyright 2011 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Assembled 28 April 2011 # mkfile 100M 100M # zpool create -O utf8only=on -O normalization=formD test_pool $( pwd )/100M # zpool upgrade This system is currently running ZFS pool version 28. All pools are formatted using this version. # zfs get normalization test_pool NAME PROPERTY VALUE SOURCE test_pool normalization formD - # chmod 777 /test_pool
1. Create a NFD file.
$ cd /test_pool/ $ cp /etc/release $( echo "\x75\xcc\x88" ) $ ls -la total 4 drwxrwxrwx 2 root root 3 2011-07-29 08:53 . drwxr-xr-x 25 root root 26 2011-07-29 08:53 .. -r--r--r-- 1 test1 staff 251 2011-07-29 08:53 u? $
2. Unlink NFC name of the file.
$ rm -fv $( echo "\xc3\xbc" ) removed `u'
3. The file is invisible but can be accessed with NFD name.
$ ls -la total 3 drwxrwxrwx 2 root root 2 2011-07-29 08:54 . drwxr-xr-x 25 root root 26 2011-07-29 08:53 .. $ $ cat $( echo "\x75\xcc\x88" ) OpenIndiana Development oi_151 X86 (powered by illumos) Copyright 2011 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Assembled 28 April 2011 $ stat $( echo "\x75\xcc\x88" ) File: `u?' Size: 251 Blocks: 2 IO Block: 512 regular file Device: 2d9000ah/47775754d Inode: 8 Links: 0 Access: (0444/-r--r--r--) Uid: ( 101/ test1) Gid: ( 10/ staff) Access: 2011-07-29 08:54:28.964231657 +0900 Modify: 2011-07-29 08:53:58.437886638 +0900 Change: 2011-07-29 08:53:58.437886638 +0900
nlink == 0. but we can open this file with NFD name.
sol11 ex 2010.11 has the same issue.
Updated by Kevin Crowe about 5 years ago
I've fixed a bunch of issues with case & normalization across the different fs case types (sensitive, insensitive, mixed) and normalization (enabled or not - I haven't run into bugs with the different normalization types like formD vs formC, etc) and my partner in crime Yuri has tests (see issue #6528) to check for create/modify/remove as well to go along with my changes.
I've got another small cleanup or two to do but I'm willing to contribute these upstream in the new year (Jan 2016.)
Updated by Electric Monk about 4 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 1c17160ac558f98048951327f4e9248d8f46acc0 Author: Kevin Crowe <firstname.lastname@example.org> Date: 2017-01-24T22:26:07.000Z 1300 filename normalization doesn't work for removes Reviewed by: Yuri Pankov <email@example.com> Reviewed by: Pavel Zakharov <firstname.lastname@example.org> Reviewed by: Matt Ahrens <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>