linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 196405] New: mkdir mishandles st_nlink in ext4 directory with 64997 subdirectories
@ 2017-07-17 21:23 bugzilla-daemon
  2017-07-18 19:41 ` [Bug 196405] " bugzilla-daemon
                   ` (26 more replies)
  0 siblings, 27 replies; 28+ messages in thread
From: bugzilla-daemon @ 2017-07-17 21:23 UTC (permalink / raw)
  To: linux-ext4

https://bugzilla.kernel.org/show_bug.cgi?id=196405

            Bug ID: 196405
           Summary: mkdir mishandles st_nlink in ext4 directory with 64997
                    subdirectories
           Product: File System
           Version: 2.5
    Kernel Version: 4.13-rc1
          Hardware: All
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: ext4
          Assignee: fs_ext4@kernel-bugs.osdl.org
          Reporter: eggert@cs.ucla.edu
        Regression: No

See the following shell transcript, run in an ext4 directory, for an
illustration of the bug. The first four commands set things up. The 5th command
'mkdir d/64998' calls 'mkdir("d/64998, 0777)' and succeeds. The 6th command
shows that d's resulting st_nlink value is 1, which is incorrect; it should be
65000. I discovered this bug in Fedora 26, which runs Linux 4.11.10; from
inspecting the source it appears the bug is still there in 4.13-rc1.

$ LC_ALL=C
$ export LC_ALL
$ mkdir d d/{1..64997}
$ strace -ve trace=%lstat ls -ld d
lstat("d", {st_dev=makedev(8, 2), st_ino=41565723, st_mode=S_IFDIR|0755,
st_nlink=64999, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=2744,
st_size=1404928, st_atime=1500319812 /* 2017-07-17T12:30:12.934815840-0700 */,
st_atime_nsec=934815840, st_mtime=1500319822 /*
2017-07-17T12:30:22.896866173-0700 */, st_mtime_nsec=896866173,
st_ctime=1500319822 /* 2017-07-17T12:30:22.896866173-0700 */,
st_ctime_nsec=896866173}) = 0
drwxr-xr-x. 64999 eggert eggert 1404928 Jul 17 12:30 d
+++ exited with 0 +++
$ mkdir d/64998
$ strace -ve trace=%lstat ls -ld d
lstat("d", {st_dev=makedev(8, 2), st_ino=41565723, st_mode=S_IFDIR|0755,
st_nlink=1, st_uid=1000, st_gid=1000, st_blksize=4096, st_blocks=2744,
st_size=1404928, st_atime=1500319812 /* 2017-07-17T12:30:12.934815840-0700 */,
st_atime_nsec=934815840, st_mtime=1500319845 /*
2017-07-17T12:30:45.104978381-0700 */, st_mtime_nsec=104978381,
st_ctime=1500319845 /* 2017-07-17T12:30:45.104978381-0700 */,
st_ctime_nsec=104978381}) = 0
drwxr-xr-x. 1 eggert eggert 1404928 Jul 17 12:30 d


This bug report follows up on the following downstream bug reports:

https://bugzilla.redhat.com/show_bug.cgi?id=1471967
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27739

-- 
You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-07-25  9:06 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-17 21:23 [Bug 196405] New: mkdir mishandles st_nlink in ext4 directory with 64997 subdirectories bugzilla-daemon
2017-07-18 19:41 ` [Bug 196405] " bugzilla-daemon
2017-07-18 21:07 ` bugzilla-daemon
2017-07-18 21:37 ` bugzilla-daemon
2017-07-18 21:54 ` bugzilla-daemon
2017-07-18 21:57 ` bugzilla-daemon
2017-07-18 22:19 ` bugzilla-daemon
2017-07-18 23:12 ` bugzilla-daemon
2017-07-18 23:15 ` bugzilla-daemon
2017-07-19  5:35 ` bugzilla-daemon
2017-07-19  8:02 ` bugzilla-daemon
2017-07-19 14:49 ` bugzilla-daemon
2017-07-19 19:44 ` bugzilla-daemon
2017-07-19 19:59 ` bugzilla-daemon
2017-07-19 22:22 ` bugzilla-daemon
2017-07-20  0:59 ` bugzilla-daemon
2017-07-21  7:48 ` bugzilla-daemon
2017-07-21  8:22 ` bugzilla-daemon
2017-07-21 15:25 ` bugzilla-daemon
2017-07-21 18:34 ` bugzilla-daemon
2017-07-21 21:14 ` bugzilla-daemon
2017-07-21 21:47 ` bugzilla-daemon
2017-07-22 14:41 ` bugzilla-daemon
2017-07-23 16:23 ` bugzilla-daemon
2017-07-23 22:55 ` bugzilla-daemon
2017-07-24 18:48 ` bugzilla-daemon
2017-07-25  8:56 ` bugzilla-daemon
2017-07-25  9:05 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).