All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREE
@ 2018-06-05 10:11 Yevgeny Popovych
  2018-06-05 13:00 ` Marek Behún
  2018-06-13 15:42 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Yevgeny Popovych @ 2018-06-05 10:11 UTC (permalink / raw)
  To: u-boot

This causes errors when translating logical addresses to physical:
  btrfs_map_logical_to_physical: Cannot map logical address <addr> to physical
  btrfs_file_read: Error reading extent

The behavior of btrfs_map_logical_to_physical() is to stop traversing
CHUNK_TREE when it encounters first non-CHUNK_ITEM, which makes
only some portion of CHUNK_ITEMs being read.
Change it to skip over non-chunk items.

Signed-off-by: Yevgeny Popovych <yevgenyp@pointgrab.com>
Cc: Marek Behun <marek.behun@nic.cz>
Cc: Sergey Struzh <sergeys@pointgrab.com>
---
 fs/btrfs/chunk-map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/chunk-map.c b/fs/btrfs/chunk-map.c
index b3b5ef7..beb6a4b 100644
--- a/fs/btrfs/chunk-map.c
+++ b/fs/btrfs/chunk-map.c
@@ -158,7 +158,7 @@ int btrfs_read_chunk_tree(void)
 	do {
 		found_key = btrfs_path_leaf_key(&path);
 		if (btrfs_comp_keys_type(&key, found_key))
-			break;
+			continue;
 
 		chunk = btrfs_path_item_ptr(&path, struct btrfs_chunk);
 		btrfs_chunk_to_cpu(chunk);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREE
  2018-06-05 10:11 [U-Boot] [PATCH] fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREE Yevgeny Popovych
@ 2018-06-05 13:00 ` Marek Behún
  2018-06-13 15:42 ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Behún @ 2018-06-05 13:00 UTC (permalink / raw)
  To: u-boot

Hmm, for some reason there are some items with objectid=0 and type=0
betwenn CHUNK_ITEM_KEYs, and thus the reading breaks before reading all
items. I am not sure if this is an error in our driver or there really
are such items, but yout patch solves this.

Reviewed-by: Marek Behun <marek.behun@nic.cz>

On Tue,  5 Jun 2018 13:11:01 +0300
Yevgeny Popovych <yevgenyp@pointgrab.com> wrote:

> This causes errors when translating logical addresses to physical:
>   btrfs_map_logical_to_physical: Cannot map logical address <addr> to
> physical btrfs_file_read: Error reading extent
> 
> The behavior of btrfs_map_logical_to_physical() is to stop traversing
> CHUNK_TREE when it encounters first non-CHUNK_ITEM, which makes
> only some portion of CHUNK_ITEMs being read.
> Change it to skip over non-chunk items.
> 
> Signed-off-by: Yevgeny Popovych <yevgenyp@pointgrab.com>
> Cc: Marek Behun <marek.behun@nic.cz>
> Cc: Sergey Struzh <sergeys@pointgrab.com>
> ---
>  fs/btrfs/chunk-map.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/chunk-map.c b/fs/btrfs/chunk-map.c
> index b3b5ef7..beb6a4b 100644
> --- a/fs/btrfs/chunk-map.c
> +++ b/fs/btrfs/chunk-map.c
> @@ -158,7 +158,7 @@ int btrfs_read_chunk_tree(void)
>  	do {
>  		found_key = btrfs_path_leaf_key(&path);
>  		if (btrfs_comp_keys_type(&key, found_key))
> -			break;
> +			continue;
>  
>  		chunk = btrfs_path_item_ptr(&path, struct
> btrfs_chunk); btrfs_chunk_to_cpu(chunk);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREE
  2018-06-05 10:11 [U-Boot] [PATCH] fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREE Yevgeny Popovych
  2018-06-05 13:00 ` Marek Behún
@ 2018-06-13 15:42 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2018-06-13 15:42 UTC (permalink / raw)
  To: u-boot

On Tue, Jun 05, 2018 at 01:11:01PM +0300, Yevgeny Popovych wrote:

> This causes errors when translating logical addresses to physical:
>   btrfs_map_logical_to_physical: Cannot map logical address <addr> to physical
>   btrfs_file_read: Error reading extent
> 
> The behavior of btrfs_map_logical_to_physical() is to stop traversing
> CHUNK_TREE when it encounters first non-CHUNK_ITEM, which makes
> only some portion of CHUNK_ITEMs being read.
> Change it to skip over non-chunk items.
> 
> Signed-off-by: Yevgeny Popovych <yevgenyp@pointgrab.com>
> Cc: Marek Behun <marek.behun@nic.cz>
> Cc: Sergey Struzh <sergeys@pointgrab.com>
> Reviewed-by: Marek Behun <marek.behun@nic.cz>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180613/799ac981/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-13 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 10:11 [U-Boot] [PATCH] fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREE Yevgeny Popovych
2018-06-05 13:00 ` Marek Behún
2018-06-13 15:42 ` [U-Boot] " Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.