[Nix-dev] [PATCH] Remove st_nlink optimisation from lndir

David Brown nix at davidb.org
Thu Jun 3 03:05:26 CEST 2010


lndir uses an old optimization to try and avoid statting leaf
directories.  Aside from being fairly pointless on modern machines, it
breaks on some modern filesystems, such as btrfs, which have opted to
already set nlink to 1 on directores, rather than limiting the number
of possible subdirectories available.  This breaks on any filesystem
when there are more than 32768 subdirs in one directory.
---
 pkgs/servers/x11/xorg/overrides.nix |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index e8a311a..1582fc4 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -153,4 +153,11 @@ in
     configureFlags = "LIBUUID_CFLAGS='' LIBUUID_LIBS=''";
   };
 
+  lndir = attrs: attrs // {
+    preConfigure = ''
+      substituteInPlace lndir.c \
+        --replace 'n_dirs--;' ""
+    '';
+  };
+
 }
-- 
1.7.1




More information about the nix-dev mailing list