Project

General

Profile

Bug #1300

filename normalization doesn't work for removes

Added by Ichiko Sakamoto over 9 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2011-07-29
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Problem:
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.
http://www.opensolaris.org/jive/thread.jspa?messageID=521695

Also available in: Atom PDF