-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bcachefs: fix initial page state after falloc #249
base: testing
Are you sure you want to change the base?
Commits on Jun 9, 2021
-
An option was added to control whether reflink support was on or off because for a long time, reflink + inline data extent support was missing - but that's since been fixed, so we can drop the option now. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for eedba9b - Browse repository at this point
Copy the full SHA eedba9bView commit details -
bcachefs: Fix a btree iterator leak
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0000eb6 - Browse repository at this point
Copy the full SHA 0000eb6View commit details -
bcachefs: Kill btree_iter_pos_changed()
this is used in only one place now, so just inline it into the caller. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 421c083 - Browse repository at this point
Copy the full SHA 421c083View commit details -
bcachefs: Add a print statement for when we go read-write
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 68e2feb - Browse repository at this point
Copy the full SHA 68e2febView commit details -
bcachefs: Don't list non journal devs in journal_debug_to_text()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9ad857b - Browse repository at this point
Copy the full SHA 9ad857bView commit details -
bcachefs: Fix btree iterator leak in extent_handle_overwrites()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 058bb7a - Browse repository at this point
Copy the full SHA 058bb7aView commit details -
bcachefs: Fsck code refactoring
Change fsck code to always put btree iterators - also, make some flow control improvements to deal with lock restarts better, and refactor check_extents() to not walk extents twice for counting/checking i_sectors. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 979db61 - Browse repository at this point
Copy the full SHA 979db61View commit details -
bcachefs: btree_iter_set_dontneed()
This is a bit clearer than using bch2_btree_iter_free(). Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 049d47f - Browse repository at this point
Copy the full SHA 049d47fView commit details -
bcachefs: Require all btree iterators to be freed
We keep running into occasional bugs with btree transaction iterators overflowing - this will make those bugs more visible. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 521bd0b - Browse repository at this point
Copy the full SHA 521bd0bView commit details -
bcachefs: Assert that iterators aren't being double freed
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 012c691 - Browse repository at this point
Copy the full SHA 012c691View commit details -
bcachefs: Kill bkey ops->debugcheck method
This code used to be used for running some assertions on alloc info at runtime, but it long predates fsck and hasn't been good for much in ages - we can delete it now. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f67ffc8 - Browse repository at this point
Copy the full SHA f67ffc8View commit details -
bcachefs: Don't overwrite snapshot field in bch2_cut_back()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a323cdd - Browse repository at this point
Copy the full SHA a323cddView commit details -
bcachefs: Validate bset version field against sb version fields
The superblock version fields need to be accurate to know whether a filesystem is supported, thus we should be verifying them. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 931da4c - Browse repository at this point
Copy the full SHA 931da4cView commit details -
bcachefs: Don't unconditially version_upgrade in initialize
This is mkfs's job. Also, clean up the handling of feature bits some. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0edf1f2 - Browse repository at this point
Copy the full SHA 0edf1f2View commit details -
bcachefs: Fix iterator picking
comparison was wrong Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2ea9ffb - Browse repository at this point
Copy the full SHA 2ea9ffbView commit details -
bcachefs: Optimize bch2_btree_iter_verify_level()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cc34d11 - Browse repository at this point
Copy the full SHA cc34d11View commit details -
bcachefs: Switch extent_handle_overwrites() to one key at a time
Prep work for snapshots Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 428d3b4 - Browse repository at this point
Copy the full SHA 428d3b4View commit details -
bcachefs: Get disk reservation when overwriting data in old snapshot
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 39cc509 - Browse repository at this point
Copy the full SHA 39cc509View commit details -
bcachefs: Replace bch2_btree_iter_next() calls with bch2_btree_iter_a…
…dvance The way btree iterators work internally has been changing, particularly with the iter->real_pos changes, and bch2_btree_iter_next() is no longer hyper optimized - it's just advance followed by peek, so it's more efficient to just call advance where we're not using the return value of bch2_btree_iter_next(). Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d500d73 - Browse repository at this point
Copy the full SHA d500d73View commit details -
bcachefs: Have btree_iter_next_node() use btree_iter_set_search_pos()
btree node iterators need to obey the regular btree node invarionts w.r.t. iter->real_pos; once they do, bch2_btree_iter_traverse will have less that it needs to check. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for db3cbc6 - Browse repository at this point
Copy the full SHA db3cbc6View commit details -
bcachefs: Iterators are now always consistent with iter->real_pos
This means bch2_btree_iter_traverse_one() can be made more efficient. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 225f02f - Browse repository at this point
Copy the full SHA 225f02fView commit details -
bcachefs: Kill btree_iter_peek_uptodate()
Since we're no longer doing next() immediately followed by peek(), this optimization isn't doing anything anymore. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ff0c3d1 - Browse repository at this point
Copy the full SHA ff0c3d1View commit details -
bcachefs: Internal btree iterator renaming
This just gives some internal helpers some better names. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 85624e5 - Browse repository at this point
Copy the full SHA 85624e5View commit details -
bcachefs: Improve iter->real_pos handling
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e7c28d3 - Browse repository at this point
Copy the full SHA e7c28d3View commit details -
bcachefs: Consolidate bch2_btree_iter_peek() and peek_with_updates()
Ideally we'll be getting rid of peek_with_updates(), but the callers will need to be checked. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 04ec8e2 - Browse repository at this point
Copy the full SHA 04ec8e2View commit details -
bcachefs: Update iter->real_pos lazily
peek() has to update iter->real_pos - there's no need for bch2_btree_iter_set_pos() to update it as well. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2e33af1 - Browse repository at this point
Copy the full SHA 2e33af1View commit details -
bcachefs: Include snapshot field in bch2_bpos_to_text
More prep work for snapshots. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bf1bf0e - Browse repository at this point
Copy the full SHA bf1bf0eView commit details -
bcachefs: Add an .invalid method for bch2_btree_ptr_v2
It was using the method for btree_ptr_v1, but that wasn't checking all the fields. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bde7a53 - Browse repository at this point
Copy the full SHA bde7a53View commit details -
bcachefs: Improve inode deletion code
It had some silly redundancies. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 07d8dda - Browse repository at this point
Copy the full SHA 07d8ddaView commit details -
bcachefs: Split btree_iter_traverse and bch2_btree_iter_traverse()
External (to the btree iterator code) users of bch2_btree_iter_traverse expect that on success the iterator will be pointed at iter->pos and have that position locked - but since we split iter->pos and iter->real_pos, that means it has to update iter->real_pos if necessary. Internal users don't expect it to modify iter->real_pos, so we need two separate functions. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 468fd24 - Browse repository at this point
Copy the full SHA 468fd24View commit details -
This adds a mode to six locks where readers use percpu counters - avoiding writing to shared cachelines. The algorithm is the same as the existing percpu-rwsemaphore's slowpath algorithm: taking a read lock still requires a memory barrier to check if we raced with another thread taking a write lock, but this means that taking a write lock doesn't incur the cost of an RCU barrier. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d59f2ad - Browse repository at this point
Copy the full SHA d59f2adView commit details -
bcachefs: Use pcpu mode of six locks for interior nodes
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cd2baf2 - Browse repository at this point
Copy the full SHA cd2baf2View commit details -
bcachefs: Increase default journal size
The default was 1/256th of the device and capped at 512MB, which is fairly tiny these days. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5a50b37 - Browse repository at this point
Copy the full SHA 5a50b37View commit details -
Bkey noops were introduced to deal with trimming inline data extents in place in the btree: if the u64s field of a bkey was 0, that u64 was a noop and we'd start looking for the next bkey immediately after it. But extent handling has been lifted above the btree - we no longer modify existing extents in place in the btree, and the compatibilty code for old style extent btree nodes is gone, so we can completely drop this code. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5c4be3c - Browse repository at this point
Copy the full SHA 5c4be3cView commit details -
bcachefs: Generate better bkey formats when splitting nodes
On btree node split, we weren't ensuring the min_key of the new larger node packs in the new format for this node. This triggers some painful slowpaths in the bset.c aux search tree code - this patch fixes that by calculating a new format for the new node with the new min_key. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1b1a9f1 - Browse repository at this point
Copy the full SHA 1b1a9f1View commit details -
bcachefs: Fix building of aux search trees
We weren't packing the min/max keys, which was a major oversight and completely disabled generating bkey_floats for adjacent nodes. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ca6b048 - Browse repository at this point
Copy the full SHA ca6b048View commit details -
bcachefs: Fix packed bkey format calculation for new btree roots
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b631cfe - Browse repository at this point
Copy the full SHA b631cfeView commit details -
bcachefs: Fix for bch2_trans_commit() unlocking when it's not suppose…
…d to When we pass BTREE_INSERT_NOUNLOCK bch2_trans_commit isn't supposed to unlock after a successful commit, but it was calling bch2_trans_cond_resched() - oops. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5d93ffc - Browse repository at this point
Copy the full SHA 5d93ffcView commit details -
bcachefs: Simplify btree_node_iter_init_pack_failed()
Since we now make sure to always generate packed bkey formats that can pack the min_key of a btree node, this path should actually never happen. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 70db49e - Browse repository at this point
Copy the full SHA 70db49eView commit details -
bcachefs: btree key cache locking improvements
The btree key cache mutex was becoming a significant bottleneck - it was mainly used to protect the lists of dirty, clean and freed cached keys. This patch eliminates the dirty and clean lists - instead, when we need to scan for keys to drop from the cache we iterate over the rhashtable, and thus we're able to remove most uses of that lock. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d2bd223 - Browse repository at this point
Copy the full SHA d2bd223View commit details -
bcachefs: Add a mechanism for running callbacks at trans commit time
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d4093fe - Browse repository at this point
Copy the full SHA d4093feView commit details -
bcachefs: Split out bpos_cmp() and bkey_cmp()
With snapshots, we're going to need to differentiate between comparisons that should and shouldn't include the snapshot field. bpos_cmp is now the comparison function that does include the snapshot field, used by core btree code. Upper level filesystem code generally does _not_ want to compare against the snapshot field - that code wants keys to compare as equal even when one of them is in an ancestor snapshot. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7fcd041 - Browse repository at this point
Copy the full SHA 7fcd041View commit details -
bcachefs: Start using bpos.snapshot field
This patch starts treating the bpos.snapshot field like part of the key in the btree code: * bpos_successor() and bpos_predecessor() now include the snapshot field * Keys in btrees that will be using snapshots (extents, inodes, dirents and xattrs) now always have their snapshot field set to U32_MAX The btree iterator code gets a new flag, BTREE_ITER_ALL_SNAPSHOTS, that determines whether we're iterating over keys in all snapshots or not - internally, this controlls whether bkey_(successor|predecessor) increment/decrement the snapshot field, or only the higher bits of the key. We add a new member to struct btree_iter, iter->snapshot: when BTREE_ITER_ALL_SNAPSHOTS is not set, iter->pos.snapshot should always equal iter->snapshot, which will be 0 for btrees that don't use snapshots, and alsways U32_MAX for btrees that will use snapshots (until we enable snapshot creation). This patch also introduces a new metadata version number, and compat code for reading from/writing to older versions - this isn't a forced upgrade (yet). Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 59f91dc - Browse repository at this point
Copy the full SHA 59f91dcView commit details -
This patch adds two new inode fields, bi_dir and bi_dir_offset, that point back to the inode's dirent. Since we're only adding fields for a single backpointer, files that have been hardlinked won't necessarily have valid backpointers: we also add a new inode flag, BCH_INODE_BACKPTR_UNTRUSTED, that's set if an inode has ever had multiple links to it. That's ok, because we only really need this functionality for directories, which can never have multiple hardlinks - when we add subvolumes, we'll need a way to enemurate and print subvolumes, and this will let us reconstruct a path to a subvolume root given a subvolume root inode. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dce08b8 - Browse repository at this point
Copy the full SHA dce08b8View commit details -
bcachefs: Change inode allocation code for snapshots
For snapshots, when we allocate a new inode we want to allocate an inode number that isn't in use in any other subvolume. We won't be able to use ITER_SLOTS for this, inode allocation needs to change to use BTREE_ITER_ALL_SNAPSHOTS. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 72b4e47 - Browse repository at this point
Copy the full SHA 72b4e47View commit details -
bcachefs: Don't use bch2_inode_find_by_inum() in move.c
Since move.c isn't aware of what subvolume we're in, we can't use the standard inode lookup code - fortunately, we're just using it for reading IO options. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e4330d5 - Browse repository at this point
Copy the full SHA e4330d5View commit details -
bcachefs: Have journal reclaim thread flush more aggressively
This adds a new watermark for the journal reclaim when flushing btree key cache entries - it should try and stay ahead of where foreground threads doing transaction commits will enter direct journal reclaim. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 249e369 - Browse repository at this point
Copy the full SHA 249e369View commit details -
bcachefs: Free iterator in bch2_btree_delete_range_trans()
This is specifically to speed up bch2_inode_rm(), so that we're not traversing iterators we're done with. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9d0c78d - Browse repository at this point
Copy the full SHA 9d0c78dView commit details -
bcachefs: Add repair code for out of order keys in a btree node.
This just drops the offending key - in the bug report where this was seen, it was clearly a single bit memory error, and fsck will fix the missing key. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8cf350e - Browse repository at this point
Copy the full SHA 8cf350eView commit details -
bcachefs: Don't use write side of mark_lock in journal write path
The write side of percpu rwsemaphors is really expensive, and we shouldn't be taking it at all in steady state operation. Fortunately, in bch2_journal_super_entries_add_common(), we don't need to - we have a seqlock, usage_lock for accumulating percpu usage counters to the base counters. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 35bdc29 - Browse repository at this point
Copy the full SHA 35bdc29View commit details -
bcachefs: Don't make foreground writes wait behind journal reclaim to…
…o long Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dbd952e - Browse repository at this point
Copy the full SHA dbd952eView commit details -
bcachefs: Move btree lock debugging to slowpath fn
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b793e49 - Browse repository at this point
Copy the full SHA b793e49View commit details -
bcachefs: Improve bch2_trans_relock()
We're getting away from relying on iter->uptodate - this changes bch2_trans_relock() to more directly specify which iterators should be relocked. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bd3556d - Browse repository at this point
Copy the full SHA bd3556dView commit details -
bcachefs: Add a sysfs var for average btree write size
Useful number for performance tuning. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for adef29a - Browse repository at this point
Copy the full SHA adef29aView commit details -
bcachefs: Improve bch2_btree_update_start()
bch2_btree_update_start() is now responsible for taking gc_lock and upgrading the iterator to lock parent nodes - greatly simplifying error handling and all of the callers. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ab12eab - Browse repository at this point
Copy the full SHA ab12eabView commit details -
bcachefs: Change where merging of interior btree nodes is trigger from
Previously, we were doing btree node merging from bch2_btree_insert_node() - but this is called from the split path, when we're in the middle of creating new nodes and deleting new nodes and the iterators are in a weird state. Also, this means we're starting a new btree_update while in the middle of an existing one, and that's asking for deadlocks. Much simpler and saner to trigger btree node merging _after_ the whole btree node split path is finished. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7fced03 - Browse repository at this point
Copy the full SHA 7fced03View commit details -
bcachefs: Kill bch2_btree_node_get_sibling()
This patch reworks the btree node merge path to use a second btree iterator to get the sibling node - which means bch2_btree_iter_get_sibling() can be deleted. Also, it uses bch2_btree_iter_traverse_all() if necessary - which means it should be more reliable. We don't currently even try to make it work when trans->nounlock is set - after a BTREE_INSERT_NOUNLOCK transaction commit, hopefully this will be a worthwhile tradeoff. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a3eaa04 - Browse repository at this point
Copy the full SHA a3eaa04View commit details -
bcachefs: bch2_foreground_maybe_merge() now correctly reports lock re…
…starts This means that btree node splits don't have to automatically trigger a transaction restart. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d123592 - Browse repository at this point
Copy the full SHA d123592View commit details -
bcachefs: Move btree node merging to before transaction commit
Currently, BTREE_INSERT_NOUNLOCK makes it hard to ensure btree node merging happens reliably - since btree node merging happens after transaction commit, we can't drop btree locks and block when starting the btree update. This patch moves it to before transaction commit - and failure to do a merge that we wanted to do just restarts the transaction. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d07cd98 - Browse repository at this point
Copy the full SHA d07cd98View commit details -
bcachefs: Drop trans->nounlock
Since we're no longer doing btree node merging post commit, we can now delete a bunch of code. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b7d0089 - Browse repository at this point
Copy the full SHA b7d0089View commit details -
bcachefs: Fix BTREE_FOREGROUND_MERGE_HYSTERESIS
We were multiplying instead of dividing - oops. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a8e31da - Browse repository at this point
Copy the full SHA a8e31daView commit details -
bcachefs: Increase commality between BTREE_ITER_NODES and BTREE_ITER_…
…KEYS Eventually BTREE_ITER_NODES should be going away. This patch is to fix a transaction iterator overflow in the btree node merge path because BTREE_ITER_NODES iterators couldn't be reused. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 73f5bec - Browse repository at this point
Copy the full SHA 73f5becView commit details -
bcachefs: Fix this_cpu_ptr() usage
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fabc03e - Browse repository at this point
Copy the full SHA fabc03eView commit details -
bcachefs: Fix journal deadlock
After we get a journal reservation, we need to use it - if we erorr out of a transaction commit, we'll be eating into space in the journal and if our transaction needs to make forward progress in order to reclaim space in the journal, we'll deadlock. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5eab6d0 - Browse repository at this point
Copy the full SHA 5eab6d0View commit details -
bcachefs: Be more careful about JOURNAL_RES_GET_RESERVED
JOURNAL_RES_GET_RESERVED should only be used for updatse that need to be done to free up space in the journal. In particular, when we're flushing keys from the key cache, if we're flushing them out of order we shouldn't be using it, since we're using up our remaining space in the journal without dropping a pin that will let us make forward progress. With this patch, BTREE_INSERT_JOURNAL_RECLAIM without BTREE_INSERT_JOURNAL_RESERVED may return -EAGAIN - we can't wait on journal reclaim if we're already in journal reclaim. This means we need to propagate these errors up to journal reclaim, indicating that flushing a journal pin should be retried in the future. This is prep work for a patch to change the way journal reclaim works, to split out flushing key cache keys because the btree key cache is too dirty from journal reclaim because we need space in the journal. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dba55ed - Browse repository at this point
Copy the full SHA dba55edView commit details -
bcachefs: Fix livelock calling bch2_mark_bkey_replicas()
The bug was that we were trying to find a replicas entry that wasn't sorted - but, we can also simplify the code by not using bch2_mark_bkey_replicas and instead ensuring the list of replicas entries exists directly. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 30702f5 - Browse repository at this point
Copy the full SHA 30702f5View commit details -
bcachefs: Kill bch2_fs_usage_scratch_get()
This is an important cleanup, eliminating an unnecessary copy in the transaction commit path. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4943edb - Browse repository at this point
Copy the full SHA 4943edbView commit details -
bcachefs: Drop some memset() calls
gcc is emitting rep stos here, which is silly (and slow) for an 8 byte memset. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 286fc36 - Browse repository at this point
Copy the full SHA 286fc36View commit details -
bcachefs: Eliminate memory barrier from fast path of journal_preres_p…
…ut() Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1e770a8 - Browse repository at this point
Copy the full SHA 1e770a8View commit details -
bcachefs: kill bset_tree->max_key
Since we now ensure a btree node's max key fits in its packed format, this isn't needed for the reasons it used to be - and, it was being used inconsistently. Also reorder struct btree a bit for performance, and kill some dead code. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2727dfd - Browse repository at this point
Copy the full SHA 2727dfdView commit details -
bcachefs: Fix an uninitialized variable
Fortunately it was just used in an error message Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for deb4a39 - Browse repository at this point
Copy the full SHA deb4a39View commit details -
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 90d466b - Browse repository at this point
Copy the full SHA 90d466bView commit details -
bcachefs: Increase BSET_CACHELINE to 256 bytes
Linear searches have gotten cheaper relative to binary searches on modern hardware, due to better branch prediction behaviour. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e25900e - Browse repository at this point
Copy the full SHA e25900eView commit details -
bcachefs: Eliminate more PAGE_SIZE uses
In userspace, we don't really have a well defined PAGE_SIZE and shouln't be relying on it. This is some more incremental work to remove references to it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 36c5c04 - Browse repository at this point
Copy the full SHA 36c5c04View commit details -
bcachefs: Don't flush btree writes more aggressively because of btree…
… key cache We need to flush the btree key cache when it's too dirty, because otherwise the shrinker won't be able to reclaim memory - this is done by journal reclaim. But journal reclaim also kicks btree node writes: this meant that btree node writes were getting kicked much too often just because we needed to flush btree key cache keys. This patch splits journal pins into two different lists, and teaches journal reclaim to not flush btree node writes when it only needs to flush key cache keys. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4057252 - Browse repository at this point
Copy the full SHA 4057252View commit details -
bcachefs: Improve bset compaction
The previous patch that fixed btree nodes being written too aggressively now meant that we weren't sorting btree node bsets optimally - this patch fixes that. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d52ce23 - Browse repository at this point
Copy the full SHA d52ce23View commit details -
bcachefs: Move some dirent checks to bch2_dirent_invalid()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7fec8d1 - Browse repository at this point
Copy the full SHA 7fec8d1View commit details -
bcachefs: Drop bch2_fsck_inode_nlink()
We've had BCH_FEATURE_atomic_nlink for quite some time, we can drop this now. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5376e51 - Browse repository at this point
Copy the full SHA 5376e51View commit details -
bcachefs: Don't wait for ALLOC_SCAN_BATCH buckets in allocator
It used to be necessary for the allocator thread to batch up invalidating buckets when possible - but since we added the btree key cache that hasn't been a concern, and now it's causing the allocator thread to livelock when the filesystem is nearly full. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 35d81ef - Browse repository at this point
Copy the full SHA 35d81efView commit details -
bcachefs: Make sure to kick journal reclaim when we're waiting on it
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b9d4589 - Browse repository at this point
Copy the full SHA b9d4589View commit details -
bcachefs: Fix bch2_gc_btree_gens()
Since we're using a NOT_EXTENTS iterator, we shouldn't be setting the iter pos to the start of the extent. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 01f1ade - Browse repository at this point
Copy the full SHA 01f1adeView commit details -
bcachefs: Fix BTREE_ITER_NOT_EXTENTS
bch2_btree_iter_peek() wasn't properly checking for BTREE_ITER_IS_EXTENTS when updating iter->pos. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b733225 - Browse repository at this point
Copy the full SHA b733225View commit details -
bcachefs: Check inodes at start of fsck
This splits out checking inode nlinks from the rest of the inode checks and moves most of the inode checks to the start of fsck, so that other fsck passes can depend on it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4c64e2b - Browse repository at this point
Copy the full SHA 4c64e2bView commit details -
bcachefs: Simplify hash table checks
Very early on there was a period where we were accidentally generating dirents with trailing garbage; we've since dropped support for filesystems that old and the fsck code can be dropped. Also, this patch switches to a simpler algorithm for checking hash tables. It's less efficient on hash collision - but with 64 bit keys, those are very rare. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6057971 - Browse repository at this point
Copy the full SHA 6057971View commit details -
bcachefs: Inode backpointers are now required
This lets us simplify fsck quite a bit, which we need for making fsck snapshot aware. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0e23fa0 - Browse repository at this point
Copy the full SHA 0e23fa0View commit details -
bcachefs: Redo check_nlink fsck pass
Now that we have inode backpointers the check_nlink pass only is concerned with files that have hardlinks, and can be simplified. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d5b43e4 - Browse repository at this point
Copy the full SHA d5b43e4View commit details -
bcachefs: Fix bch2_trans_relock()
The patch that changed bch2_trans_relock() to not look at iter->uptodate also tried to add an optimization by only having it relock btree_iter_key() iterators (iterators that are live or have been marked as keep). But, this wasn't thought through - this pops internal iterator assertions because on transaction restart, when we're traversing iterators we traverse all iterators marked as linked, and having bch2_trans_relock() skip some of those mean that it can skil the iterator that bch2_btree_iter_traverse_one() is currently traversing. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 39707d0 - Browse repository at this point
Copy the full SHA 39707d0View commit details -
bcachefs: Fix fsck to not use bch2_link_trans()
bch2_link_trans() uses the btree key cache for inode updates, and fsck isn't supposed to - also, it's not really what we want for reattaching unreachable inodes anyways. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d4bd08f - Browse repository at this point
Copy the full SHA d4bd08fView commit details -
bcachefs: Improved check_directory_structure()
Now that we have inode backpointers, we can simplify checking directory structure: instead of doing a DFS from the filesystem root and then checking if we found everything, we can iterate over every inode and see if we can go up until we get to the root. This patch also has a number of fixes and simplifications for the inode backpointer checks. Also, it turns out we don't actually need the BCH_INODE_BACKPTR_UNTRUSTED flag. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6c6afe5 - Browse repository at this point
Copy the full SHA 6c6afe5View commit details -
bcachefs: BCH_BEATURE_atomic_nlink is obsolete
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 347af01 - Browse repository at this point
Copy the full SHA 347af01View commit details -
bcachefs: Fix heap overrun in bch2_fs_usage_read()
oops Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0c46dbc - Browse repository at this point
Copy the full SHA 0c46dbcView commit details -
bcachefs: Add the status of bucket gen gc to sysfs
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 477d145 - Browse repository at this point
Copy the full SHA 477d145View commit details -
bcachefs: Ensure bucket gen gc completes
We don't want it to block, if it can't allocate it should just continue instead of possibly deadlocking. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3ccd45e - Browse repository at this point
Copy the full SHA 3ccd45eView commit details -
bcachefs: Add a perf test for multiple updates per commit
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 41ca62f - Browse repository at this point
Copy the full SHA 41ca62fView commit details -
bcachefs: Drop old style btree node coalescing
We have foreground btree node merging now, and any future btree node merging improvements are going to be based off of that code. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 41dc38a - Browse repository at this point
Copy the full SHA 41dc38aView commit details -
bcachefs: Better iterator picking
Avoid cloning iterators if we don't have to. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e455701 - Browse repository at this point
Copy the full SHA e455701View commit details -
bcachefs: Don't call bch2_btree_iter_traverse() unnecessarily
If we let bch2_trans_commit() do it, it'll traverse iterators in sorted order which means we'll get fewer lock restarts. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5faab1e - Browse repository at this point
Copy the full SHA 5faab1eView commit details -
bcachefs: Fix bch2_gc_done() error messages
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c27e507 - Browse repository at this point
Copy the full SHA c27e507View commit details -
bcachefs: Fix journal_reclaim_wait_done()
Can't run arbitrary code inside a wait_event() conditional, due to task state being weird... Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b96cc2a - Browse repository at this point
Copy the full SHA b96cc2aView commit details -
bcachefs: Improve bch2_btree_iter_traverse_all()
By changing it to upgrade iterators to intent locks to avoid lock restarts we can simplify __bch2_btree_node_lock() quite a bit - this fixes a probable bug where it could potentially drop a lock on an unrelated error but still succeed instead of causing a transaction restart. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c757af5 - Browse repository at this point
Copy the full SHA c757af5View commit details -
bcachefs: Don't downgrade iterators in bch2_trans_get_iter()
This fixes a livelock with btree node splits. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7a5f402 - Browse repository at this point
Copy the full SHA 7a5f402View commit details -
bcachefs: Improve trans_restart_mem_realloced tracepoint
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6fa9de4 - Browse repository at this point
Copy the full SHA 6fa9de4View commit details -
bcachefs: Fix bch2_trans_mark_dev_sb()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 26b30ff - Browse repository at this point
Copy the full SHA 26b30ffView commit details -
bcachefs: Simplify bch2_set_nr_journal_buckets()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8ac7aa6 - Browse repository at this point
Copy the full SHA 8ac7aa6View commit details -
Writepoints are never deallocated so the rcu_read_lock() isn't really needed, but we are doing lockless list traversal. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9db1d69 - Browse repository at this point
Copy the full SHA 9db1d69View commit details -
bcachefs: Fix journal reclaim loop
When dirty key cache keys were separated from other journal pins, we broke the loop conditional in __bch2_journal_reclaim() - it's supposed to keep looping as long as there's work to do. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4825894 - Browse repository at this point
Copy the full SHA 4825894View commit details -
bcachefs: Fix transaction restarts due to upgrading of cloned iterators
This fixes a regression from 52d86202fd bcachefs: Improve bch2_btree_iter_traverse_all() We want to avoid mucking with other iterators in the btree transaction in operations that are only supposed to be touching individual iterators - that patch was a cleanup to move lock ordering handling to bch2_btree_iter_traverse_all(). But it broke upgrading of cloned iterators. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 07f4cd4 - Browse repository at this point
Copy the full SHA 07f4cd4View commit details -
bcachefs: Simplify fsck remove_dirent()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 916e58e - Browse repository at this point
Copy the full SHA 916e58eView commit details -
bcachefs: Fix some small memory leaks
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0c8095a - Browse repository at this point
Copy the full SHA 0c8095aView commit details -
bcachefs: Fix an unused var warning in userspace
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 57ed8d4 - Browse repository at this point
Copy the full SHA 57ed8d4View commit details -
bcachefs: Refactor bchfs_fallocate() to not nest btree_trans on stack
Upcoming patch is going to disallow multiple btree_trans on the stack. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 10efd18 - Browse repository at this point
Copy the full SHA 10efd18View commit details -
bcachefs: gc shouldn't care about owned_by_allocator
The owned_by_allocator field is a purely in memory thing, even if/when we bring back GC at runtime there's no need for it to be recalculating this field. This is prep work for pulling it out of struct bucket, and eventually getting rid of the bucket array. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 313de79 - Browse repository at this point
Copy the full SHA 313de79View commit details -
bcachefs: Allocator thread doesn't need gc_lock anymore
Even with runtime gc (which currently isn't supported), runtime gc no longer clears/recalculates the main set of bucket marks - it allocates and calculates another set, updating the primary at the end. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 060014b - Browse repository at this point
Copy the full SHA 060014bView commit details -
bcachefs: Handle errors in bch2_trans_mark_update()
It's not actually the case that iterators are always checked here - __bch2_trans_commit() checks for that after running triggers. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6bc7f61 - Browse repository at this point
Copy the full SHA 6bc7f61View commit details -
bcachefs: Check that keys are in the correct btrees
We've started seeing bug reports of pointers to btree nodes being detected in leaf nodes. This should catch that before it's happened, and it's something we should've been checking anyways. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d38e9dc - Browse repository at this point
Copy the full SHA d38e9dcView commit details -
bcachefs: Always check for invalid bkeys in trans commit path
We check for this prior to metadata being written, but we're seeing some strange bugs lately, and this will help catch those closer to where they occur. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8cd33be - Browse repository at this point
Copy the full SHA 8cd33beView commit details -
bcachefs: Allocator refactoring
This uses the kthread_wait_freezable() macro to simplify a lot of the allocator thread code, along with cleaning up bch2_invalidate_bucket2(). Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e3f7424 - Browse repository at this point
Copy the full SHA e3f7424View commit details -
bcachefs: Preallocate trans mem in bch2_migrate_index_update()
This will help avoid transaction restarts. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 158d369 - Browse repository at this point
Copy the full SHA 158d369View commit details -
bcachefs: Fix for btree_gc repairing interior btree ptrs
Using the normal transaction commit path to insert and journal updates to interior nodes hadn't been done before this repair code was written, not surprising that there was a bug. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 69f0715 - Browse repository at this point
Copy the full SHA 69f0715View commit details -
bcachefs: Fix a use after free
Turns out, we weren't waiting on in flight btree writes when freeing existing btree nodes. This lead to stray btree writes overwriting newly allocated buckets, but only started showing itself with some of the recent allocator work and another patch to move submitting of btree writes to worqueues. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1e54da2 - Browse repository at this point
Copy the full SHA 1e54da2View commit details -
bcachefs: Punt btree writes to workqueue to submit
We don't want to be submitting IO with btree locks held, and btree writes usually aren't latency sensitive. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 01a132c - Browse repository at this point
Copy the full SHA 01a132cView commit details -
bcachefs: Fix two btree iterator leaks
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2ba9ed8 - Browse repository at this point
Copy the full SHA 2ba9ed8View commit details -
bcachefs: Update bch2_btree_verify()
bch2_btree_verify() verifies that the btree node on disk matches what we have in memory. This patch changes it to verify every replica, and also fixes it for interior btree nodes - there's a mem_ptr field which is used as a scratch space and needs to be zeroed out for comparing with what's on disk. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0f8d9cc - Browse repository at this point
Copy the full SHA 0f8d9ccView commit details -
bcachefs: Fix a deadlock on journal reclaim
Flushing the btree key cache needs to use allocation reserves - journal reclaim depends on flushing the btree key cache for making forward progress, and the allocator and copygc depend on journal reclaim making forward progress. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4d4c2d4 - Browse repository at this point
Copy the full SHA 4d4c2d4View commit details -
bcachefs: Don't BUG() in update_replicas
Apparently, we have a bug where in mark and sweep while accounting for a key, a replicas entry isn't found. Change the code to print out the key we couldn't mark and halt instead of a BUG_ON(). Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0f21481 - Browse repository at this point
Copy the full SHA 0f21481View commit details -
bcachefs: Lookup/create lost+found lazily
This is prep work for subvolumes - each subvolume will have its own lost+found. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4702d58 - Browse repository at this point
Copy the full SHA 4702d58View commit details -
bcachefs: Fix repair leading to replicas not marked
bch2_check_fix_ptrs() was being called after checking if the replicas set was marked - but repair could change which replicas set needed to be marked. Oops. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 168ef9a - Browse repository at this point
Copy the full SHA 168ef9aView commit details -
bcachefs: Don't BUG_ON() btree topology error
This replaces an assertion in the btree merge path with a bch2_inconsistent_error() - fsck will fix it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dbfd061 - Browse repository at this point
Copy the full SHA dbfd061View commit details -
bcachefs: Add a mempool for btree_trans bump allocator
This allocation is required for filesystem operations to make forward progress, thus needs a mempool. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cb8ce5d - Browse repository at this point
Copy the full SHA cb8ce5dView commit details -
bcachefs: Add a mempool for the replicas delta list
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dcc5355 - Browse repository at this point
Copy the full SHA dcc5355View commit details -
bcachefs: Use mmap() instead of vmalloc_exec() in userspace
Calling mmap() directly is much better than malloc() then mprotect(), we end up with much less address space fragmentation. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9d43018 - Browse repository at this point
Copy the full SHA 9d43018View commit details -
bcachefs: Fix an out of bounds read
bch2_varint_decode() can read up to 7 bytes past the end of the buffer, which means we need to allocate slightly larger key cache buffers. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c1a5b6a - Browse repository at this point
Copy the full SHA c1a5b6aView commit details -
bcachefs: Fix bch2_verify_keylist_sorted
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6cf32da - Browse repository at this point
Copy the full SHA 6cf32daView commit details -
bcachefs: Rewrite btree nodes with errors
This patch adds self healing functionality for btree nodes - if we notice a problem when reading a btree node, we just rewrite it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ea18900 - Browse repository at this point
Copy the full SHA ea18900View commit details -
bcachefs: New helper __bch2_btree_insert_keys_interior()
Consolidate common parts of bch2_btree_insert_keys_interior() and btree_split_insert_keys() - prep work for adding some new topology assertions. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a4ba17b - Browse repository at this point
Copy the full SHA a4ba17bView commit details -
bcachefs: Fix key cache assertion
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f75c5b4 - Browse repository at this point
Copy the full SHA f75c5b4View commit details -
bcachefs: New and improved topology repair code
This splits out btree topology repair into a separate pass, and makes some improvements: - When we have to pick which of two overlapping nodes to drop keys from, we use the btree node header sequence number to preserve the newer node - the gc code has been changed so that it doesn't bail out if we're continuing/ignoring on fsck error - this way the dump tool can skip running the repair pass but still walk all reachable metadata - add a new superblock flag indicating when a filesystem is known to have btree topology issues, and the topology repair pass should be run - changing the start/end of a node might mean keys in that node have to be deleted: this patch handles that better by splitting it out into a separate function and running it explicitly in the topology repair code, previously those keys were only being dropped when the btree node was read in. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 52a4d56 - Browse repository at this point
Copy the full SHA 52a4d56View commit details -
bcachefs: Fix a null ptr deref
Fix a few memory safety issues, found by asan in userspace. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 145bc3d - Browse repository at this point
Copy the full SHA 145bc3dView commit details -
bcachefs: New check_nlinks algorithm for snapshots
With snapshots, using a radix tree for the table of link counts won't work anymore because we also need to distinguish between inodes with different snapshot IDs. Instead, this patch builds up a sorted array of inodes that have hardlinks that we can binary search on - taking advantage of the fact that with inode backpointers, the check_nlinks() pass _only_ needs to concern itself with inodes that have hardlinks now. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6500938 - Browse repository at this point
Copy the full SHA 6500938View commit details -
bcachefs: Evict btree nodes we're deleting
There was a bug that led to duplicate btree node pointers being inserted at the wrong level. The new topology repair code can fix that, except that the btree cache code gets confused when we read in a btree node from the pointer that was at the wrong level. This patch evicts nodes that we're deleting to, which nicely solves the problem. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9e1839a - Browse repository at this point
Copy the full SHA 9e1839aView commit details -
bcachefs: Fix __bch2_trans_get_iter()
We need to also set iter->uptodate to indicate it needs to be traversed. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1b39f7d - Browse repository at this point
Copy the full SHA 1b39f7dView commit details -
bcachefs: New tracepoint for bch2_trans_get_iter()
Trying to debug an issue where after traverse_all() we shouldn't have to traverse any iterators... yet we are Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 55fe3d4 - Browse repository at this point
Copy the full SHA 55fe3d4View commit details -
bcachefs: Call bch2_inconsistent_error() on missing stripe/indirect e…
…xtent Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e137126 - Browse repository at this point
Copy the full SHA e137126View commit details -
bcachefs: Change bch2_btree_key_cache_count() to exclude dirty keys
We're seeing livelocks that appear to be due to bch2_btree_key_cache_scan repeatedly scanning and blocking other tasks from using the key cache lock - we probably shouldn't be reporting objects that can't actually be freed yet. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b34ec71 - Browse repository at this point
Copy the full SHA b34ec71View commit details -
bcachefs: Change copygc wait amount to be min of per device waits
We're seeing a filesystem get stuck when all devices but one have no more reclaimable buckets - because the copygc wait amount is curretly filesystem wide. This patch should fix that, possibly at the expensive of running too much when only one or a few devices is full and the rebalance thread needs to move data around. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7b08c8b - Browse repository at this point
Copy the full SHA 7b08c8bView commit details -
bcachefs: Enable .splice_write
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3c22d04 - Browse repository at this point
Copy the full SHA 3c22d04View commit details -
bcachefs: Ensure that fpunch updates inode timestamps
Fixes xfstests generic/059 Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 31bbad5 - Browse repository at this point
Copy the full SHA 31bbad5View commit details -
bcachefs: Make sure to initialize j->last_flushed
If the journal reclaim thread makes it to the timeout without ever initializing j->last_flushed, we could end up sleeping for a very long time. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e29207a - Browse repository at this point
Copy the full SHA e29207aView commit details -
bcachefs: Add a tracepoint for when we block on journal reclaim
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1766ac8 - Browse repository at this point
Copy the full SHA 1766ac8View commit details -
There were some overflows in the time conversion functions - fix this by converting tv_sec and tv_nsec separately. Also, set sb->time_min and sb->time_max. Fixes xfstest generic/258. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cffbbe7 - Browse repository at this point
Copy the full SHA cffbbe7View commit details -
bcachefs: Mark newly allocated btree nodes as accessed
This was a major oversight - this means under memory pressure we can end up reading in a btree node, then having it evicted before we get to use it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1b2a38b - Browse repository at this point
Copy the full SHA 1b2a38bView commit details -
bcachefs: Clean up bch2_btree_and_journal_walk()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9b5ed4f - Browse repository at this point
Copy the full SHA 9b5ed4fView commit details -
bcachefs: Fix usage of last_seq + encryption
jset->last_seq is in the region that's encrypted - on journal write completion, we were using it and getting garbage. This patch shadows it to fix. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 45f2043 - Browse repository at this point
Copy the full SHA 45f2043View commit details -
bcachefs: Fix oob write in __bch2_btree_node_write
Fix a possible out of bounds write in __bch2_btree_node_write when the data buffer padding is cleared up to the block size. The out of bounds write is possible if the data buffers size is not a multiple of the block size. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b8b5ae0 - Browse repository at this point
Copy the full SHA b8b5ae0View commit details -
bcachefs: Fix some refcounting bugs
We really need debug mode assertions that ca->ref and ca->io_ref are used correctly. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 733f2e9 - Browse repository at this point
Copy the full SHA 733f2e9View commit details -
The trigger for reflink pointers wasn't always incrementing/decrementing the refcounts correctly - this patch fixes that logic. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e478e21 - Browse repository at this point
Copy the full SHA e478e21View commit details -
bcachefs: Fix bch2_btree_iter_peek_with_updates()
By not re-fetching the next update we were going into an infinite loop. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7083c94 - Browse repository at this point
Copy the full SHA 7083c94View commit details -
bcachefs: Make sure to use BTREE_ITER_PREFETCH in fsck
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d7808dd - Browse repository at this point
Copy the full SHA d7808ddView commit details -
bcachefs: avoid out-of-bounds in split_devs
Calling mount with an empty source string causes an out-of-bounds error in split_devs. Check the length of the source string to avoid this. Signed-off-by: Stijn Tintel <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9ee502c - Browse repository at this point
Copy the full SHA 9ee502cView commit details -
bcachefs: Fix error in parsing of mount options
When parsing the mount options duplicate the given options. This is required as the options are parsed twice and strsep is used in parsing. The options will be modified into a possibly invalid options set for the second round of parsing if the options are not duplicated before parsing. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2a0d803 - Browse repository at this point
Copy the full SHA 2a0d803View commit details -
bcachefs: Fix possible null deref on mount
Ensure that the block device pointer in a superblock handle is not null before dereferencing it in bch2_dev_to_fs. The block device pointer may be null when mounting a new bcachefs filesystem given another mounted bcachefs filesystem exists that has at least one device that is offline. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8f02ea1 - Browse repository at this point
Copy the full SHA 8f02ea1View commit details -
bcachefs: Fix null deref in bch2_ioctl_read_super
Do not attempt to cleanup the returned value of bch2_device_lookup if the returned value was an error pointer. We currently check to see if the returned value is null and run the cleanup otherwise. As a result, we attempt to run the cleanup on a error pointer. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4c7ae97 - Browse repository at this point
Copy the full SHA 4c7ae97View commit details -
bcachefs: Fix out of bounds read in fs usage ioctl
Fix a possible read out of bounds if bch2_ioctl_fs_usage is called when replica_entries_bytes is set to a value that is smaller than the size of bch_replicas_usage. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c7e8d12 - Browse repository at this point
Copy the full SHA c7e8d12View commit details -
bcachefs: Repair code for multiple types of data in same bucket
bch2_check_fix_ptrs() is awkward, we need to find a way to improve it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for edbffcf - Browse repository at this point
Copy the full SHA edbffcfView commit details -
bcachefs: properly initialize used values
- Ensure the second key value in bch_hash_info is initialized to zero if the info type is of type BCH_STR_HASH_SIPHASH. - Initialize the possibly returned value in bch2_inode_create. Assuming bch2_btree_iter_peek returns bkey_s_c_null, the uninitialized value of ret could be returned to the user as an error pointer. - Fix compiler warning in initialization of bkey_s_c_stripe fs/bcachefs/buckets.c:1646:35: warning: suggest braces around initialization of subobject [-Wmissing-braces] struct bkey_s_c_stripe new_s = { NULL }; ^~~~ Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 64a2827 - Browse repository at this point
Copy the full SHA 64a2827View commit details -
bcachefs: Fix locking in __bch2_set_nr_journal_buckets()
We weren't holding mark_lock correctly - it's needed for the new_fs path. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 13b2b40 - Browse repository at this point
Copy the full SHA 13b2b40View commit details -
bcachefs: made changes to support clang, fixed a couple bugs
fs/bcachefs/bset.c edited prefetch macro to add clang support fs/bcachefs/btree_iter.c bugfix: initialize iter->real_pos in bch2_btree_iter_init for later use fs/bcachefs/io.c bugfix: eliminated undefined behavior (negative bitshift) fs/bcachefs/buckets.c bugfix: invert sign to handle 64bit abs()
Configuration menu - View commit details
-
Copy full SHA for b2a642a - Browse repository at this point
Copy the full SHA b2a642aView commit details -
bcachefs: Make sure to pass a disk reservation to bch2_extent_update()
It's needed when we split an existing compressed extent - we get a null ptr deref without it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 996f94c - Browse repository at this point
Copy the full SHA 996f94cView commit details -
bcachefs: Fix bch2_extent_can_insert() call
It was being skipped when hole punching, leading to problems when splitting compressed extents. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 6f96270 - Browse repository at this point
Copy the full SHA 6f96270View commit details -
Not supposed to pass a null ptr to memcpy (even if the size is 0). Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8b95065 - Browse repository at this point
Copy the full SHA 8b95065View commit details -
bcachefs: Fix for bch2_bkey_pack_pos() not initializing len/version f…
…ields This bug led to push_whiteout() generating whiteouts that failed bch2_bkey_invalid() due to nonzero length fields - oops. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 007fef9 - Browse repository at this point
Copy the full SHA 007fef9View commit details -
bcachefs: statfs resports incorrect avail blocks
The current implementation of bch_statfs does not scale the number of available blocks provided in f_bavail by the reserve factor. This causes an allocation of a file of this size to fail. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7e54fc8 - Browse repository at this point
Copy the full SHA 7e54fc8View commit details -
bcachefs: Move io_in_flight ratelimiting to fs-io.c
This fixes a bug where an async O_DIRECT write that required multiple bch2_write calls could deadlock, because bch2_write runs out of the same workqueue used for index updates and would block on the io_in_flight semaphore. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9ff85d2 - Browse repository at this point
Copy the full SHA 9ff85d2View commit details -
bcachefs: Split extents if necessary in bch2_trans_update()
Currently, we handle multiple overlapping extents in the same transaction commit by doing fixups in bch2_trans_update() - this patch extents that to split updates when necessary. The next patch that changes the reflink code to not fragment extents when making them indirect will require this. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 821cc23 - Browse repository at this point
Copy the full SHA 821cc23View commit details -
bcachefs: Make bch2_remap_range respect O_SYNC
Caught by xfstest generic/628 Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7439d73 - Browse repository at this point
Copy the full SHA 7439d73View commit details -
bcachefs: Fix inode backpointers in RENAME_OVERWRITE
When we delete the dirent an inode points to, we need to zero out the backpointer fields - this was missed in the RENAME_OVERWRITE case. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 69fff7b - Browse repository at this point
Copy the full SHA 69fff7bView commit details -
bcachefs: Fix for buffered writes getting -ENOSPC
Buffered writes may have to increase their disk reservation at btree update time, due to compression and erasure coding being unpredictable: O_DIRECT writes should be checking for -ENOSPC, but buffered writes have already been accepted and should not. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 60bbb53 - Browse repository at this point
Copy the full SHA 60bbb53View commit details -
bcachefs: Fix an uninitialized var
this fixes a valgrind complaint Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5190b9f - Browse repository at this point
Copy the full SHA 5190b9fView commit details -
bcachefs: Don't repair btree nodes until after interior journal repla…
…y is done We need the btree to be in a consistent state before we can rewrite btree nodes. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ad96f40 - Browse repository at this point
Copy the full SHA ad96f40View commit details -
bcachefs: Add a debug mode that always reads from every btree replica
There's a new module parameter, verify_all_btree_replicas, that enables reading from every btree replica when reading in btree nodes and comparing them against each other. We've been seeing some strange btree corruption - this will hopefully aid in tracking it down and catching it more often. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c52d87d - Browse repository at this point
Copy the full SHA c52d87dView commit details -
Configuration menu - View commit details
-
Copy full SHA for befc457 - Browse repository at this point
Copy the full SHA befc457View commit details -
bcachefs: Add a workqueue for btree io completions
Also, clean up workqueue usage - we shouldn't be using system workqueues, pretty much everything we do needs to be on our own WQ_MEM_RECLAIM workqueues. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 395fc34 - Browse repository at this point
Copy the full SHA 395fc34View commit details -
bcachefs: Improve FS_IOC_GOINGDOWN ioctl
We weren't interpreting the flags argument at all. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ed68469 - Browse repository at this point
Copy the full SHA ed68469View commit details -
bcachefs: Fix an issue with inconsistent btree writes after unclean s…
…hutdown After unclean shutdown, btree writes may have completed on one device and not others - and this inconsistency could lead us to writing new bsets with a gap in our btree node in one of our replicas. Fortunately, this is only an issue with bsets that are newer than the most recent journal flush, and we already have a mechanism for detecting and blacklisting those. We just need to make sure to start new btree writes after the most recent _non_ blacklisted bset. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a97786d - Browse repository at this point
Copy the full SHA a97786dView commit details -
bcachefs: Fix a null ptr deref
bch2_btree_iter_peek() won't always return a key - whoops. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bae26d0 - Browse repository at this point
Copy the full SHA bae26d0View commit details -
bcachefs: Add a cond_resched call to the copygc main loop
We seem to have a bug where the copygc thread ends up spinning and making the system unusable - this will at least prevent it from locking up the machine, and it's a good thing to have anyways. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3ee65ca - Browse repository at this point
Copy the full SHA 3ee65caView commit details -
bcachefs: Add a tracepoint for copygc waiting
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 863a13a - Browse repository at this point
Copy the full SHA 863a13aView commit details -
bcachefs: Don't use uuid in tracepoints
%pU for printing out pointers to uuids doesn't work in perf trace Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5d7af0d - Browse repository at this point
Copy the full SHA 5d7af0dView commit details -
bcachefs: Add an option to control sharding new inode numbers
We're seeing a bug where inode creates end up spinning in bch2_inode_create - disabling sharding will simplify what we're testing. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3d30afa - Browse repository at this point
Copy the full SHA 3d30afaView commit details -
bcachefs: Reflink refcount fix
__bch2_trans_mark_reflink_p wasn't always correctly returning the number of sectors processed - the new logic is a bit more straightforward overall too. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0a33d62 - Browse repository at this point
Copy the full SHA 0a33d62View commit details -
bcachefs: Fix journal write error path
Journal write errors were racing with the submission path - potentially causing writes to other replicas to not get submitted. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e2085a3 - Browse repository at this point
Copy the full SHA e2085a3View commit details -
bcachefs: Fix pathalogical behaviour with inode sharding by cpu ID
If the transactior restarts on a different CPU, it could end up needing to read in a different btree node, which makes another transaction restart more likely... Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ae8b7c9 - Browse repository at this point
Copy the full SHA ae8b7c9View commit details -
bcachefs: Split out btree_error_wq
We can't use btree_update_wq becuase btree updates may be waiting on btree writes to complete. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for de0c6e3 - Browse repository at this point
Copy the full SHA de0c6e3View commit details -
Waiting on a btree node write with btree locks held can deadlock, if the write errors: the write error path has to do do a btree update to drop the pointer to the replica that errored. The interior update path has to wait on in flight btree writes before freeing nodes on disk. Previously, this was done in bch2_btree_interior_update_will_free_node(), and could deadlock; now, we just stash a pointer to the node and do it in btree_update_nodes_written(), just prior to the transactional part of the update.
Configuration menu - View commit details
-
Copy full SHA for 6435a72 - Browse repository at this point
Copy the full SHA 6435a72View commit details -
bcachefs: Assorted endianness fixes
Found by sparse Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 8d273c8 - Browse repository at this point
Copy the full SHA 8d273c8View commit details -
bcachefs: Fsck for reflink refcounts
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0c6d9ae - Browse repository at this point
Copy the full SHA 0c6d9aeView commit details -
bcachefs: Don't fragment extents when making them indirect
This fixes a "disk usage increased without a reservation" bug, when reflinking compressed extents. Also, there's no good reason for reflink to be fragmenting extents anyways. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for dc021d9 - Browse repository at this point
Copy the full SHA dc021d9View commit details -
bcachefs: Journal space calculation fix
When devices have different bucket sizes, we may accumulate a journal write that doesn't fit on some of our devices - previously, we'd underflow when calculating space on that device and then everything would get weird. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b9d973d - Browse repository at this point
Copy the full SHA b9d973dView commit details -
bcachefs; Check for allocator thread shutdown
We were missing a kthread_should_stop() check in the loop in bch2_invalidate_buckets(), very occasionally leading to us getting stuck while shutting down. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9e3db6f - Browse repository at this point
Copy the full SHA 9e3db6fView commit details -
bcachefs: Check for errors from bch2_trans_update()
Upcoming refactoring is going to change bch2_trans_update() to start returning transaction restarts. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 810c3ce - Browse repository at this point
Copy the full SHA 810c3ceView commit details -
bcachefs: Preallocate transaction mem
This helps avoid transaction restarts. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a0750e0 - Browse repository at this point
Copy the full SHA a0750e0View commit details -
bcachefs: Improve btree iterator tracepoints
This patch adds some new tracepoints to the btree iterator code, and adds new fields to the existing tracepoints - primarily for the iterator position. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for eddf0c7 - Browse repository at this point
Copy the full SHA eddf0c7View commit details -
bcachefs: btree_iter->should_be_locked
Add a field to struct btree_iter for tracking whether it should be locked - this fixes spurious transaction restarts in bch2_trans_relock(). Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fb80180 - Browse repository at this point
Copy the full SHA fb80180View commit details -
bcachefs: do not compile acl mod on minimal config
Do not compile the acl.o target if BCACHEFS_POSIX_ACL is not enabled. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 2ce5d8e - Browse repository at this point
Copy the full SHA 2ce5d8eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8069a2f - Browse repository at this point
Copy the full SHA 8069a2fView commit details -
bcachefs: Fix a spurious debug mode assertion
When we switched to using bch2_btree_bset_insert_key() for extents it turned out it started leaving invalid keys around - of type deleted but nonzero size - but this is fine (if ugly) because they're never written out. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 86c48b6 - Browse repository at this point
Copy the full SHA 86c48b6View commit details -
bcachefs: Don't mark superblocks past end of usable space
bcachefs-tools recently started putting a backup superblock at the end of the device. This causes a problem if the bucket size doesn't divide the device size - but we can fix it by just skipping marking that part. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e6acff9 - Browse repository at this point
Copy the full SHA e6acff9View commit details
Commits on Jun 10, 2021
-
bcachefs: Fix a buffer overrun
In make_extent_indirect(), we were allocating too small of a buffer for the new indirect extent. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cc5002f - Browse repository at this point
Copy the full SHA cc5002fView commit details -
bcachefs: More topology repair code
This improves the handling of overlapping btree nodes; now, we handle the case where one btree node completely overwrites another. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9c79512 - Browse repository at this point
Copy the full SHA 9c79512View commit details -
bcachefs: Drop all btree locks when submitting btree node reads
As a rule we don't want to be holding btree locks while submitting IO - this will improve overall filesystem latency. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 701b9bd - Browse repository at this point
Copy the full SHA 701b9bdView commit details -
bcachefs: Child btree iterators
This adds the ability for btree iterators to own child iterators - to be used by an upcoming rework of bch2_btree_iter_peek_slot(), so we can scan forwards while maintaining our current position. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f2309da - Browse repository at this point
Copy the full SHA f2309daView commit details -
bcachefs: BTREE_ITER_WITH_UPDATES
This drops bch2_btree_iter_peek_with_updates() and replaces it with a new flag, BTREE_ITER_WITH_UPDATES, and also reworks bch2_btree_iter_peek_slot() to respect it too. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 22dff78 - Browse repository at this point
Copy the full SHA 22dff78View commit details -
bcachefs: Move extent_handle_overwrites() to bch2_trans_update()
This lifts handling of overlapping extents out of __bch2_trans_commit() and moves it to where we first do the update - which means that BTREE_ITER_WITH_UPDATES can now work correctly in extents mode. Also, this patch reworks how extent triggers work: previously, on partial extent overwrite we would pass this information to the trigger, telling it what part of the extent was being overwritten. But, this approach has had too many subtle corner cases - now, we only mark whole extents, meaning on partial extent overwrite we unmark the old extent and mark the new extent. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f85b069 - Browse repository at this point
Copy the full SHA f85b069View commit details -
bcachefs: Simplify reflink trigger
Now that we only mark entire extents, we can ditch the "reflink_p_frag_references" code. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4dd2810 - Browse repository at this point
Copy the full SHA 4dd2810View commit details -
bcachefs: Kill trans->updates2
Now that extent handling has been lifted to bch2_trans_update(), we don't need to keep two different lists of updates. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 14d6699 - Browse repository at this point
Copy the full SHA 14d6699View commit details -
bcachefs: Clean up key merging
This patch simplifies the key merging code by getting rid of partial merges - it's simpler and saner if we just don't merge extents when they'd overflow k->size. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3ce082f - Browse repository at this point
Copy the full SHA 3ce082fView commit details -
bcachefs: Re-implement extent merging in transaction commit path
We haven't had extent merging in quite some time. It used to be done by the btree code when sorting btree nodes, but that was eliminated as part of the work to separate extent handling from core btree code. This patch re-implements extent merging in the transaction commit path. We don't currently have the ability to merge reflink pointers, we need to do some work on the triggers code to be able to do that without ending up with incorrect refcounts. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7f6e5ae - Browse repository at this point
Copy the full SHA 7f6e5aeView commit details -
bcachefs: Improved extent merging
Previously, checksummed extents could only be merged when the checksum covered only the currently live data. xfstest generic/064 creates a test file, then uses finsert calls to split the extent, then collapse calls to see if they get merged. But without any reads to trigger the narrow_crcs path, each of the split extents will still have a checksum for the entire original extent. This patch improves the extent merge path so that if either of the extents we're attempting to merge has a checksum that covers the entire merged extent, we just use that checksum. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3f1bf37 - Browse repository at this point
Copy the full SHA 3f1bf37View commit details -
bcachefs: Merging for indirect extents
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 161ef31 - Browse repository at this point
Copy the full SHA 161ef31View commit details -
bcachefs: Always zero memory from bch2_trans_kmalloc()
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 69be0da - Browse repository at this point
Copy the full SHA 69be0daView commit details
Commits on Jun 11, 2021
-
bcachefs: Fix overflow in journal_replay_entry_early
If filesystem on disk was used by a version with a larger BCH_DATA_NR thas the currently running version, we don't want this to cause a buffer overrun. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 95fc50b - Browse repository at this point
Copy the full SHA 95fc50bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 484f2c4 - Browse repository at this point
Copy the full SHA 484f2c4View commit details
Commits on Jun 12, 2021
-
bcachefs: Fix null ptr deref when splitting compressed extents
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bbadb5e - Browse repository at this point
Copy the full SHA bbadb5eView commit details -
bcachefs: mount: fix null deref with null devname
- Fix null deref on mount when given a null device name. - Move the dev_name checks to return EINVAL when it is invalid. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 78779c3 - Browse repository at this point
Copy the full SHA 78779c3View commit details -
bcachefs: Allow shorter JSET_ENTRY_dev_usage entries
If the last entry(ies) would be all zeros, there's no need to write them out - the read path already handles that. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b00cf89 - Browse repository at this point
Copy the full SHA b00cf89View commit details -
bcachefs: Kill bch2_btree_iter_peek_cached()
It's now been rolled into bch2_btree_iter_peek_slot() Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 9e9ad82 - Browse repository at this point
Copy the full SHA 9e9ad82View commit details
Commits on Jun 13, 2021
-
bcachefs: Don't underflow c->sectors_available
This rarely used error path should've been checking for underflow - oops. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 936a644 - Browse repository at this point
Copy the full SHA 936a644View commit details -
bcachefs: Clear iter->should_be_locked in bch2_trans_reset
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f1c2b21 - Browse repository at this point
Copy the full SHA f1c2b21View commit details -
bcachefs: fix a possible bcachefs checksum mapping error opt-checksum…
… enum to type-checksum enum This fixes some rare cases where the metadata checksum option specified may map to the wrong actual checksum type. Signed-Off By: Janpieter Sollie <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a881a9c - Browse repository at this point
Copy the full SHA a881a9cView commit details
Commits on Jun 14, 2021
-
bcachefs: Fix a memory leak in dio write path
Commit c42bca9 "bio: don't copy bvec for direct IO" changed bio_iov_iter_get_pages() to point bio->bi_iovec at the incoming biovec, meaning if we already allocated one, it'll be leaked. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3902501 - Browse repository at this point
Copy the full SHA 3902501View commit details -
bcachefs: Make sure bch2_trans_mark_update uses correct iter flags
Now that bch2_btree_iter_peek_with_updates() has been removed in favor of BTREE_ITER_WITH_UPDATES, we need to make sure it's not used where we don't want it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 32de9f8 - Browse repository at this point
Copy the full SHA 32de9f8View commit details -
bcachefs: Kill __btree_delete_at()
With trans->updates2 gone, we can now drop this helper and use bch2_btree_delete_at() instead. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e9761f8 - Browse repository at this point
Copy the full SHA e9761f8View commit details
Commits on Jun 15, 2021
-
bcachefs: Improve iter->should_be_locked
Adding iter->should_be_locked introduced a regression where it ended up not being set on the iterator passed to bch2_btree_update_start(), which is definitely not what we want. This patch requires it to be set when calling bch2_trans_update(), and adds various fixups to make that happen. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ee8c024 - Browse repository at this point
Copy the full SHA ee8c024View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e0a69c - Browse repository at this point
Copy the full SHA 3e0a69cView commit details -
bcachefs: fix truncate with ATTR_MODE
After the v5.12 rebase, we started oopsing when truncate was passed ATTR_MODE, due to not passing mnt_userns to setattr_copy(). This refactors things so that truncate/extend finish by using bch2_setattr_nonsize(), which solves the problem. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e256ef2 - Browse repository at this point
Copy the full SHA e256ef2View commit details -
bcachefs: Extensive triggers cleanups
- We no longer mark subsets of extents, they're marked like regular keys now - which means we can drop the offset & sectors arguments to trigger functions - Drop other arguments that are no longer needed anymore in various places - fs_usage - Drop the logic for handling extents in bch2_mark_update() that isn't needed anymore, to match bch2_trans_mark_update() - Better logic for hanlding the BTREE_ITER_CACHED_NOFILL case, where we don't have an old key to mark Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 95ab81d - Browse repository at this point
Copy the full SHA 95ab81dView commit details -
bcachefs: Don't disable preemption unnecessarily
Small improvements to some percpu utility code. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for bf09fd4 - Browse repository at this point
Copy the full SHA bf09fd4View commit details
Commits on Jun 16, 2021
-
fixup! bcachefs: More topology repair code
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 154c7c7 - Browse repository at this point
Copy the full SHA 154c7c7View commit details
Commits on Jun 17, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 4cc1334 - Browse repository at this point
Copy the full SHA 4cc1334View commit details -
bcachefs: ensure iter->should_be_locked is set
Ensure that iter->should_be_locked value is set to true before we call bch2_trans_update in ec_stripe_update_ptrs. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1a54de9 - Browse repository at this point
Copy the full SHA 1a54de9View commit details
Commits on Jun 21, 2021
-
bcachefs: Don't ratelimit certain fsck errors
It's unhelpful if we see "Halting mark and sweep to start topology repair" but we don't see the error that triggered it. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 39ad803 - Browse repository at this point
Copy the full SHA 39ad803View commit details -
bcachefs: Start journal reclaim thread earlier
Especially in userspace, we sometime run into resource exhaustion issues with starting up threads after mark and sweep/fsck. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 775b36b - Browse repository at this point
Copy the full SHA 775b36bView commit details
Commits on Jun 22, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 0df0b04 - Browse repository at this point
Copy the full SHA 0df0b04View commit details
Commits on Jun 23, 2021
-
bcachefs: Don't loop into topology repair
Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 1054926 - Browse repository at this point
Copy the full SHA 1054926View commit details -
bcachefs: Fix btree_node_read_all_replicas() error handling
We weren't checking bch2_btree_node_read_done() for errors, oops. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 49e4c3b - Browse repository at this point
Copy the full SHA 49e4c3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for ca3cfad - Browse repository at this point
Copy the full SHA ca3cfadView commit details
Commits on Jun 24, 2021
-
bcachefs: Fix shift-by-64 in bch2_bkey_format_validate()
We need to ensure that packed formats can't represent fields larger than the unpacked format, which is a bit tricky since the calculations can also overflow a u64. This patch fixes a shift and simplifies the overall calculations. Signed-off-by: Kent Overstreet <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cec8dcc - Browse repository at this point
Copy the full SHA cec8dccView commit details -
bcachefs: statfs bfree and bavail should be the same
The value of f_bfree and f_bavail should be the same. The value of f_bfree is not currently scaled by the availability factor. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c7dea9c - Browse repository at this point
Copy the full SHA c7dea9cView commit details
Commits on Jun 25, 2021
-
bcachefs: Fix bch2_acl_chmod() cleanup on error
Avoid calling kfree on the returned error pointer if bch2_acl_from_disk fails. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 21578ad - Browse repository at this point
Copy the full SHA 21578adView commit details
Commits on Jun 27, 2021
-
bcachefs: fix initial page state after falloc
When initializing the page state, set the page sectors state to that of what exists in the btree. This allows us to check if the backing extent was already allocated before adding to the inode i_blocks value. Signed-off-by: Dan Robertson <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 3fe6e97 - Browse repository at this point
Copy the full SHA 3fe6e97View commit details