path: root/ctree.h
diff options
authorZach Brown <>2013-01-17 11:54:47 -0800
committerZach Brown <>2013-02-05 16:09:32 -0800
commit52162700bb59663add809a6465ce2769d80b3664 (patch)
tree5cd021a31a6e098ee5e9b9c6b47b02f70f3f147d /ctree.h
parent2161e1b6f35d1c084fda49b479951219117c86e9 (diff)
btrfs-progs: treat super.magic as an le64
The super block magic is a le64 whose value looks like an unterminated string in memory. The lack of null termination leads to clumsy use of string functions and causes static analysis tools to warn that the string will be unterminated. So let's just treat it as the le64 that it is. Endian wrappers are used on the constant so that they're compiled into run-time constants. Signed-off-by: Zach Brown <>
Diffstat (limited to 'ctree.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/ctree.h b/ctree.h
index d0f6062f..18b68e1b 100644
--- a/ctree.h
+++ b/ctree.h
@@ -28,7 +28,7 @@
struct btrfs_root;
struct btrfs_trans_handle;
-#define BTRFS_MAGIC "_BHRfS_M"
+#define BTRFS_MAGIC 0x4D5F53665248425F /* ascii _BHRfS_M, no null */