mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	btrfs: return ENODATA in case RST lookup fails
In case a lookup in the RAID stripe-tree fails, return ENODATA instead of ENOENT to better distinguish stripe-tree lookups from other code paths where we return ENOENT. Suggested-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
		
							parent
							
								
									61b4d75e3c
								
							
						
					
					
						commit
						5e72aabc1f
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -234,7 +234,7 @@ int btrfs_get_raid_extent_offset(struct btrfs_fs_info *fs_info, | |||
| 		found_end = found_logical + found_length; | ||||
| 
 | ||||
| 		if (found_logical > end) { | ||||
| 			ret = -ENOENT; | ||||
| 			ret = -ENODATA; | ||||
| 			goto out; | ||||
| 		} | ||||
| 
 | ||||
|  | @ -280,10 +280,10 @@ int btrfs_get_raid_extent_offset(struct btrfs_fs_info *fs_info, | |||
| 	} | ||||
| 
 | ||||
| 	/* If we're here, we haven't found the requested devid in the stripe. */ | ||||
| 	ret = -ENOENT; | ||||
| 	ret = -ENODATA; | ||||
| out: | ||||
| 	if (ret > 0) | ||||
| 		ret = -ENOENT; | ||||
| 		ret = -ENODATA; | ||||
| 	if (ret && ret != -EIO && !stripe->rst_search_commit_root) { | ||||
| 		btrfs_debug(fs_info, | ||||
| 		"cannot find raid-stripe for logical [%llu, %llu] devid %llu, profile %s", | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Johannes Thumshirn
						Johannes Thumshirn