summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-10-22bcachefs: Make replicas_delta_list smallerKent Overstreet
2019-10-22bcachefs: Don't submit bio in write path under lockKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-21bcachefs: Drop bch_write_op->io_wqKent Overstreet
This is dead code Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-21bcachefs: Drop old CONFIG_LBDAF requirementKent Overstreet
This doesn't exist anymore Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-20bcachefs: Limit bios in writepages path to 256MKent Overstreet
This works around a bug where bio_full() doesn't check for bio->bi_iter.bi_size overflowing - and, we don't really want to build bios that are that big anyways. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-16bcachefs: Fix an iterator counting bugKent Overstreet
The iterator counting assumed we're doing an obvious optimization when only updating the refcount on indirect extents - but we're not doing it yet. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-12bcachefs: Fix flushing held btree writes when there's a fs errorKent Overstreet
Previously, we'd go into an infinite loop. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-12bcachefs: Fix iterator counting for reflink pointers (again)Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-12bcachefs: Fix a debug assertionKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-11bcachefs: manually clear iterators in delete_range()Kent Overstreet
this is a hack until the iterator lifetime stuff is improved Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-11bcachefs: Switch to .iterate_shared for readdirKent Overstreet
We definitely don't need an exclusive inode lock for readdir. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-11bcachefs: Fix creation of lost+foundKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-11bcachefs: Fix a subtle race in the btree split pathKent Overstreet
We have to free the old (in memory) btree node _before_ unlocking the new nodes - else, some other thread with a read lock on the old node could see stale data after another thread has already updated the new node. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-10bcachefs: Kill bchfs_extent_update()Kent Overstreet
The generic IO path now handles inode updates for i_size and i_sectors - this means we can drop a fair amount of code from fs-io.c. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-10bcachefs: Convert bch2_fpunch to bch2_extent_update()Kent Overstreet
As before - we're moving non Linux specific code out of fs-io.c. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-10bcachefs: Split out bchfs_extent_update()Kent Overstreet
The next few patches are going to be more moving the logic around i_size/i_sectors updates to io.c, and better separating the Linux VFS specific code from core bcachefs code, to better support the fuse port. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-09bcachefs: Kill some dependencies on ei_inodeKent Overstreet
Moving bch2_extent_update() to io.c will be greatly simplified if we no longer have to keep ei_inode.bi_size/bi_sectors up to date. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-09bcachefs: Check if extending inode differentlyKent Overstreet
In bch2_extent_update(), we have to update the inode if i_size is changing (the file is being extend) or if i_sectors is changing, but we want to avoid touching the inode if it's not necessary. Change sum_sector_overwrites() to also check if there's already data above where we're writing to - this means we're definitely not extending the file. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-09bcachefs: Fix bch2_btree_iter_next() after peek_slot()Kent Overstreet
this deserves a unit test Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-09bcachefs: Refactor bch2_readdir() a bitKent Overstreet
The tweaks to ctx->pos handling are also to help the fuse port Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-09bcachefs: Add a lock to bch_page_stateKent Overstreet
We can't use the page lock to protect it, because on writeback IO error we need to access the page state before calling end_page_writeback() and the page lock semantics are completely insane so that deadlocks. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-08bcachefs: Fix erasure coding disk space accountingKent Overstreet
Disk space accounting for erasure coding + compression was completely broken - we need to calculate the parity sectors delta the same way we calculate disk_sectors, by calculating the old and new usage and subtracting to get the difference. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-08bcachefs: Fix ec_stripes_read()Kent Overstreet
The bkey_s_c returned by btree_iter_(peek|next) points into the btree iter type, so advancing the iterator and then using the one previously returned is a bug... Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-08bcachefs: Limit pointers to being in only one stripeKent Overstreet
This make the disk accounting code saner, and it's not clear why we'd ever want the same data to be in multiple stripes simultaneously. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-08bcachefs: Fix bch2_extent_ptr_durability()Kent Overstreet
We were looking up the wrong entry in the stripes radix tree. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-08bcachefs: Fix bch2_mark_extent()Kent Overstreet
If an extent only contained cached or erasure coded pointers, there won't be any devices in the normal dirty replicas list or an entry to update. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-08bcachefs: Add a missing __GFP_NOWARNKent Overstreet
We have a fallback, and we're using GFP_NOWAIT, so we don't want to warn on allocation failure here. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-08bcachefs: Initialize journal pad data in bch_replica_entry objects.Justin Husted
Running the filesystem under valgrind exposed some garbage data being written to disk in bch2_journal_super_entries_add_common(), in the portion which encodes bch_replica_entry objects. Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-10-08bcachefs: Fix uninitialized data in bch2_gc_btree()Justin Husted
Running the filesystem under valgrind exposed a path where the max_stale variable in bch2_gc_btree() might not be initialized before use in a rare case when there are no btree nodes in a transaction. Signed-off-by: Justin Husted <sigstop@gmail.com>
2019-10-07bcachefs: Fix incorrect use of bch2_extent_atomic_end()Kent Overstreet
bch2_extent_atomic_end counts the number of iterators requried for marking overwrites - but journal replay never marks overwrites, so that part was incorrect. And counting iterators for the key being inserted should be unnecessary because we did that prior to the key being inserted before it was first journalled. This should fix an iterator overflow bug - the iterators for walking overwrites were totally unneeded. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-04bcachefs: Can't be holding read locks while taking write locksKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-04bcachefs: Don't allocate memory under mark_lockKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-04bcachefs: bch2_extent_atomic_end() now traverses iterKent Overstreet
This fixes a bug in io.c bch2_write_index_default() - it was missing the traverse call, but bch2_extent_atomic_end returns an error now and can just call it itself. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-04bcachefs: Factor out fs-common.cKent Overstreet
This refactoring makes the code easier to understand by separating the bcachefs btree transactional code from the linux VFS code - but more importantly, it's also to share code with the fuse port. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-04bcachefs: Don't use sha256 for siphash str hash keyKent Overstreet
With the refactoring that's coming to add fuse support, we want bch2_hash_info_init() to be cheaper so we don't have to rely on anything cached besides the inode in the btree. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-04bcachefs: Only look up inode io opts in extents btreeKent Overstreet
We currently don't have a way to propagate inode io opts to indirect extents. This is a problem... Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-04bcachefs: Fix deref of error pointerKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-02bcachefs: bch2_inode_peek()/bch2_inode_write()Kent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-02bcachefs: Fix undefined behaviourKent Overstreet
roundup_pow_of_two(0) is undefined Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-02bcachefs: Fix an error pathKent Overstreet
It's possible to get -EIO in __btree_iter_traverse_all() after looping, with orig_iter NULL. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-02mm: Fix missing xas_nomem() callKent Overstreet
This lead to spurious -ENOMEM errors in the buffered write path - without the xas_nomem() call we only attempt allocating memory with GFP_NOWAIT. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-02bcachefs: Fix __bch2_buffered_write() returning -ENOMEMKent Overstreet
When grab_cache_page_write_begin() fails but we did pin some pages, we shouldn't return -ENOMEM, we should do a partial write. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-02bcachefs: Trust inode in btree over bch_inode_infoKent Overstreet
This is the start of some refactoring work to make less code depend on the linux VFS - here the inode cache - to make e.g. the fuse port easier. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-10-02bcachefs: Fix counting iterators for reflink pointersKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-09-30bcachefs: Rework btree iterator lifetimesKent Overstreet
The btree_trans struct needs to memoize/cache btree iterators, so that on transaction restart we don't have to completely redo btree lookups, and so that we can do them all at once in the correct order when the transaction had to restart to avoid a deadlock. This switches the btree iterator lookups to work based on iterator position, instead of trying to match them up based on the stack trace. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-09-26bcachefs: Kill deferred btree updatesKent Overstreet
Will be replaced by cached btree iterators Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-09-26bcachefs: Fix for partial buffered writesKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-09-25bcachefs: BTREE_ITER_SLOTS isn't a type of btree iterKent Overstreet
2019-09-25bcachefs: Improve error handling for for_each_btree_key_continue()Kent Overstreet
Change it to match for_each_btree_key() Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
2019-09-25bcachefs: Cleanup i_nlink handlingKent Overstreet
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>