emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#27739: closed (Link counter of ls stops working at


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#27739: closed (Link counter of ls stops working at 65'000 hard links)
Date: Mon, 17 Jul 2017 19:34:02 +0000

Your message dated Mon, 17 Jul 2017 14:33:28 -0500
with message-id <address@hidden>
and subject line Re: bug#27739: Link counter of ls stops working at 65'000 hard 
links
has caused the debbugs.gnu.org bug report #27739,
regarding Link counter of ls stops working at 65'000 hard links
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
27739: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27739
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Link counter of ls stops working at 65'000 hard links Date: Mon, 17 Jul 2017 20:58:42 +0200
The link counter of ls stops working if a directory exceeds being linked to
64'999 times.

You can replicate this by first creating a folder on an ext4 file system

    $ mkdir deleteMe

and then filling it with 64'997 additional directories.

    $ mkdir deleteMe/{1..64997}

At this point, ls still reports the correct number of hard links:

    $ ls -l
    total 1376
    drwxrwxr-x 64999 christoph christoph 1404928 Jul 17 20:46 deleteMe

But after creating another folder

    $ mkdir deleteMe/64998

, ll reports only 1 hard link to `deleteMe`:

    $ ls -l
    total 1376
    drwxrwxr-x 1 christoph christoph 1404928 Jul 17 20:46 deleteMe

Even after the latest hard link is removed, ls still reports only 1 hard link:

    $ rm -R deleteMe/64998
    $ ls -l
    total 1376
    drwxrwxr-x 1 christoph christoph 1404928 Jul 17 20:49 deleteMe

I neither understand why this happens, nor why it happens at such a weird
number. It would be obvious that there is a 16 bit counter running out of values
if it stopped working at at or after 65'535, but it stopping to work at 65'000
hard links seems weird.

I tested this on a 64 bit system running Linux 4.4.0-83 and on a 32 bit system
running Linux 4.1.18 with the exact same result.

-- 
Christoph Michelbach <address@hidden>




--- End Message ---
--- Begin Message --- Subject: Re: bug#27739: Link counter of ls stops working at 65'000 hard links Date: Mon, 17 Jul 2017 14:33:28 -0500 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
tag 27739 notabug
thanks

On 07/17/2017 01:58 PM, Christoph Michelbach wrote:
> The link counter of ls stops working if a directory exceeds being linked to
> 64'999 times.

ls is just reporting the value returned by stat() from the kernel; this
sounds like a kernel (or filesystem) bug.  To double-check, you should
also be able to use the stat(1) utility (instead of ls) to show the same
results.

Since we can't address it in userspace, I'm marking this as notabug from
the perspective of the coreutils database, but please feel free to reply
further with any results you get after reporting this to the right
kernel folks.

> I neither understand why this happens, nor why it happens at such a weird
> number. It would be obvious that there is a 16 bit counter running out of 
> values
> if it stopped working at at or after 65'535, but it stopping to work at 65'000
> hard links seems weird.

Not the first time the kernel has done something weird.

> 
> I tested this on a 64 bit system running Linux 4.4.0-83 and on a 32 bit system
> running Linux 4.1.18 with the exact same result.

Your filesystem may also matter (not all filesystems are created equal).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]