summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-05-01 10:07:07 +0900
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>2010-05-01 13:37:19 +0900
commitc116110daeabe6e1429e98061504c2692518f2d6 (patch)
tree30a3a910cf22fb616ae27d82207bced15b1b85c5 /fs
parent75368c8473676abfa212621bdcd79df5a8e7177e (diff)
nilfs2: add missing endian conversion on super block magic number
This adds missing endian conversions in comparision of the magic number of super blocks. It was coincidence that prior versions didn't incur problems; the upper byte of the magic number happened to be equal to the lower byte. But, semantically it's wrong to depend on this. This won't change anything else nor suffer any compatibility issues. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs')
-rw-r--r--fs/nilfs2/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index 51f3802cd4b8..f6cff39f29cd 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -242,8 +242,8 @@ int nilfs_commit_super(struct nilfs_sb_info *sbi, int dupsb)
int err;
/* nilfs->sem must be locked by the caller. */
- if (sbp[0]->s_magic != NILFS_SUPER_MAGIC) {
- if (sbp[1] && sbp[1]->s_magic == NILFS_SUPER_MAGIC)
+ if (sbp[0]->s_magic != cpu_to_le16(NILFS_SUPER_MAGIC)) {
+ if (sbp[1] && sbp[1]->s_magic == cpu_to_le16(NILFS_SUPER_MAGIC))
nilfs_swap_super_block(nilfs);
else {
printk(KERN_CRIT "NILFS: superblock broke on dev %s\n",