checkout: Don't hardlink zero sized files
authorColin Walters <walters@verbum.org>
Wed, 16 Sep 2020 00:35:33 +0000 (00:35 +0000)
committerColin Walters <walters@verbum.org>
Thu, 1 Oct 2020 20:47:07 +0000 (16:47 -0400)
commit558720e7aa1870cbbdb4a0dc22a3968d116daec3
treef828c8577cc293bec520fedfca80e43f5e16dcef
parent6950a98099927d0d2b52719fbfb4fe73842400aa
checkout: Don't hardlink zero sized files

Alternative to https://github.com/ostreedev/ostree/pull/2197

Python's (usually) zero-sized `__init__.py` files can provoke
us hitting the hardlink limits on some filesystems (`EMLINK`).
At least one Fedora rpm-ostree user hit this.

The benefits of hardlinking here are quite marginal; lots
of hardlinks can behave suboptimally in particular filesystems
like BTRFS too.

This builds on prior code which made this an option, introduced
in https://github.com/ostreedev/ostree/commit/673cacd633f9d6b653cdea530657d3e780a41bbd
Now we just do it uncondtionally.

Also this provoked a different bug in a very obscure user mode checkout
case; when the "real" permissions were different from the "physical"
permissions, we would still hardlink.  Fix the test case for this.
man/ostree-checkout.xml
src/libostree/ostree-repo-checkout.c
src/ostree/ot-builtin-checkout.c
tests/basic-test.sh
tests/test-libarchive.sh