From unknown Fri Sep 05 12:15:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#27739: Link counter of ls stops working at 65'000 hard links Resent-From: Christoph Michelbach Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 17 Jul 2017 19:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27739 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 27739@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15003184914221 (code B ref -1); Mon, 17 Jul 2017 19:09:02 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jul 2017 19:08:11 +0000 Received: from localhost ([127.0.0.1]:44811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBNK-000160-Ph for submit@debbugs.gnu.org; Mon, 17 Jul 2017 15:08:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBEN-0000rX-4K for submit@debbugs.gnu.org; Mon, 17 Jul 2017 14:58:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXBEH-00033w-0a for submit@debbugs.gnu.org; Mon, 17 Jul 2017 14:58:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXBEG-00033q-Sn for submit@debbugs.gnu.org; Mon, 17 Jul 2017 14:58:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXBEF-0001s8-LI for bug-coreutils@gnu.org; Mon, 17 Jul 2017 14:58:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXBEE-00032Q-Qs for bug-coreutils@gnu.org; Mon, 17 Jul 2017 14:58:47 -0400 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:33585) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXBEE-0002z0-LM for bug-coreutils@gnu.org; Mon, 17 Jul 2017 14:58:46 -0400 Received: by mail-wr0-x22c.google.com with SMTP id a10so16319129wrd.0 for ; Mon, 17 Jul 2017 11:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:mime-version :content-transfer-encoding; bh=a+I56qzWcYDtLoIjXq2GMDE6X1Zd4QtiAU9eIdxk6iQ=; b=ebGTl6ovSMB+MN7Op82YGyFiOj/E3ibCUAAHggAact9dIT8tCbi1YFcytV9myofrPn TlW+6ZJ2KUZmXVdtbQSDJGVhQZ0Sjlbvq2y8+uOT9hdvdBr1QdGNSrFDQmS//twZwz/x sIRAdRDZEj7p55wD7VvtKW/jBwkzQp60uypLBQj0Q4Z9L37mUSktkyPbAOmfllC3M7ta a5Syf6eNabNt14BUNbzcmz8khJCJhFRFhmBmp0Z9cMTCSgkhvY+zAtTKWuvew+Co6czI ey8OTSU85E6fGa5RG/Hmgf0kLB97xJFetPWPATRODcxp1a+6KNiQk7Aoc2hzvXZeH/NO 8h/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:mime-version :content-transfer-encoding; bh=a+I56qzWcYDtLoIjXq2GMDE6X1Zd4QtiAU9eIdxk6iQ=; b=QSlPVmkZhvZf9dLa9k83nB+85gZmEQTVFRKM3weFV/hMW4uvlkMQx2SUA/dOTNOV8J Cc13uXcxJW1D6q+Ps70p4PmtxnbyTT+Gz8q3+qJ1riTrwVynoHRa1zKYfIE//qQc6eJP GIqPw1jBqFGaY0k9Xb3gzfrlmK0B+GftaSb6Xr5Fle03ulwt834SHT2NvDkjp2E955Ne NFtLekjfaS0u6nEbwcO0+Ga1Kvq9Y9US5h7wzuIjH/jnpsjVVC2M7ByNzTjsUah1p33d UJwQyaUgpc6kTRrB1AEMjeCErkYWKzfguKEpszHKmN7bIdKwty4HglIrKPLNVN2s6UT1 fS4w== X-Gm-Message-State: AIVw1135hB+w5veuR7OoZFgfWFsin/kDCEturJGIIhASDMWLaKhC2ktD vXx+OCaMkj9BXucl X-Received: by 10.223.160.138 with SMTP id m10mr12264513wrm.142.1500317923526; Mon, 17 Jul 2017 11:58:43 -0700 (PDT) Received: from ?IPv6:2a02:8071:3185:fe00:a439:229:a4b3:f376? ([2a02:8071:3185:fe00:a439:229:a4b3:f376]) by smtp.googlemail.com with ESMTPSA id n2sm376643wmd.19.2017.07.17.11.58.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 11:58:42 -0700 (PDT) Message-ID: <1500317922.19288.15.camel@gmail.com> From: Christoph Michelbach Date: Mon, 17 Jul 2017 20:58:42 +0200 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Mailman-Approved-At: Mon, 17 Jul 2017 15:08:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 17 15:33:38 2017 Received: (at control) by debbugs.gnu.org; 17 Jul 2017 19:33:38 +0000 Received: from localhost ([127.0.0.1]:44826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBly-0001gp-FI for submit@debbugs.gnu.org; Mon, 17 Jul 2017 15:33:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBlw-0001gV-I2; Mon, 17 Jul 2017 15:33:37 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F5894E047; Mon, 17 Jul 2017 19:33:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7F5894E047 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eblake@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7F5894E047 Received: from [10.10.120.160] (ovpn-120-160.rdu2.redhat.com [10.10.120.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8C0B5D6A2; Mon, 17 Jul 2017 19:33:29 +0000 (UTC) Subject: Re: bug#27739: Link counter of ls stops working at 65'000 hard links To: Christoph Michelbach , 27739-done@debbugs.gnu.org References: <1500317922.19288.15.camel@gmail.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: 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 MIME-Version: 1.0 In-Reply-To: <1500317922.19288.15.camel@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mKMpWDHwH3BKxeP0eDr0EkmMRIfnjxL3n" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 17 Jul 2017 19:33:30 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mKMpWDHwH3BKxeP0eDr0EkmMRIfnjxL3n Content-Type: multipart/mixed; boundary="bWi8l3OASDLwaK2M0F0PXgnVnOinChJuN"; protected-headers="v1" From: Eric Blake To: Christoph Michelbach , 27739-done@debbugs.gnu.org Message-ID: Subject: Re: bug#27739: Link counter of ls stops working at 65'000 hard links References: <1500317922.19288.15.camel@gmail.com> In-Reply-To: <1500317922.19288.15.camel@gmail.com> --bWi8l3OASDLwaK2M0F0PXgnVnOinChJuN Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 linke= d 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 wei= rd > 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. >=20 > 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). --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --bWi8l3OASDLwaK2M0F0PXgnVnOinChJuN-- --mKMpWDHwH3BKxeP0eDr0EkmMRIfnjxL3n Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlltEQkACgkQp6FrSiUn Q2p5BQf+MoJVAEjQBc5UsL+Q8jQ/MNAPg4ZoexUkJMH/oC8jQ2r3byeEvjbpyhbS YMvS3btgI+9we/CJbXg7EctpK6I9bMACux3P+VVidwwatzfASZc4Vaj3CowJQgYP Ufn3p2AiszA5OBRnTFHNmzyaR0yTTegmazOs0F1tE1cGoRoZu9+FT346aTOxJIHB G56LGH/xoYK9+/fdDGS48nva9ti1IPXVtX8AqsLDGQeIdNFuT/Lc1FyU4VLg3l8L 6JcJKeqiOdkslipwZyaMaAu+TP/rCIEttaXnx53gLGWanfWA2FSty0xlR4HRWHtP NsuPPrqe38moYmr2hCRXXq4Qh50ZCw== =ZVnP -----END PGP SIGNATURE----- --mKMpWDHwH3BKxeP0eDr0EkmMRIfnjxL3n-- From unknown Fri Sep 05 12:15:50 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Christoph Michelbach Subject: bug#27739: closed (Re: bug#27739: Link counter of ls stops working at 65'000 hard links) Message-ID: References: <1500317922.19288.15.camel@gmail.com> X-Gnu-PR-Message: they-closed 27739 X-Gnu-PR-Package: coreutils X-Gnu-PR-Keywords: notabug Reply-To: 27739@debbugs.gnu.org Date: Mon, 17 Jul 2017 19:34:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1500320043-6545-1" This is a multi-part message in MIME format... ------------=_1500320043-6545-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #27739: Link counter of ls stops working at 65'000 hard links which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 27739@debbugs.gnu.org. --=20 27739: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D27739 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1500320043-6545-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 27739-done) by debbugs.gnu.org; 17 Jul 2017 19:33:38 +0000 Received: from localhost ([127.0.0.1]:44824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBly-0001gm-77 for submit@debbugs.gnu.org; Mon, 17 Jul 2017 15:33:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60502) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBlw-0001gV-I2; Mon, 17 Jul 2017 15:33:37 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7F5894E047; Mon, 17 Jul 2017 19:33:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7F5894E047 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eblake@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7F5894E047 Received: from [10.10.120.160] (ovpn-120-160.rdu2.redhat.com [10.10.120.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8C0B5D6A2; Mon, 17 Jul 2017 19:33:29 +0000 (UTC) Subject: Re: bug#27739: Link counter of ls stops working at 65'000 hard links To: Christoph Michelbach , 27739-done@debbugs.gnu.org References: <1500317922.19288.15.camel@gmail.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: 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 MIME-Version: 1.0 In-Reply-To: <1500317922.19288.15.camel@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mKMpWDHwH3BKxeP0eDr0EkmMRIfnjxL3n" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 17 Jul 2017 19:33:30 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27739-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --mKMpWDHwH3BKxeP0eDr0EkmMRIfnjxL3n Content-Type: multipart/mixed; boundary="bWi8l3OASDLwaK2M0F0PXgnVnOinChJuN"; protected-headers="v1" From: Eric Blake To: Christoph Michelbach , 27739-done@debbugs.gnu.org Message-ID: Subject: Re: bug#27739: Link counter of ls stops working at 65'000 hard links References: <1500317922.19288.15.camel@gmail.com> In-Reply-To: <1500317922.19288.15.camel@gmail.com> --bWi8l3OASDLwaK2M0F0PXgnVnOinChJuN Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 linke= d 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 wei= rd > 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. >=20 > 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). --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --bWi8l3OASDLwaK2M0F0PXgnVnOinChJuN-- --mKMpWDHwH3BKxeP0eDr0EkmMRIfnjxL3n Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAlltEQkACgkQp6FrSiUn Q2p5BQf+MoJVAEjQBc5UsL+Q8jQ/MNAPg4ZoexUkJMH/oC8jQ2r3byeEvjbpyhbS YMvS3btgI+9we/CJbXg7EctpK6I9bMACux3P+VVidwwatzfASZc4Vaj3CowJQgYP Ufn3p2AiszA5OBRnTFHNmzyaR0yTTegmazOs0F1tE1cGoRoZu9+FT346aTOxJIHB G56LGH/xoYK9+/fdDGS48nva9ti1IPXVtX8AqsLDGQeIdNFuT/Lc1FyU4VLg3l8L 6JcJKeqiOdkslipwZyaMaAu+TP/rCIEttaXnx53gLGWanfWA2FSty0xlR4HRWHtP NsuPPrqe38moYmr2hCRXXq4Qh50ZCw== =ZVnP -----END PGP SIGNATURE----- --mKMpWDHwH3BKxeP0eDr0EkmMRIfnjxL3n-- ------------=_1500320043-6545-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Jul 2017 19:08:11 +0000 Received: from localhost ([127.0.0.1]:44811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBNK-000160-Ph for submit@debbugs.gnu.org; Mon, 17 Jul 2017 15:08:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBEN-0000rX-4K for submit@debbugs.gnu.org; Mon, 17 Jul 2017 14:58:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXBEH-00033w-0a for submit@debbugs.gnu.org; Mon, 17 Jul 2017 14:58:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59314) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXBEG-00033q-Sn for submit@debbugs.gnu.org; Mon, 17 Jul 2017 14:58:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXBEF-0001s8-LI for bug-coreutils@gnu.org; Mon, 17 Jul 2017 14:58:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXBEE-00032Q-Qs for bug-coreutils@gnu.org; Mon, 17 Jul 2017 14:58:47 -0400 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]:33585) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dXBEE-0002z0-LM for bug-coreutils@gnu.org; Mon, 17 Jul 2017 14:58:46 -0400 Received: by mail-wr0-x22c.google.com with SMTP id a10so16319129wrd.0 for ; Mon, 17 Jul 2017 11:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:mime-version :content-transfer-encoding; bh=a+I56qzWcYDtLoIjXq2GMDE6X1Zd4QtiAU9eIdxk6iQ=; b=ebGTl6ovSMB+MN7Op82YGyFiOj/E3ibCUAAHggAact9dIT8tCbi1YFcytV9myofrPn TlW+6ZJ2KUZmXVdtbQSDJGVhQZ0Sjlbvq2y8+uOT9hdvdBr1QdGNSrFDQmS//twZwz/x sIRAdRDZEj7p55wD7VvtKW/jBwkzQp60uypLBQj0Q4Z9L37mUSktkyPbAOmfllC3M7ta a5Syf6eNabNt14BUNbzcmz8khJCJhFRFhmBmp0Z9cMTCSgkhvY+zAtTKWuvew+Co6czI ey8OTSU85E6fGa5RG/Hmgf0kLB97xJFetPWPATRODcxp1a+6KNiQk7Aoc2hzvXZeH/NO 8h/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:mime-version :content-transfer-encoding; bh=a+I56qzWcYDtLoIjXq2GMDE6X1Zd4QtiAU9eIdxk6iQ=; b=QSlPVmkZhvZf9dLa9k83nB+85gZmEQTVFRKM3weFV/hMW4uvlkMQx2SUA/dOTNOV8J Cc13uXcxJW1D6q+Ps70p4PmtxnbyTT+Gz8q3+qJ1riTrwVynoHRa1zKYfIE//qQc6eJP GIqPw1jBqFGaY0k9Xb3gzfrlmK0B+GftaSb6Xr5Fle03ulwt834SHT2NvDkjp2E955Ne NFtLekjfaS0u6nEbwcO0+Ga1Kvq9Y9US5h7wzuIjH/jnpsjVVC2M7ByNzTjsUah1p33d UJwQyaUgpc6kTRrB1AEMjeCErkYWKzfguKEpszHKmN7bIdKwty4HglIrKPLNVN2s6UT1 fS4w== X-Gm-Message-State: AIVw1135hB+w5veuR7OoZFgfWFsin/kDCEturJGIIhASDMWLaKhC2ktD vXx+OCaMkj9BXucl X-Received: by 10.223.160.138 with SMTP id m10mr12264513wrm.142.1500317923526; Mon, 17 Jul 2017 11:58:43 -0700 (PDT) Received: from ?IPv6:2a02:8071:3185:fe00:a439:229:a4b3:f376? ([2a02:8071:3185:fe00:a439:229:a4b3:f376]) by smtp.googlemail.com with ESMTPSA id n2sm376643wmd.19.2017.07.17.11.58.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Jul 2017 11:58:42 -0700 (PDT) Message-ID: <1500317922.19288.15.camel@gmail.com> Subject: Link counter of ls stops working at 65'000 hard links From: Christoph Michelbach To: bug-coreutils@gnu.org Date: Mon, 17 Jul 2017 20:58:42 +0200 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 17 Jul 2017 15:08:09 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) 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 ------------=_1500320043-6545-1-- From unknown Fri Sep 05 12:15:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#27739: Link counter of ls stops working at 65'000 hard links Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 17 Jul 2017 19:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27739 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: 27739@debbugs.gnu.org, eblake@redhat.com, michelbach94@gmail.com Received: via spool by 27739-submit@debbugs.gnu.org id=B27739.15003205577315 (code B ref 27739); Mon, 17 Jul 2017 19:43:02 +0000 Received: (at 27739) by debbugs.gnu.org; 17 Jul 2017 19:42:37 +0000 Received: from localhost ([127.0.0.1]:44837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBuf-0001tv-Eb for submit@debbugs.gnu.org; Mon, 17 Jul 2017 15:42:37 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:60598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXBud-0001ti-QD for 27739@debbugs.gnu.org; Mon, 17 Jul 2017 15:42:36 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A6903160193; Mon, 17 Jul 2017 12:42:29 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ggrH6pWZs9fY; Mon, 17 Jul 2017 12:42:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id AFA88160223; Mon, 17 Jul 2017 12:42:28 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZyrH6eAIh1g4; Mon, 17 Jul 2017 12:42:28 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 95824160193; Mon, 17 Jul 2017 12:42:28 -0700 (PDT) References: <1500317922.19288.15.camel@gmail.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <2d9e34dd-3766-3e87-f260-1acfe729ca46@cs.ucla.edu> Date: Mon, 17 Jul 2017 12:42:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 07/17/2017 12:33 PM, Eric Blake wrote: > feel free to reply > further with any results you get after reporting this to the right > kernel folks. I reproduced the bug on Fedora 26 x86-64, and filed a bug report here: https://bugzilla.redhat.com/show_bug.cgi?id=1471967