]> git.sesse.net Git - bcachefs-tools-debian/log
bcachefs-tools-debian
4 months agoUpdate bcachefs sources to 72740a707b64 bcachefs: Split brain detection
Kent Overstreet [Sat, 23 Dec 2023 02:39:45 +0000 (21:39 -0500)]
Update bcachefs sources to 72740a707b64 bcachefs: Split brain detection

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agocmd_fsck can now take colon separated devices
Kent Overstreet [Sat, 23 Dec 2023 02:29:36 +0000 (21:29 -0500)]
cmd_fsck can now take colon separated devices

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agoUpdate bcachefs sources to c6d45169c6 bcachefs: Convert split_devs() to darray
Kent Overstreet [Sat, 23 Dec 2023 02:21:14 +0000 (21:21 -0500)]
Update bcachefs sources to c6d45169c6 bcachefs: Convert split_devs() to darray

4 months agoMerge pull request #194 from intelfx/work/makefile-nonrecursive
koverstreet [Fri, 22 Dec 2023 09:49:58 +0000 (04:49 -0500)]
Merge pull request #194 from intelfx/work/makefile-nonrecursive

Makefile: do not recursively expand flags (speed up parallel builds considerably)

4 months agoMakefile: avoid recursively expanding expensive variables
Ivan Shapovalov [Fri, 22 Dec 2023 06:51:17 +0000 (09:51 +0300)]
Makefile: avoid recursively expanding expensive variables

Specifically, do not recursively expand $(CFLAGS) because this leads to
repeatedly performing compile tests (e. g. cc-disable-warning) on every
recipe execution.

Without (nproc=32):
```
$ time env -i PATH=/usr/bin BCACHEFS_FUSE=1 NO_RUST=1 make -j$(nproc)
<...>
    [LD]     bcachefs
  72,48s user 11,29s system 190% cpu 44,036 total
```

With:
```
$ time env -i PATH=/usr/bin BCACHEFS_FUSE=1 NO_RUST=1 make -j$(nproc)
<...>
    [LD]     bcachefs
  66,79s user 5,17s system 1955% cpu 3,679 total
```

4 months agoSilence a few rust build warnings
Kent Overstreet [Fri, 22 Dec 2023 00:49:55 +0000 (19:49 -0500)]
Silence a few rust build warnings

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agoUpdate bcachefs sources to df6415fefb27 bcachefs: Fixes for rust bindgen
Kent Overstreet [Fri, 22 Dec 2023 00:49:00 +0000 (19:49 -0500)]
Update bcachefs sources to df6415fefb27 bcachefs: Fixes for rust bindgen

4 months agoUpdate bcachefs sources to 5d0a6c2b32f1 bcachefs: check_directory_structure() can...
Kent Overstreet [Fri, 22 Dec 2023 00:10:40 +0000 (19:10 -0500)]
Update bcachefs sources to 5d0a6c2b32f1 bcachefs: check_directory_structure() can now be run online

4 months agoremove Rust artifacts during `make clean`
Thomas Bertschinger [Wed, 20 Dec 2023 22:02:28 +0000 (15:02 -0700)]
remove Rust artifacts during `make clean`

This should use `cargo clean` instead of `rm -rf ...`. Also,
due to a typo, the `rm` did not actually remove the Rust artifacts.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agocmd_list_journal: fix check to print entry header
Kent Overstreet [Wed, 20 Dec 2023 02:28:43 +0000 (21:28 -0500)]
cmd_list_journal: fix check to print entry header

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agocmd_migrate: don't link data above i_size
Kent Overstreet [Wed, 20 Dec 2023 01:35:20 +0000 (20:35 -0500)]
cmd_migrate: don't link data above i_size

The new filesystem might have a smaller blocksize than the old
blocksize, which trips this.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agodocs: add llvm-config dependency for arch, fedora
Thomas Bertschinger [Tue, 19 Dec 2023 23:38:47 +0000 (16:38 -0700)]
docs: add llvm-config dependency for arch, fedora

This adds on to 446ec6b092cc ("docs: mention that libclang is
required"). That commit updated the dependency list for Debian. This
adds the packages needed to get llvm-config for arch and fedora.

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agocmd_migrate: fix memory leaks
Kent Overstreet [Wed, 20 Dec 2023 00:43:30 +0000 (19:43 -0500)]
cmd_migrate: fix memory leaks

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agomake allocator helpers inlines
Kent Overstreet [Wed, 20 Dec 2023 00:30:13 +0000 (19:30 -0500)]
make allocator helpers inlines

this gets us better log messages when using -fsanitize=address

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agocmd_migrate: check for write errors
Kent Overstreet [Wed, 20 Dec 2023 00:30:00 +0000 (19:30 -0500)]
cmd_migrate: check for write errors

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agofix shrinker_free()
Kent Overstreet [Wed, 20 Dec 2023 00:29:25 +0000 (19:29 -0500)]
fix shrinker_free()

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agocmd_migrate: fix write_data()
Kent Overstreet [Wed, 20 Dec 2023 00:17:19 +0000 (19:17 -0500)]
cmd_migrate: fix write_data()

passing a parent closure is totally unnecessary when using
BCH_WRITE_SYNC - and pops an assert in debug mode, because the write
path no longer supports delivering completions that way.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agov1.3.6
Kent Overstreet [Tue, 19 Dec 2023 04:29:06 +0000 (23:29 -0500)]
v1.3.6

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agoDrop mlockall()
Kent Overstreet [Tue, 19 Dec 2023 04:21:43 +0000 (23:21 -0500)]
Drop mlockall()

now that we have
 - shrinkers running in the background via a thread
 - run_shrinkers() considering swap usage

this can probably be safely dropped - and it causes problems when
running as non root, so let's do so.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agoUpdate bcachefs sources to 1a739db0b256 bcachefs; guard against overflow in btree...
Kent Overstreet [Sun, 17 Dec 2023 20:42:17 +0000 (15:42 -0500)]
Update bcachefs sources to 1a739db0b256 bcachefs; guard against overflow in btree node split

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agocmd_dump: fix error message
Kent Overstreet [Sun, 17 Dec 2023 20:42:38 +0000 (15:42 -0500)]
cmd_dump: fix error message

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agoFix makefile when building without systemd
Kent Overstreet [Sat, 16 Dec 2023 23:42:22 +0000 (18:42 -0500)]
Fix makefile when building without systemd

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agoUpdate bcachefs sources to 841a95c29f4c bcachefs: fix userspace build errors
Kent Overstreet [Sat, 16 Dec 2023 02:57:44 +0000 (21:57 -0500)]
Update bcachefs sources to 841a95c29f4c bcachefs: fix userspace build errors

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agofix packaging
Alexander Fougner [Sat, 9 Dec 2023 11:20:04 +0000 (12:20 +0100)]
fix packaging

- make deb fails with dh: error: Unknown sequence --with
  (options should not come before the sequence)

- fix deb build deps

- add missing rpm files

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agobcachefs-tools: Fix typo in 872cd43
Chris Webb [Sun, 10 Dec 2023 07:28:31 +0000 (07:28 +0000)]
bcachefs-tools: Fix typo in 872cd43

6% of physical RAM is info.totalram >> 4 not info.totalram << 4.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agobcachefs-tools: Disable -Wgnu-variable-sized-type-not-at-end for clang
Chris Webb [Sat, 9 Dec 2023 14:31:40 +0000 (14:31 +0000)]
bcachefs-tools: Disable -Wgnu-variable-sized-type-not-at-end for clang

clang's default warnings include -Wgnu-variable-sized-type-not-at-end,
producing a lot of false alarms about the GNU extension for libbcachefs.
Disable these using cc-disable-warning when building with clang.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agobcachefs-tools: Guard the __struct_group() #define in kernel.h
Chris Webb [Sat, 9 Dec 2023 14:15:08 +0000 (14:15 +0000)]
bcachefs-tools: Guard the __struct_group() #define in kernel.h

Our include/linux/byteorder.h uses the system <asm/byteorder.h>
because we don't provide our own in include/asm. This then pulls in
system <linux/stddef.h> which defines __struct_group. That definition
collides with the unconditional #define __struct_group in our local
include/linux/kernel.h, provoking preprocessor warnings.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agobcachefs-tools: Avoid glibc-specific mallinfo() in shrinker
Chris Webb [Sat, 9 Dec 2023 12:50:31 +0000 (12:50 +0000)]
bcachefs-tools: Avoid glibc-specific mallinfo() in shrinker

Before 326d7c1, the shrinker used freeram and totalram from a struct
sysinfo (constructed from /proc/meminfo) to target 25% free physical
memory. As well as the slowness of repeatedly reading /proc/meminfo,
this was a problem as freeram rises when the system starts to swap.
We don't want swapping to reduce our estimate of memory pressure.

To work around this, in 326d7c1 the shrinker started to use the total
allocated heap from a glibc-specific interface mallinfo2(), aiming to
shrink such that our heap is less than 80% of physical memory, unless
overall free memory is less than 6% so that becomes the determining factor.

Unfortunately, a sign error in the calculation means this heuristic
never worked. It would shrink aggressively when the process was small,
and not at all when the process grew beyond 80% of physical RAM. Only the
fallback test ensuring the free physical RAM doesn't fall below 6% would
actually kick in under memory pressure. It also breaks portability to
anything other than recent glibc.

Later, in 2440469 the mallinfo2() was replaced with the older mallinfo()
to improve compatibility with older glibc. This is even more problematic:
it's still not portable but also struct mallinfo has (signed) int fields
which overflow for large processes on 32-bit machines with a 3G/1G split.

Rather than trying to use libc-specific debug interfaces and our own heap
to inform the shrinker, use the information about free and total swap
we already have from sysinfo(2) to explicitly compensate for swapping
in our estimate of free physical memory. Target free memory of 6% of
physical RAM adjusted for zero swap use when calculating the pressure
on the shrinker, based on the effective behaviour of 326d7c1 in practice
given the sign error.

As well as fixing portability to non-glibc systems, this loosens the
assumption that we are the only process using significant memory when
setting the shrinker target. It wouldn't be unreasonable to run two
fsck jobs against independent devices on a large RAM machine and want to
balance physical RAM between them.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agobcachefs-tools: Use sysinfo(2) directly to implement si_meminfo()
Chris Webb [Sat, 9 Dec 2023 12:49:12 +0000 (12:49 +0000)]
bcachefs-tools: Use sysinfo(2) directly to implement si_meminfo()

Use a single sysinfo(2) call to fill out struct sysinfo instead of
multiple libc sysconf(3) requests, which will only make sysinfo(2) calls
internally anyway. This also enables us to access other struct sysinfo
fields, not just the three filled-out previously.

As we provide our own definition of struct sysinfo in include/linux/mm.h
to match the kernel, which is not guaranteed to align with the definition
libc provides in <sys/sysinfo.h>, use syscall(SYS_sysinfo, ...) directly
instead of the libc wrapper.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
4 months agobcachefs-tools: Use basename(3) from <libgen.h>
Chris Webb [Sat, 9 Dec 2023 12:58:46 +0000 (12:58 +0000)]
bcachefs-tools: Use basename(3) from <libgen.h>

Although glibc also provides basename(3) from <string.h>, this is
non-standard whereas it is available from <libgen.h> portably.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agobcachefs-tools: make 'all' the default Makefile goal
Tero Roponen [Fri, 8 Dec 2023 08:10:52 +0000 (10:10 +0200)]
bcachefs-tools: make 'all' the default Makefile goal

"fsck/bcachefsck_all:" coming before "all:" in the Makefile
causes the bcachefs binary not being built by default. Fix
this by explicitly setting the .DEFAULT_GOAL=all.

Signed-off-by: Tero Roponen <tero.roponen@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoMerge remote-tracking branch 'amoz/devel'
Kent Overstreet [Fri, 8 Dec 2023 01:19:06 +0000 (20:19 -0500)]
Merge remote-tracking branch 'amoz/devel'

5 months agoMerge pull request #190 from Dikay900/fs_free_space
koverstreet [Fri, 8 Dec 2023 01:10:15 +0000 (20:10 -0500)]
Merge pull request #190 from Dikay900/fs_free_space

cmd_fs: calculate free space

5 months agofix build for glibc prior to 2.33
Alexander Fougner [Thu, 7 Dec 2023 20:27:16 +0000 (21:27 +0100)]
fix build for glibc prior to 2.33

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
5 months agofix fallback flex array
Alexander Fougner [Thu, 7 Dec 2023 20:04:27 +0000 (21:04 +0100)]
fix fallback flex array

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
5 months agocmd_fs: calculate size based on bucket count for data types BCH_DATA_free, BCH_DATA_n...
Philip Laube [Wed, 6 Dec 2023 18:29:26 +0000 (19:29 +0100)]
cmd_fs: calculate size based on bucket count for data types BCH_DATA_free, BCH_DATA_need_discard and BCH_DATA_need_inc_gens

Signed-off-by: Philip Laube <philip.laube.dev@xyz.de>
5 months agoOnline fsck
Kent Overstreet [Tue, 5 Dec 2023 00:49:21 +0000 (19:49 -0500)]
Online fsck

This hooks up cmd_fsck to the new BCH_IOCTL_FSCK_ONLINE: if a filesystem
is mounted, we now use that instead of bailing out with an error.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate bcachefs sources to 6d44812757dd bcachefs: BCH_IOCTL_FSCK_ONLINE
Kent Overstreet [Mon, 4 Dec 2023 21:03:52 +0000 (16:03 -0500)]
Update bcachefs sources to 6d44812757dd bcachefs: BCH_IOCTL_FSCK_ONLINE

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate .gitignore for new service files
Kent Overstreet [Wed, 6 Dec 2023 04:52:43 +0000 (23:52 -0500)]
Update .gitignore for new service files

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agofsck: add a service to schedule and run bcachefsck@ services
Darrick J. Wong [Tue, 5 Dec 2023 02:43:31 +0000 (18:43 -0800)]
fsck: add a service to schedule and run bcachefsck@ services

Create a script that looks for mounted bcachefs filesystems and tries to
run as many of them in parallel as possible without two different
scrubbers hitting the same low level block device.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
5 months agofsck: add systemd service definitions for automatic online service
Darrick J. Wong [Tue, 5 Dec 2023 02:43:31 +0000 (18:43 -0800)]
fsck: add systemd service definitions for automatic online service

Add some systemd service files so that bcachefs can automatically fsck
mounted filesystems in the background.  Hopefully with minimal
disruption to frontend operations.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
5 months agoMerge pull request #191 from cepelinas9000/fuse-fixes-1
koverstreet [Thu, 7 Dec 2023 16:57:04 +0000 (11:57 -0500)]
Merge pull request #191 from cepelinas9000/fuse-fixes-1

Multiple small fuse fixes for write, api, and hardlink

5 months agoMultiple small fuse fixes for write, api, and hardlink
Tautvydas Nesvarbu [Thu, 7 Dec 2023 13:17:34 +0000 (15:17 +0200)]
Multiple small fuse fixes for write, api, and hardlink

* changed in Makefile to use recomended fuse api 35;
* force foreground mode, because fuse_daemonize is forking after initalization other bcachefs threads;
* fix fuse_link, there where mistype in fuse_log (the paremeter need to be inum.inum);
* The write_aligned is fixed, by  wrapping struct bch_write_op into container with single closure and using end_io callback to release
      that closure.

5 months agofix udev rules path
Alexander Fougner [Wed, 6 Dec 2023 17:20:11 +0000 (18:20 +0100)]
fix udev rules path

- include rules file in rpmspec
- update install docs with udev build requirement

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoMerge pull request #189 from Dikay900/fs_human_readable
koverstreet [Wed, 6 Dec 2023 18:58:01 +0000 (13:58 -0500)]
Merge pull request #189 from Dikay900/fs_human_readable

cmd_fs: add long parameter --human-readable to usage command

5 months agocmd_fs: add long parameter --human-readable to usage command
Philip Laube [Wed, 6 Dec 2023 18:29:05 +0000 (19:29 +0100)]
cmd_fs: add long parameter --human-readable to usage command

Signed-off-by: Philip Laube <philip.laube.dev@xyz.de>
5 months agoDisable shrinker thread shutdown
Kent Overstreet [Tue, 5 Dec 2023 23:28:14 +0000 (18:28 -0500)]
Disable shrinker thread shutdown

We seem to be hitting a rare crash in the exit path of fsck - when
shutting down the shrinker thread. Disable exiting the shrinker thread
as a workaround.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agomisc: don't allow udisks to automount bcachefs filesystems with no prompt
Darrick J. Wong [Tue, 5 Dec 2023 00:44:29 +0000 (19:44 -0500)]
misc: don't allow udisks to automount bcachefs filesystems with no prompt

The unending stream of syzbot bug reports and overwrought filing of CVEs
for corner case handling (i.e. things that distract from actual user
complaints) in XFS has generated all sorts of of overheated rhetoric
about how every bug is a Serious Security Issue(tm) because anyone can
craft a malicious filesystem on a USB stick, insert the stick into a
victim machine, and mount will trigger a bug in the kernel driver that
leads to some compromise or DoS or something.

I thought that nobody would be foolish enough to automount an XFS
filesystem.  What a fool I was!  It turns out that udisks can be told
that it's okay to automount things, and then GNOME will do exactly that.
Including mounting mangled XFS filesystems!  Same with bcachefs!

<delete angry rant about poor decisionmaking and armchair fs developers
blasting us on X while not actually doing any of the work>

Turn off /this/ idiocy by adding a udev rule to tell udisks not to
automount bcachefs filesystems.

This will not stop a logged in user from unwittingly inserting a
malicious storage device and pressing [mount] and getting breached.
This is not a substitute for a thorough audit.  This is not a substitute
for lklfuse.  This does not solve the general problem of in-kernel fs
drivers being a huge attack surface.  I just want to give Kent a break
from some of the oceans of bu******.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate bcachefs sources to 71a5b27e017d bcachefs: Make backpointer fsck wb flush...
Kent Overstreet [Thu, 30 Nov 2023 07:20:42 +0000 (02:20 -0500)]
Update bcachefs sources to 71a5b27e017d bcachefs: Make backpointer fsck wb flush check more rigorous

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate bcachefs sources to 676dd269f0f8 mean and variance: Promote to lib/math
Kent Overstreet [Thu, 30 Nov 2023 03:42:52 +0000 (22:42 -0500)]
Update bcachefs sources to 676dd269f0f8 mean and variance: Promote to lib/math

5 months agoUpdate bcachefs sources to eb83f1f842bb mean and variance: Promote to lib/math
Kent Overstreet [Thu, 30 Nov 2023 03:00:41 +0000 (22:00 -0500)]
Update bcachefs sources to eb83f1f842bb mean and variance: Promote to lib/math

5 months agoadd a fallback __DECLARE_FLEX_ARRAY
Kent Overstreet [Wed, 29 Nov 2023 22:41:06 +0000 (17:41 -0500)]
add a fallback __DECLARE_FLEX_ARRAY

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate bcachefs sources to c3e4d892b77b mean and variance: Promote to lib/math
Kent Overstreet [Wed, 29 Nov 2023 22:00:30 +0000 (17:00 -0500)]
Update bcachefs sources to c3e4d892b77b mean and variance: Promote to lib/math

5 months agoman: Fix cmd-option format
Brett Holman [Mon, 27 Nov 2023 20:22:59 +0000 (13:22 -0700)]
man: Fix cmd-option format

Options prgquote and degraded only had a single leading hyphen.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agobcachefs-tools: don't skip stale superblock wipe in force mode
Brian Foster [Mon, 27 Nov 2023 18:31:10 +0000 (13:31 -0500)]
bcachefs-tools: don't skip stale superblock wipe in force mode

Even though the blkid wipe has been fixed to detect and wipe old
superblocks, we still incorrectly skip the wipe when in force mode.
Update the force logic in open_for_format() to bypass the user
request and otherwise proceed with the wipe.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agocmd_list_journal: Apply star_start_of_lines() correctly
Kent Overstreet [Mon, 27 Nov 2023 18:35:08 +0000 (13:35 -0500)]
cmd_list_journal: Apply star_start_of_lines() correctly

In list_journal, we note which journal entries are being ignored - this
was forgetting to mark entries newer than the newest flush.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate bcachefs sources to feaca6edbd24 mean and variance: Promote to lib/math
Kent Overstreet [Mon, 27 Nov 2023 03:33:04 +0000 (22:33 -0500)]
Update bcachefs sources to feaca6edbd24 mean and variance: Promote to lib/math

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoConvert to BCH_IOCTL_DEV_USAGE_V2
Kent Overstreet [Fri, 24 Nov 2023 00:42:47 +0000 (19:42 -0500)]
Convert to BCH_IOCTL_DEV_USAGE_V2

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate bcachefs sources to 8c94740b1bf8 bcachefs: Add missing vaidation for jset_entr...
Kent Overstreet [Sun, 26 Nov 2023 02:51:30 +0000 (21:51 -0500)]
Update bcachefs sources to 8c94740b1bf8 bcachefs: Add missing vaidation for jset_entry_data_usage

5 months agocmd_fs_usage: Print out replica set durability
Kent Overstreet [Sat, 25 Nov 2023 01:50:49 +0000 (20:50 -0500)]
cmd_fs_usage: Print out replica set durability

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agodocs: mention that libclang is required
Alexander Batischev [Thu, 23 Nov 2023 18:37:16 +0000 (21:37 +0300)]
docs: mention that libclang is required

This fixes the following build failure on Debian bookworm:

    error: failed to run custom build command for `clang-sys v1.6.1`

    Caused by:
      process didn't exit successfully: `/home/minoru/src/bcachefs-tools/rust-src/target/release/build/clang-sys-df95f6d1266be773/build-script-build` (exit status: 101)
      --- stdout
      cargo:warning=could not execute `llvm-config` one or more times, if the LLVM_CONFIG_PATH environment variable is set to a full path to valid `llvm-config` executable it will be used to try to find an instance of `libclang` on your system: "couldn't execute `llvm-config --prefix` (path=llvm-config) (error: No such file or directory (os error 2))"

      --- stderr
      thread 'main' panicked at /home/minoru/.cargo/registry/src/index.crates.io-6f17d22bba15001f/clang-sys-1.6.1/build/dynamic.rs:206:45:
      called `Result::unwrap()` on an `Err` value: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoimprove kmalloc performance
Daniel Hill [Mon, 20 Nov 2023 12:43:52 +0000 (01:43 +1300)]
improve kmalloc performance

Reading from /proc/meminfo is really slow

We don't want to start swapping to disk.

Deceptively, memory available goes up when we start to swap to disk making
performance even worse.

To mitigate this:
1. replace reading from meminfo with proper system calls.
2. attempt to lock allocations in physical memory space.
3. check our own allocated memory instead of available memory.
4. still check available memory in the off chance we're trying to play
nice with other apps.

Signed-off-by: Daniel Hill <daniel@gluo.nz>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agorust: fix MSRV build
Alexander Fougner [Thu, 23 Nov 2023 18:22:47 +0000 (19:22 +0100)]
rust: fix MSRV build

- downgrade clap_completion to 4.3.x (1.65 compatible)
- dependency updates
- remove unused imports

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
5 months agoUpdate bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on the comma...
Kent Overstreet [Tue, 21 Nov 2023 00:33:52 +0000 (19:33 -0500)]
Update bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on the command line

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoNew upstream release
Jonathan Carter [Tue, 21 Nov 2023 15:32:00 +0000 (17:32 +0200)]
New upstream release

5 months agonix: add bcachefs-fuse package
Finn Behrens [Sun, 19 Nov 2023 21:13:14 +0000 (22:13 +0100)]
nix: add bcachefs-fuse package

Add a fuseSupport argument and bcachefs-fuse as flake output with fuse enabled.

Signed-off-by: Finn Behrens <me@kloenk.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agofix manpage date
Zhai Can [Sat, 18 Nov 2023 07:29:22 +0000 (15:29 +0800)]
fix manpage date

Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agomanpage: add options for `set-option`
Zhai Can [Fri, 17 Nov 2023 08:43:26 +0000 (16:43 +0800)]
manpage: add options for `set-option`

Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoupdate manpage
Zhai Can [Fri, 17 Nov 2023 08:30:18 +0000 (16:30 +0800)]
update manpage

Signed-off-by: Zhai Can <bczhc0@126.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoFix build for cmd_fusemount.c
Kent Overstreet [Fri, 17 Nov 2023 22:04:46 +0000 (17:04 -0500)]
Fix build for cmd_fusemount.c

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agobcachefs-tools: fix broken libblkid superblock wipe
Brian Foster [Fri, 17 Nov 2023 13:12:58 +0000 (08:12 -0500)]
bcachefs-tools: fix broken libblkid superblock wipe

When playing around with comparing some fstests results on different
filesystems, I noticed that a 'bcachefs format' of a previously
btrfs-formatted device still continued to mount as btrfs. The reason
for this is that the blkid wipe invoked via open_for_format() is not
working correctly. blkid_do_wipe() depends on the "SBMAGIC[_OFFSET]"
values to do any work, and the associated superblock magic flag is
not enabled on the probe.

Set the probe flags to explicitly enable the values the bcachefs
code depends on in the probe. This includes the type, label and
superblock magic information.

There are also a couple quirks in the libblkid code that might be
worth noting. One is that the superblock enablement and flag setting
functions appear hardcoded to return zero, so we just combine the
error checks. Second, while blkid_do_wipe() can return an error, it
actually doesn't in the scenario being addressed here because it
doesn't seem to distinguish between the values being absent because
nothing was found by the probe or because the values weren't enabled
in the first place. Regardless, add an error check here in the event
the wipe does explicitly fail for some unexpected reason.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoBump rust edition to 2021
Kent Overstreet [Thu, 16 Nov 2023 21:33:47 +0000 (16:33 -0500)]
Bump rust edition to 2021

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agodelete dead code
Kent Overstreet [Thu, 16 Nov 2023 20:47:59 +0000 (15:47 -0500)]
delete dead code

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate bcachefs sources to 938f680845d1 fixup! rename and export __kern_path_locked()
Kent Overstreet [Thu, 16 Nov 2023 20:47:11 +0000 (15:47 -0500)]
Update bcachefs sources to 938f680845d1 fixup! rename and export __kern_path_locked()

5 months agoCreate COPYING.rust-dependencies in release tarballs
Kent Overstreet [Thu, 16 Nov 2023 20:45:12 +0000 (15:45 -0500)]
Create COPYING.rust-dependencies in release tarballs

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoVersion is now specified in the makefile
Kent Overstreet [Thu, 16 Nov 2023 20:24:22 +0000 (15:24 -0500)]
Version is now specified in the makefile

git describe doesn't work for tarball releases

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agoUpdate bcachefs sources to 3ca08ab51ec9 bcachefs: six locks: Simplify optimistic...
Kent Overstreet [Mon, 13 Nov 2023 01:53:57 +0000 (20:53 -0500)]
Update bcachefs sources to 3ca08ab51ec9 bcachefs: six locks: Simplify optimistic spinning

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agorust keylocation add none variant and implement ValueEnum
Finn Behrens [Sun, 12 Nov 2023 16:12:36 +0000 (17:12 +0100)]
rust keylocation add none variant and implement ValueEnum

This enables a possible values help in the clap help text.

Signed-Off-By: Finn Behrens <me@kloenk.de>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
5 months agorust-cli: add help on `list` command
Zhai Can [Fri, 10 Nov 2023 12:42:35 +0000 (20:42 +0800)]
rust-cli: add help on `list` command

5 months agoadd command to generate Rust-part CLI completions
Zhai Can [Fri, 10 Nov 2023 12:13:03 +0000 (20:13 +0800)]
add command to generate Rust-part CLI completions

5 months agonix: add devShell
Finn Behrens [Sun, 5 Nov 2023 10:44:27 +0000 (11:44 +0100)]
nix: add devShell

Add a nix devShell output to provide a development environment for nix users.

Signed-off-by: Finn Behrens <me@kloenk.de>
5 months agonix: fix build add overlay and formatter to flake
Finn Behrens [Sat, 4 Nov 2023 08:40:16 +0000 (09:40 +0100)]
nix: fix build add overlay and formatter to flake

Adds overlay flake output to expose the bcachefs package
and add and run a nix formatter.

Co-authored-by: Leona Maroni <dev@leona.is>
Signed-off-by: Leona Maroni <dev@leona.is>
Signed-off-by: Finn Behrens <me@kloenk.de>
6 months agobtree_write_buffer: ensure atomic64_sub_return_release availability
Nicholas Sielicki [Thu, 19 Oct 2023 04:39:04 +0000 (23:39 -0500)]
btree_write_buffer: ensure atomic64_sub_return_release availability

prior to this patch, on certain platforms (ie: armv7l), compilation fails due
to atomic64_sub_return_release not being defined here. Ensure that the atomics
header is pulled in, and ensure that it is available in all cases, regardless
of whether ATOMIC64_SPINLOCK is defined.

Signed-off-by: Nicholas Sielicki <linux@opensource.nslick.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agorust: mount: use libc::c_ulong for flags
Nicholas Sielicki [Wed, 18 Oct 2023 05:59:02 +0000 (00:59 -0500)]
rust: mount: use libc::c_ulong for flags

libc proper treats mount flags as an unsigned long, which is usually u64,
except when it isn't. When preparing mount flags, use the libc::c_ulong type
instead of u64 to allow for this.

This fixes compiling this file under armv7l.

Signed-off-by: Nicholas Sielicki <linux@opensource.nslick.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoFix build on 32 bit
Kent Overstreet [Wed, 8 Nov 2023 02:17:06 +0000 (21:17 -0500)]
Fix build on 32 bit

size_t is apparently not an unsigned long on 32 bit, which is what
rounddown_pow_of_two() returns.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agomake-release-tarball.sh
Kent Overstreet [Wed, 8 Nov 2023 00:33:41 +0000 (19:33 -0500)]
make-release-tarball.sh

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoci: skip install of recommended packages
Alexander Fougner [Fri, 11 Aug 2023 16:50:43 +0000 (18:50 +0200)]
ci: skip install of recommended packages

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
6 months agoci: bump github actions
Alexander Fougner [Mon, 6 Nov 2023 18:52:05 +0000 (19:52 +0100)]
ci: bump github actions

- cachix/install-nix-action v22 -> v23
- actions/checkout v3 -> v4

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
6 months agoAvoiding picking different bucket sizes for different devices
Kent Overstreet [Tue, 7 Nov 2023 01:47:48 +0000 (20:47 -0500)]
Avoiding picking different bucket sizes for different devices

Erasure coding can't create stripes across devices with different bucket
sizes - therefore, format shouldn't pick different bucket sizes for
different devices.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoFix build for cmd_fusermount.c
Kent Overstreet [Tue, 7 Nov 2023 00:06:34 +0000 (19:06 -0500)]
Fix build for cmd_fusermount.c

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agocmd_format: Check for device options after device arguments
Kent Overstreet [Tue, 7 Nov 2023 00:01:15 +0000 (19:01 -0500)]
cmd_format: Check for device options after device arguments

It's a common user error to specify device specific options at the end
of a format command, and then not have them apply to any devices - add a
check for this.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agodowngrade rust deps to compile for MSRV
Alexander Fougner [Sun, 5 Nov 2023 00:07:01 +0000 (01:07 +0100)]
downgrade rust deps to compile for MSRV

- add helper for cargo update, whilst respecting MSRV

Signed-off-by: Alexander Fougner <fougner89@gmail.com>
6 months agoUpdate bcachefs sources to d464ec667b2b bcachefs: Add missing printk newlines
Kent Overstreet [Fri, 3 Nov 2023 16:09:59 +0000 (12:09 -0400)]
Update bcachefs sources to d464ec667b2b bcachefs: Add missing printk newlines

6 months agoUpdate, slim down rust dependencies
Kent Overstreet [Thu, 2 Nov 2023 20:44:59 +0000 (16:44 -0400)]
Update, slim down rust dependencies

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
6 months agoUpdate bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enum
Kent Overstreet [Thu, 2 Nov 2023 18:39:01 +0000 (14:39 -0400)]
Update bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enum

6 months agoPrepare for upload
Jonathan Carter [Sat, 28 Oct 2023 17:17:52 +0000 (19:17 +0200)]
Prepare for upload

6 months agoremove debian/files
Jonathan Carter [Sat, 28 Oct 2023 16:24:30 +0000 (18:24 +0200)]
remove debian/files

6 months agoFix version number
Jonathan Carter [Sat, 28 Oct 2023 16:23:48 +0000 (18:23 +0200)]
Fix version number

6 months agoUpdate bcachefs sources to 6628827a8707 bcachefs: Skip deleted members in member_to_t...
Kent Overstreet [Fri, 27 Oct 2023 23:38:36 +0000 (19:38 -0400)]
Update bcachefs sources to 6628827a8707 bcachefs: Skip deleted members in member_to_text()

6 months agoUpdate bcachefs sources to 7250b2ee5574 bcachefs: Fix deleted inodes btree in snapsho...
Kent Overstreet [Fri, 27 Oct 2023 20:43:11 +0000 (16:43 -0400)]
Update bcachefs sources to 7250b2ee5574 bcachefs: Fix deleted inodes btree in snapshot deletion