aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/affs/super.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 8765cba35bb9..5200f4938df0 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -271,6 +271,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
271 int reserved; 271 int reserved;
272 unsigned long mount_flags; 272 unsigned long mount_flags;
273 int tmp_flags; /* fix remount prototype... */ 273 int tmp_flags; /* fix remount prototype... */
274 u8 sig[4];
274 275
275 pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options"); 276 pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
276 277
@@ -370,8 +371,9 @@ got_root:
370 printk(KERN_ERR "AFFS: Cannot read boot block\n"); 371 printk(KERN_ERR "AFFS: Cannot read boot block\n");
371 goto out_error; 372 goto out_error;
372 } 373 }
373 chksum = be32_to_cpu(*(__be32 *)boot_bh->b_data); 374 memcpy(sig, boot_bh->b_data, 4);
374 brelse(boot_bh); 375 brelse(boot_bh);
376 chksum = be32_to_cpu(*(__be32 *)sig);
375 377
376 /* Dircache filesystems are compatible with non-dircache ones 378 /* Dircache filesystems are compatible with non-dircache ones
377 * when reading. As long as they aren't supported, writing is 379 * when reading. As long as they aren't supported, writing is
@@ -420,11 +422,11 @@ got_root:
420 } 422 }
421 423
422 if (mount_flags & SF_VERBOSE) { 424 if (mount_flags & SF_VERBOSE) {
423 chksum = cpu_to_be32(chksum); 425 u8 len = AFFS_ROOT_TAIL(sb, root_bh)->disk_name[0];
424 printk(KERN_NOTICE "AFFS: Mounting volume \"%*s\": Type=%.3s\\%c, Blocksize=%d\n", 426 printk(KERN_NOTICE "AFFS: Mounting volume \"%.*s\": Type=%.3s\\%c, Blocksize=%d\n",
425 AFFS_ROOT_TAIL(sb, root_bh)->disk_name[0], 427 len > 31 ? 31 : len,
426 AFFS_ROOT_TAIL(sb, root_bh)->disk_name + 1, 428 AFFS_ROOT_TAIL(sb, root_bh)->disk_name + 1,
427 (char *)&chksum,((char *)&chksum)[3] + '0',blocksize); 429 sig, sig[3] + '0', blocksize);
428 } 430 }
429 431
430 sb->s_flags |= MS_NODEV | MS_NOSUID; 432 sb->s_flags |= MS_NODEV | MS_NOSUID;