Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-2561

Newly created file is same size as directory

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • Lustre 2.4.0
    • None
    • Lustre 2.3.54-2chaos, 2.3.57-2chaos. (github.com/chaos/lustre) ZFS OSTs.
    • 3
    • 5987

    Description

      We have a subdirectory where any newly created files, e.g. "touch newfile", is created with a file size that matches the size of the directory, as listed in "ls -la .".

      I'm not sure yet what is specially about this directory. I can't reproduce the problem in directories that I just "mkdir" myself.

      However, if "cp -a" the problem subdirectory somewhere else in the filesystem, I AM able to then recreate the problem there. In the original problem directory, the directory size is 10720, and any newly created file is 10720 in size. In one copy that I made, the directory size is 9728 bytes, and any newly created files are 9728 bytes.

      Very strange. I'm not yet sure what is special about the directory contents that makes it able to trigger this bug.

      I am able to read the files, and they just contain zeroes.

      Attachments

        Issue Links

          Activity

            [LU-2561] Newly created file is same size as directory

            Patch 4956 landed on master. Ticket can be closed.

            morrone Christopher Morrone (Inactive) added a comment - Patch 4956 landed on master. Ticket can be closed.

            Patch works for us. Just needs landing at this point. Removing "topsequoia" label.

            morrone Christopher Morrone (Inactive) added a comment - Patch works for us. Just needs landing at this point. Removing "topsequoia" label.
            laisiyao Lai Siyao added a comment - Patch is on http://review.whamcloud.com/#change,4956
            laisiyao Lai Siyao added a comment -

            The cause is that mdd_declare_create() mistakenly declare attr set on child when default acl exists for parent, instead this should be done for parent and when child is directory only.

            I'll commit a fix later.

            laisiyao Lai Siyao added a comment - The cause is that mdd_declare_create() mistakenly declare attr set on child when default acl exists for parent, instead this should be done for parent and when child is directory only. I'll commit a fix later.

            I verified that this occurs with both ldiskfs and ZFS backends.

            nedbass Ned Bass (Inactive) added a comment - I verified that this occurs with both ldiskfs and ZFS backends.
            pjones Peter Jones added a comment -

            Lai

            Could you please look into this one?

            Thanks

            Peter

            pjones Peter Jones added a comment - Lai Could you please look into this one? Thanks Peter

            Ned Bass came through with a reproducer!

            Found a reproducer.  Seems to be related to having a system.posix_acl_default xattr.
            
            # grove530 /p/lstest/bass6 > mkdir test
            # grove530 /p/lstest/bass6 > cd test
            # grove530 /p/lstest/bass6/test > getfacl --access . | setfacl -d -M- .
            # grove530 /p/lstest/bass6/test > touch x
            # grove530 /p/lstest/bass6/test > ls -al
            total 12
            drwx------+ 2 root  root  5632 Jan  2 17:32 .
            drwx------+ 3 bass6 bass6 5632 Jan  2 17:32 ..
            -rw-------  1 root  root  5632 Jan  2 17:32 x
            # grove530 /p/lstest/bass6/test > getfattr -d -m. .
            # file: .
            system.posix_acl_default=0sAgAAAAEABwD/////BAAAAP////8gAAAA/////w==
            [cut]
            
            morrone Christopher Morrone (Inactive) added a comment - Ned Bass came through with a reproducer! Found a reproducer. Seems to be related to having a system.posix_acl_default xattr. # grove530 /p/lstest/bass6 > mkdir test # grove530 /p/lstest/bass6 > cd test # grove530 /p/lstest/bass6/test > getfacl --access . | setfacl -d -M- . # grove530 /p/lstest/bass6/test > touch x # grove530 /p/lstest/bass6/test > ls -al total 12 drwx------+ 2 root root 5632 Jan 2 17:32 . drwx------+ 3 bass6 bass6 5632 Jan 2 17:32 .. -rw------- 1 root root 5632 Jan 2 17:32 x # grove530 /p/lstest/bass6/test > getfattr -d -m. . # file: . system.posix_acl_default=0sAgAAAAEABwD/////BAAAAP////8gAAAA/////w== [cut]

            People

              laisiyao Lai Siyao
              morrone Christopher Morrone (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: