summaryrefslogtreecommitdiff
path: root/linux
AgeCommit message (Collapse)Author
2025-04-21linux shim: implement BLK_OPEN_CREATKent Overstreet
this allows O_CREAT to be passed through, for the new image creation tool. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-21Update bcachefs sources to c9d875f9be1f bcachefs: Casefold is now a regular ↵Kent Overstreet
opts.h option Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-20Pull in unicode support from kernelKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13Update bcachefs sources to 2f9361370129 bcachefs: Improve opts.degradedKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-04-13xclose()Kent Overstreet
Add a helper to check for close errrors - especially bad file descriptors, that can be a fun source of heisenbugs. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-03-16Update bcachefs sources to 46af7258b951 bcachefs: BCH_SB_FEATURES_ALL ↵Kent Overstreet
includes BCH_FEATURE_incompat_verison_field Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2025-01-15update min_heapKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-11-29Update bcachefs sources to bc01863fb6ef bcachefs: ↵Kent Overstreet
bcachefs_metadata_version_disk_accounting_big_endian Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-10-09Update bcachefs sources to 3b80552e7057 bcachefs: __wait_for_freeing_inode: ↵v1.13.0Kent Overstreet
Switch to wait_bit_queue_entry Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-08-23Update bcachefs sources to 22fa8fc32e6a bcachefs: rcu_pending now works in ↵Kent Overstreet
userspace
2024-08-17Update bcachefs sources to e7015d0df31c bcachefs: Simplify bch2_xattr_emit() ↵v1.11.0Kent Overstreet
implementation Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-12provide atomic64_try_cmpxchg() for 32bitKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-07-05Update bcachefs sources to 2be6fc9b111c bcachefs: bch2_gc_btree() should not ↵Kent Overstreet
use btree_root_lock Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-28Update bcachefs sources to 9404a01d3dc5 bcachefs: Make read_only a mount ↵v1.9.2Kent Overstreet
option again, but hidden Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-06-16fix missing includeKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-05-09Update bcachefs sources to 07f9a27f1969 bcachefs: add no_invalid_checks flagKent Overstreet
2024-04-03Update bcachefs sources to 09d4c2acbf4c bcachefs: reconstruct_inode()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-30Update bcachefs sources to 794723fc10c4 bcachefs: Topology repair now uses ↵Kent Overstreet
nodes found by scanning to fill holes Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-03-16Update bcachefs sources to 83338f5b2cb8 bcachefs: fix for building in userspaceKent Overstreet
2024-02-24Update bcachefs sources to a623b3063d5d bcachefs: Fix check_snapshot() memcpyKent Overstreet
2024-02-09Update bcachefs sources to bee7b5a4fa21 bcachefs: Pin btree cache in ram for ↵Kent Overstreet
random access in fsck Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-02-06Update bcachefs sources to 50847e296b34 bcachefs: Check subvol <-> inode ↵Kent Overstreet
pointers in check_inode() Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-24Update bcachefs sources to 481b5f343248 bcachefs: Better error messages for ↵Kent Overstreet
missing inodes in fsck Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-16Move c_src dirs back to toplevelKent Overstreet
We just wanted c sourcefiles out of the top level, not c source directories. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-16move Rust sources to top level, C sources into c_srcThomas Bertschinger
This moves the Rust sources out of rust_src/ and into the top level. Running the bcachefs executable out of the development tree is now: $ ./target/release/bcachefs command or $ cargo run --profile release -- command instead of "./bcachefs command". Building and installing is still: $ make && make install Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-10kill bd_buffered_fdKent Overstreet
this gets us back down to a single fd for opening block devices, which means we can use O_EXCL. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-10kill bd_sync_fdKent Overstreet
not needed with pwritev2(.., RWF_SYNC), and perhaps we can get down to one fd and then use O_EXCL for block devices. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-19fix shrinker_free()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-12-10bcachefs-tools: Fix typo in 872cd43Chris Webb
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>
2023-12-09bcachefs-tools: Avoid glibc-specific mallinfo() in shrinkerChris Webb
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>
2023-12-09bcachefs-tools: Use sysinfo(2) directly to implement si_meminfo()Chris Webb
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>
2023-12-07fix build for glibc prior to 2.33Alexander Fougner
Signed-off-by: Alexander Fougner <fougner89@gmail.com>
2023-12-05Disable shrinker thread shutdownKent Overstreet
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>
2023-11-30Update bcachefs sources to 71a5b27e017d bcachefs: Make backpointer fsck wb ↵Kent Overstreet
flush check more rigorous Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-24improve kmalloc performanceDaniel Hill
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>
2023-11-22Update bcachefs sources to 783085c3cc44 kbuild: Allow gcov to be enabled on ↵Kent Overstreet
the command line Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-11-02Update bcachefs sources to b9bd69421f73 bcachefs: x-macro-ify inode flags enumv1.3.1Kent Overstreet
2023-10-25Update bcachefs sources to 0d63ed13ea3d closures: Fix race in closure_sync()v1.3Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-29Handle -EAGAIN from io_submit()Kent Overstreet
If io_submit() returns -EAGAIN, that just means the io context is full and we need to wait for completions - no need to die. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-23Update bcachefs sources to f9c612bbf82d bcachefs: Fixes for building in ↵Kent Overstreet
userspace Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-09-01Fix one second delay when exitingTorge Matthies
Signed-off-by: Torge Matthies <openglfreak@googlemail.com>
2023-08-17Update bcachefs sources to a8115093df bcachefs: Fix divide by zero in ↵Kent Overstreet
rebalance_work()
2023-07-20Run shrinkers when pthread_create failsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-07-15Update bcachefs sources to e14d7c7195 bcachefs: Compression levelsKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-27Update bcachefs sources to 84f132d569 bcachefs: fsck: Break walk_inode() up ↵Kent Overstreet
into multiple functions Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-18Update bcachefs sources to 99175e5712 bcachefs: Fix ↵Kent Overstreet
bch2_check_discard_freespace_key()
2023-06-10Update bcachefs sources to ed6b7f81a7 six locks: Disable percpu read lock ↵Kent Overstreet
mode in userspace Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-06-04Update bcachefs sources to 7c0fe6f104 bcachefs: Fix bch2_fsck_ask_yn()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-05-25Update bcachefs sources to 31c09369cd six locks: Fix an unitialized varKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2023-03-31Update bcachefs sources to 8fd009dd76 bcachefs: Rip out code for storing ↵v0.28Kent Overstreet
backpointers in alloc keys Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>