btrfs-progs: check: introduce traversal function for fsck
[platform/upstream/btrfs-progs.git] / disk-io.c
index 77eb0a6..3647ecc 100644 (file)
--- a/disk-io.c
+++ b/disk-io.c
@@ -125,7 +125,7 @@ u32 btrfs_csum_data(struct btrfs_root *root, char *data, u32 seed, size_t len)
 
 void btrfs_csum_final(u32 crc, char *result)
 {
-       *(__le32 *)result = ~cpu_to_le32(crc);
+       put_unaligned_le32(~crc, result);
 }
 
 static int __csum_tree_block_size(struct extent_buffer *buf, u16 csum_size,
@@ -1476,7 +1476,8 @@ static int check_super(struct btrfs_super_block *sb)
                error("invalid bytes_used %llu", btrfs_super_bytes_used(sb));
                goto error_out;
        }
-       if (btrfs_super_stripesize(sb) != 4096) {
+       if ((btrfs_super_stripesize(sb) != 4096)
+               && (btrfs_super_stripesize(sb) != btrfs_super_sectorsize(sb))) {
                error("invalid stripesize %u", btrfs_super_stripesize(sb));
                goto error_out;
        }