mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	btrfs: assert nowait mode is not used for some btree search functions
Adds nowait asserts to btree search functions which are not used by buffered IO and direct IO paths. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Stefan Roesch <shr@fb.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									965f47aeb5
								
							
						
					
					
						commit
						c922b016f3
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -2164,6 +2164,7 @@ int btrfs_search_old_slot(struct btrfs_root *root, const struct btrfs_key *key,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	lowest_level = p->lowest_level;
 | 
						lowest_level = p->lowest_level;
 | 
				
			||||||
	WARN_ON(p->nodes[0] != NULL);
 | 
						WARN_ON(p->nodes[0] != NULL);
 | 
				
			||||||
 | 
						ASSERT(!p->nowait);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (p->search_commit_root) {
 | 
						if (p->search_commit_root) {
 | 
				
			||||||
		BUG_ON(time_seq);
 | 
							BUG_ON(time_seq);
 | 
				
			||||||
| 
						 | 
					@ -4465,6 +4466,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
 | 
				
			||||||
	int ret = 1;
 | 
						int ret = 1;
 | 
				
			||||||
	int keep_locks = path->keep_locks;
 | 
						int keep_locks = path->keep_locks;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ASSERT(!path->nowait);
 | 
				
			||||||
	path->keep_locks = 1;
 | 
						path->keep_locks = 1;
 | 
				
			||||||
again:
 | 
					again:
 | 
				
			||||||
	cur = btrfs_read_lock_root_node(root);
 | 
						cur = btrfs_read_lock_root_node(root);
 | 
				
			||||||
| 
						 | 
					@ -4645,6 +4647,8 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ASSERT(!path->nowait);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	nritems = btrfs_header_nritems(path->nodes[0]);
 | 
						nritems = btrfs_header_nritems(path->nodes[0]);
 | 
				
			||||||
	if (nritems == 0)
 | 
						if (nritems == 0)
 | 
				
			||||||
		return 1;
 | 
							return 1;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue