Bug#1057295: bcachefs-tools: breaks "mount" if the package is installed

2023-12-27 Thread Jonathan Carter

Hi

On 2023/12/02 22:22, Adam Borowski wrote:

A simple workaround would be to just drop the /sbin/mount.bcachefs symlink
until rust pieces are back.  But alas, I see that the helper is needed for


I've now done so, and uploaded it to experimental. At least on my 
system, things seem to work fine after a reboot once this package is 
installed.


-Jonathan



Bug#1057295: bcachefs-tools: breaks "mount" if the package is installed

2023-12-18 Thread Martin Steigerwald
Hi Jonathan, hi Adam!

Confirmed.

Moving "mount.bcachefs" out of the way fixes mounting via "fstab" and 
"mount" command. It also makes mounting work on boot with Devuan with 
Runit as init.

Help output of "bcachefs" command from self-compiled bcachefs-tools 1.3.3 
shows:

Mount:
  mountMount a filesystem

This is missing from the help output of "bcachefs" command, version 1.3.4, 
from the package.

Best,
-- 
Martin



Bug#1057295: bcachefs-tools: breaks "mount" if the package is installed

2023-12-02 Thread Adam Borowski
Package: bcachefs-tools
Version: 24+really1.3.4-1
Severity: important

If bcachefs-tools is installed, "mount" fails to mount any bcachefs
filesystems, saying:

.
Unknown command /dev/nvme0n1p2
bcachefs - tool for managing bcachefs filesystems
usage: bcachefs  []

Superblock commands:
  format   Format a new filesystem
  show-super   Dump superblock information to stdout
  set-option   Set a filesystem option
[... (eleventy lines of help snipped)]
`

Conversely, if the package is _not_ installed, everything goes fine.
Stracing "mount", I see that it tries to run /sbin/mount.bcachefs (which
is symlinked to "bcachefs") if it exists.

The culprit is:
.--[ bcachefs.c ]
#ifndef BCACHEFS_NO_RUST
if (strstr(full_cmd, "mount"))
return cmd_mount(argc, argv);
#endif

...

#ifndef BCACHEFS_NO_RUST
if (!strcmp(cmd, "mount"))
return cmd_mount(argc, argv);
if (strstr(cmd, "completions"))
return cmd_completions(argc, argv);
#endif
`

Ie, the "mount" subcommand (both invoked explicitly and via argv[0]) is not
compiled in our current package.  It's not actually needed for basic operation
(the default logic in /sbin/mount is good enough), but if the helper exists,
"mount" will abort if it the helper fails.

I found it puzzling that no one reported this, quite fatal, bug in two weeks
since your upload (I for one have been away from this machine for a while).
However, it turns out systemd does not use this helper but reinvents it
(expect incompatible ways of handling options, but I digress).  This means,
out of 21 popcon votes, most folks had boot-time mount succeed, while only
manual mount would fail.

In other words:
 ✓ boot-time via systemd
 ✗ boot-time via initscripts
 ✗ manual via "mount"

A simple workaround would be to just drop the /sbin/mount.bcachefs symlink
until rust pieces are back.  But alas, I see that the helper is needed for
handling UUID= stanzas.  A typical person would say /dev/nvme0n1p2 while
d-i prefers PARTUUID= thus that'd _usually_ work... but still not ideal.

On the other hand, at least UUID= has never worked for bcachefs on Debian,
thus at least that part is no regression.


Meow!
-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (666, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
merged-usr: no
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.6.0-rc5-mithlond-02787-gf0f2365d02d9 (SMP w/4 CPU threads; 
PREEMPT)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages bcachefs-tools depends on:
ii  libaio1   0.3.113-5
ii  libblkid1 2.39.2-6
ii  libc6 2.37-12
ii  libkeyutils1  1.6.3-2
ii  liblz4-1  1.9.4-1
ii  libsodium23   1.0.18-1
ii  liburcu8  0.14.0-2
ii  libuuid1  2.39.2-6
ii  libzstd1  1.5.5+dfsg2-2
ii  zlib1g1:1.2.13.dfsg-3

Versions of packages bcachefs-tools recommends:
ii  initramfs-tools [linux-initramfs-tool]  0.142

bcachefs-tools suggests no packages.

-- no debconf information