Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin Skip handling of APPLEUFS_LABEL if it is smaller than a...
details: https://anonhg.NetBSD.org/src/rev/1a75b7b69f38
branches: trunk
changeset: 751316:1a75b7b69f38
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sun Jan 31 16:04:34 2010 +0000
description:
Skip handling of APPLEUFS_LABEL if it is smaller than a device block.
In particular:
- newfs will not try to erase the label
- fsck_ffs will not try to validate the label
This lets newfs and fsck work on 2048-byte-per-sector media.
Does Apple UFS support such media and how?
diffstat:
sbin/fsck_ffs/setup.c | 6 ++++--
sbin/newfs/mkfs.c | 6 +++---
2 files changed, 7 insertions(+), 5 deletions(-)
diffs (54 lines):
diff -r 527b8c1d1b68 -r 1a75b7b69f38 sbin/fsck_ffs/setup.c
--- a/sbin/fsck_ffs/setup.c Sun Jan 31 15:40:08 2010 +0000
+++ b/sbin/fsck_ffs/setup.c Sun Jan 31 16:04:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: setup.c,v 1.89 2009/09/27 17:13:37 bouyer Exp $ */
+/* $NetBSD: setup.c,v 1.90 2010/01/31 16:04:35 mlelstv Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)setup.c 8.10 (Berkeley) 5/9/95";
#else
-__RCSID("$NetBSD: setup.c,v 1.89 2009/09/27 17:13:37 bouyer Exp $");
+__RCSID("$NetBSD: setup.c,v 1.90 2010/01/31 16:04:35 mlelstv Exp $");
#endif
#endif /* not lint */
@@ -554,6 +554,8 @@
/* XXX do we have to deal with APPLEUFS_LABEL_OFFSET not
* being block aligned (CD's?)
*/
+ if (APPLEUFS_LABEL_SIZE % dev_bsize != 0)
+ return 0;
if (bread(fsreadfd, (char *)appleufsblk.b_un.b_fs, label,
(long)APPLEUFS_LABEL_SIZE) != 0)
return 0;
diff -r 527b8c1d1b68 -r 1a75b7b69f38 sbin/newfs/mkfs.c
--- a/sbin/newfs/mkfs.c Sun Jan 31 15:40:08 2010 +0000
+++ b/sbin/newfs/mkfs.c Sun Jan 31 16:04:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkfs.c,v 1.106 2009/05/07 06:56:56 lukem Exp $ */
+/* $NetBSD: mkfs.c,v 1.107 2010/01/31 16:04:34 mlelstv Exp $ */
/*
* Copyright (c) 1980, 1989, 1993
@@ -73,7 +73,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: mkfs.c,v 1.106 2009/05/07 06:56:56 lukem Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.107 2010/01/31 16:04:34 mlelstv Exp $");
#endif
#endif /* not lint */
@@ -603,7 +603,7 @@
tv.tv_sec, 0);
wtfs(APPLEUFS_LABEL_OFFSET/sectorsize,
APPLEUFS_LABEL_SIZE, &appleufs);
- } else {
+ } else if (APPLEUFS_LABEL_SIZE % sectorsize == 0) {
struct appleufslabel appleufs;
/* Look for & zap any existing valid apple ufs labels */
rdfs(APPLEUFS_LABEL_OFFSET/sectorsize,
Home |
Main Index |
Thread Index |
Old Index