linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mkfs.btrfs on arm
@ 2012-04-24 14:10 Tobias Arp
  0 siblings, 0 replies; 2+ messages in thread
From: Tobias Arp @ 2012-04-24 14:10 UTC (permalink / raw)
  To: linux-btrfs

Hi,

yesterday i tried mkfs.btrfs on my embedded arm system without success (git clone from 2012-04-24).
I got always this error message (this "bug" where already mentioned some month ago)

mkfs.btrfs /dev/sda1
                                                                              
WARNING! - Btrfs Btrfs v0.19-dirty IS EPERIMENTAL                                             
WARNING! - see http://btrfs.wiki.kernel.org before using                                                                                                                                                                                                                                            
mkfs.btrfs: volumes.c:843: btrfs_alloc_chunk: Assertion `!(ret)' failed.
Aborted                                                                                                                                                                            

I turned aligment warnings on:

echo 1 > /proc/cpu/aligment

so i got this messages:

mkfs.btrfs /dev/sda1
                                                                                                                                                                                                                                           
WARNING! - Btrfs Btrfs v0.19-dirty IS EXPERIMENTAL                                             
WARNING! - see http://btrfs.wiki.kernel.org before using

Alignment trap: mkfs.btrfs (70) PC=0x00039f4c Instr=0xe8820018 Address=0xbebbbae9 FSR 0x813                                                                                                                                                      
Alignment trap: mkfs.btrfs (70) PC=0x00039f4c Instr=0xe8820018 Address=0xbebbbae9 FSR 0x813

mkfs.btrfs: volumes.c:843: btrfs_alloc_chunk: Assertion `!(ret)' failed.
Aborted      

I tracked down the problem and changed this:

--- volumes.c    2012-04-24 15:20:51.404182411 +0200
+++ ../btrfs-progs-test/volumes.c    2012-04-24 15:20:09.492181736 +0200
@@ -402,6 +402,7 @@
     struct btrfs_key key;
     struct btrfs_chunk *chunk;
     struct btrfs_key found_key;
+    u64 u64temp;
 
     path = btrfs_alloc_path();
     BUG_ON(!path);
@@ -427,8 +428,9 @@
         else {
             chunk = btrfs_item_ptr(path->nodes[0], path->slots[0],
                            struct btrfs_chunk);
-            *offset = found_key.offset +
+            u64temp = found_key.offset +
                 btrfs_chunk_length(path->nodes[0], chunk);
+            memcpy(offset,&u64temp,sizeof(u64));
         }
     }
     ret = 0;

But there are many other places where an aligment trap could occur, particularly where packed structures are used
(we will get often elements with adresses which are unaligned). So how can i fix it easily? I don't know much about btrfs so i cannot estimate where it is allowed to change...

Best regards

Tobias


-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a

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

* mkfs.btrfs on arm
@ 2012-04-24 14:15 Tobias Arp
  0 siblings, 0 replies; 2+ messages in thread
From: Tobias Arp @ 2012-04-24 14:15 UTC (permalink / raw)
  To: linux-btrfs

Hi,

yesterday i tried mkfs.btrfs on my embedded arm system without success (git clone from 2012-04-24).
I got always this error message (this "bug" where already mentioned some month ago)

mkfs.btrfs /dev/sda1
                                                                              
WARNING! - Btrfs Btrfs v0.19-dirty IS EPERIMENTAL                                             
WARNING! - see http://btrfs.wiki.kernel.org before using                                                                                                                                                                                                                                            
mkfs.btrfs: volumes.c:843: btrfs_alloc_chunk: Assertion `!(ret)' failed.
Aborted                                                                                                                                                                            

I turned aligment warnings on:

echo 1 > /proc/cpu/aligment

so i got this messages:

mkfs.btrfs /dev/sda1
                                                                                                                                                                                                                                           
WARNING! - Btrfs Btrfs v0.19-dirty IS EXPERIMENTAL                                             
WARNING! - see http://btrfs.wiki.kernel.org before using

Alignment trap: mkfs.btrfs (70) PC=0x00039f4c Instr=0xe8820018 Address=0xbebbbae9 FSR 0x813                                                                                                                                                      
Alignment trap: mkfs.btrfs (70) PC=0x00039f4c Instr=0xe8820018 Address=0xbebbbae9 FSR 0x813

mkfs.btrfs: volumes.c:843: btrfs_alloc_chunk: Assertion `!(ret)' failed.
Aborted      

I tracked down the problem and changed this:

--- volumes.c    2012-04-24 15:20:51.404182411 +0200
+++ ../btrfs-progs-test/volumes.c    2012-04-24 15:20:09.492181736 +0200
@@ -402,6 +402,7 @@
     struct btrfs_key key;
     struct btrfs_chunk *chunk;
     struct btrfs_key found_key;
+    u64 u64temp;
 
     path = btrfs_alloc_path();
     BUG_ON(!path);
@@ -427,8 +428,9 @@
         else {
             chunk = btrfs_item_ptr(path->nodes[0], path->slots[0],
                            struct btrfs_chunk);
-            *offset = found_key.offset +
+            u64temp = found_key.offset +
                 btrfs_chunk_length(path->nodes[0], chunk);
+            memcpy(offset,&u64temp,sizeof(u64));
         }
     }
     ret = 0;

But there are many other places where an aligment trap could occur, particularly where packed structures are used
(we will get often elements with adresses which are unaligned). So how can i fix it easily? I don't know much about btrfs so i cannot estimate where it is allowed to change...

Best regards

Tobias


-- 
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!                                  
Jetzt informieren: http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a


-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

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

end of thread, other threads:[~2012-04-24 14:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-24 14:15 mkfs.btrfs on arm Tobias Arp
  -- strict thread matches above, loose matches on Subject: below --
2012-04-24 14:10 Tobias Arp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).