An error occurred fetching the project authors.
- 11 Dec, 2012 3 commits
-
-
Liu Bo authored
The argument 'tree_mod_log' is not necessary since all of callers enable it. Signed-off-by:
Liu Bo <bo.li.liu@oracle.com> Signed-off-by:
Chris Mason <chris.mason@fusionio.com>
-
Liu Bo authored
Since we don't use MOD_LOG_KEY_REMOVE_WHILE_MOVING to add nritems during rewinding, we should insert a MOD_LOG_KEY_REMOVE operation first. Signed-off-by:
Liu Bo <bo.li.liu@oracle.com> Signed-off-by:
Chris Mason <chris.mason@fusionio.com>
-
Liu Bo authored
Key MOD_LOG_KEY_REMOVE_WHILE_MOVING means that we're doing memmove inside an extent buffer node, and the node's number of items remains unchanged (unless we are inserting a single pointer, but we have MOD_LOG_KEY_ADD for that). So we don't need to increase node's number of items during rewinding, otherwise we may get an node larger than leafsize and cause general protection errors later. Here is the details, - If we do memory move for inserting a single pointer, we need to add node's nritems by one, and we honor MOD_LOG_KEY_ADD for adding. - If we do memory move for deleting a single pointer, we need to decrease node's nritems by one, and we honor MOD_LOG_KEY_REMOVE for deleting. - If we do memory move for balance left/right, we need to decrease node's nritems, and we honor MOD_LOG_KEY_REMOVE for balaning. Signed-off-by:
Liu Bo <bo.li.liu@oracle.com> Signed-off-by:
Chris Mason <chris.mason@fusionio.com>
-
- 25 Oct, 2012 1 commit
-
-
Liu Bo authored
After cloning root's node, we forgot to dec the src's ref which can lead to a memory leak. Signed-off-by:
Liu Bo <bo.li.liu@oracle.com> Signed-off-by:
Chris Mason <chris.mason@fusionio.com>
-
- 24 Oct, 2012 4 commits
-
-
Jan Schmidt authored
Emphasis the way tree_mod_log_insert_move avoids adding MOD_LOG_KEY_REMOVE_WHILE_MOVING operations, depending on the direction of the move operation. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
In get_old_root we grab a lock on the extent buffer before we obtain a reference on that buffer. That order is changed now. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
In btrfs_find_all_roots' termination condition, we compare the level of the old buffer we got from btrfs_search_old_slot to the level of the current root node. We'd better compare it to the level of the rewinded root node. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
Tree mod log treated old root buffers as always empty buffers when starting the rewind operations. However, the old root may still be part of the current tree at a lower level, with still some valid entries. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
- 23 Oct, 2012 2 commits
-
-
Jan Schmidt authored
Avoid the implicit free by tree_mod_log_set_root_pointer, which is wrong in two places. Where needed, we call tree_mod_log_free_eb explicitly now. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
Independant of the check (push_items < src_items) tree_mod_log_eb_copy did log the removal of the old data entries from the source buffer. Therefore, we must not call tree_mod_log_eb_move if the check evaluates to true, as that would log the removal twice, finally resulting in (rewinded) buffers with wrong values for header_nritems. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
- 09 Oct, 2012 1 commit
-
-
Robin Dong authored
The function btrfs_insert_some_items() would not be called by any other functions, so remove it. Signed-off-by:
Robin Dong <sanbai@taobao.com>
-
- 01 Oct, 2012 1 commit
-
-
Chris Mason authored
The btrfs send code was assuming the offset of the file item into the extent translated to bytes on disk. If we're compressed, this isn't true, and so it was off into extents owned by other files. It was also improperly handling inline extents. This solves a crash where we may have gone past the end of the file extent item by not testing early enough for an inline extent. It also solves problems where we have a whole between the end of the inline item and the start of the full extent. Signed-off-by:
Chris Mason <chris.mason@fusionio.com>
-
- 28 Aug, 2012 2 commits
-
-
Chris Mason authored
When we split a leaf, we may end up inserting a new root on top of that leaf. The reflog code was incorrectly assuming the old root was always a node. This makes sure we skip over leaves. Signed-off-by:
Chris Mason <chris.mason@fusionio.com>
-
Arne Jansen authored
Commit a168650c introduced a waiting mechanism to prevent busy waiting in btrfs_run_delayed_refs. This can deadlock with btrfs_run_ordered_operations, where a tree_mod_seq is held while waiting for the io to complete, while the end_io calls btrfs_run_delayed_refs. This whole mechanism is unnecessary. If not enough runnable refs are available to satisfy count, just return as count is more like a guideline than a strict requirement. In case we have to run all refs, commit transaction makes sure that no other threads are working in the transaction anymore, so we just assert here that no refs are blocked. Signed-off-by:
Arne Jansen <sensille@gmx.net> Signed-off-by:
Chris Mason <chris.mason@fusionio.com>
-
- 25 Jul, 2012 2 commits
-
-
Alexander Block authored
This function is used to find the differences between two trees. The tree compare skips whole subtrees if it detects shared tree blocks and thus is pretty fast. Signed-off-by:
Alexander Block <ablock84@googlemail.com> Reviewed-by:
David Sterba <dave@jikos.cz> Reviewed-by:
Arne Jansen <sensille@gmx.net> Reviewed-by:
Jan Schmidt <list.btrfs@jan-o-sch.net> Reviewed-by:
Alex Lyakas <alex.bolshoy.btrfs@gmail.com>
-
Arne Jansen authored
Often no exact match is wanted but just the next lower or higher item. There's a lot of duplicated code throughout btrfs to deal with the corner cases. This patch adds a helper function that can facilitate searching. Signed-off-by:
Arne Jansen <sensille@gmx.net>
-
- 23 Jul, 2012 1 commit
-
-
Jan Schmidt authored
When calling btrfs_next_old_leaf, we were leaking an extent buffer in the rare case of using the deadlock avoidance code needed for the tree mod log. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by:
Josef Bacik <jbacik@fusionio.com>
-
- 10 Jul, 2012 3 commits
-
-
Arne Jansen authored
Often no exact match is wanted but just the next lower or higher item. There's a lot of duplicated code throughout btrfs to deal with the corner cases. This patch adds a helper function that can facilitate searching. Signed-off-by:
Arne Jansen <sensille@gmx.net>
-
Jan Schmidt authored
We've got two mechanisms both required for reliable backref resolving (tree mod log and holding back delayed refs). You cannot make use of one without the other. So instead of requiring the user of this mechanism to setup both correctly, we join them into a single interface. Additionally, we stop inserting non-blockers into fs_info->tree_mod_seq_list as we did before, which was of no value. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
When calling btrfs_next_old_leaf, we were leaking an extent buffer in the rare case of using the deadlock avoidance code needed for the tree mod log. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
- 27 Jun, 2012 4 commits
-
-
Jan Schmidt authored
With the tree mod log, we may end up with two roots (the current root and a rewinded version of it) both pointing to two leaves, l1 and l2, of which l2 had already been cow-ed in the current transaction. If we don't rewind any tree blocks, we cannot have two roots both pointing to an already cowed tree block. Now there is btrfs_next_leaf, which has a leaf locked and wants a lock on the next (right) leaf. And there is push_leaf_left, which has a (cowed!) leaf locked and wants a lock on the previous (left) leaf. In order to solve this dead lock situation, we use try_lock in btrfs_next_leaf (only in case it's called with a tree mod log time_seq paramter) and if we fail to get a lock on the next leaf, we give up our lock on the current leaf and retry from the very beginning. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
When a MOD_LOG_KEY_ADD operation is rewinded, we remove the key from the tree block. If its not the last key, removal involves a move operation. This move operation was explicitly done before this commit. However, at insertion time, there's a move operation before the actual addition to make room for the new key, which is recorded in the tree mod log as well. This means, we must drop the move operation when rewinding the add operation, because the next operation we'll be rewinding will be the corresponding MOD_LOG_MOVE_KEYS operation. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
Several callers of insert_ptr set the tree_mod_log parameter to 0 to avoid addition to the tree mod log. In fact, we need all of those operations. This commit simply removes the additional parameter and makes addition to the tree mod log unconditional. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
For the tree mod log, we don't log any operations at leaf level. If the root is at the leaf level (i.e. the tree consists only of the root), then __tree_mod_log_oldest_root will find a ROOT_REPLACE operation in the log (because we always log that one no matter which level), but no other operations. With this patch __tree_mod_log_oldest_root exits cleanly instead of BUGging in this situation. get_old_root checks if its really a root at leaf level in case we don't have any operations and WARNs if this assumption breaks. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
- 16 Jun, 2012 1 commit
-
-
Chris Mason authored
gcc was giving an uninit variable warning here. Strictly speaking we don't need to init it, but this will make things much less error prone. Signed-off-by:
Chris Mason <chris.mason@fusionio.com>
-
- 14 Jun, 2012 4 commits
-
-
Jan Schmidt authored
When adding to the tree modification log, we grab two locks at different stages. We must not drop the outer lock until we're done with section protected by the inner lock. This moves the unlock call for the outer lock to the appropriate position. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
To make sense of the tree mod log, the backref walker not only needs btrfs_search_old_slot, but it also called btrfs_next_leaf, which in turn was calling btrfs_search_slot. This obviously didn't give the correct result. This commit adds btrfs_next_old_leaf, a drop-in replacement for btrfs_next_leaf with a time_seq parameter. If it is zero, it behaves exactly like btrfs_next_leaf. If it is non-zero, it will use btrfs_search_old_slot with this time_seq parameter. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
In __tree_mod_log_oldest_root() we must return the found operation even if it's not a ROOT_REPLACE operation. Otherwise, the caller assumes that there are no operations to be rewinded and returns immediately. The code in the caller is modified to improve readability. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
get_old_root could race with root node updates because we weren't locking the node early enough. Use btrfs_read_lock_root_node to grab the root locked in the very beginning and release the lock as soon as possible (just like btrfs_search_slot does). Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
- 04 Jun, 2012 1 commit
-
-
Jan Schmidt authored
This is a leftover from cleanup patch 559af821. Before the cleanup, btrfs_header_nritems was called inside an if condition. As it has no side effects we need to preserve here, it should simply be dropped. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
- 31 May, 2012 4 commits
-
-
Jan Schmidt authored
When we rewind REMOVE_WHILE_FREEING operations, there's code that allocates a fresh buffer instead of cloning the old one. Setting that buffer's level correctly was missing in this case. When rewinding a MOVE_KEYS operation, btrfs_node_key_ptr_offset(slot) was missing for memmove_extent_buffer()'s arguments. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
Logging for del_ptr when we're not deleting the last pointer was wrong. This fixes both, duplicate log entries and log sequence. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
Replace duplicate code by small inline helper function. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
tree_mod_alloc calls __get_tree_mod_seq and must acquire a spinlock before doing so. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
- 30 May, 2012 5 commits
-
-
Tsutomu Itoh authored
btrfs_read_buffer() has the possibility of returning the error. Therefore, I add the code in which the return value of btrfs_read_buffer() is checked. Signed-off-by:
Tsutomu Itoh <t-itoh@jp.fujitsu.com>
-
Jan Schmidt authored
The tree modification log together with the current state of the tree gives a consistent, old version of the tree. btrfs_search_old_slot is used to search through this old version and return old (dummy!) extent buffers. Naturally, this function cannot do any tree modifications. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
Record all relevant modifications to block pointers in the tree mod log so that we can rewind them later on for backref walking. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
When running functions that can make changes to the internal trees (e.g. btrfs_search_slot), we check if somebody may be interested in the block we're currently modifying. If so, we record our modification to be able to rewind it later on. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
Jan Schmidt authored
The tree mod log will log modifications made fs-tree nodes. Most modifications are done by autobalance of the tree. Such changes are recorded as long as a block entry exists. When released, the log is cleaned. With the tree modification log, it's possible to reconstruct a consistent old state of the tree. This is required to do backref walking on a busy file system. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-
- 26 May, 2012 1 commit
-
-
Jan Schmidt authored
Three callers of btrfs_free_tree_block or btrfs_alloc_tree_block passed parameter for_cow = 1. In fact, these two functions should never mark their tree modification operations as for_cow, because they can change the number of blocks referenced by a tree. Hence, we remove the extra for_cow parameter from these functions and make them pass a zero down. Signed-off-by:
Jan Schmidt <list.btrfs@jan-o-sch.net>
-