FIXING VN AND CCD DEVICES ON HEAD! Re: HEADS up on HEAD

YONETANI Tomokazu qhwt+dfly at les.ath.cx
Mon May 21 08:25:21 PDT 2007


On Mon, May 21, 2007 at 07:55:16AM -0700, Matthew Dillon wrote:
> 
> :
> :dd is a bootstrap tool, so we shouldn't remove <sys/disklabel.h>
> :or buildworld fails on a pre-disklabel-untanglement system.
> :(http://leaf.dragonflybsd.org/mailarchive/commits/2007-05/msg00178.html)
> :
> :Does it compile if you add
> :  #include <sys/disklabel.h>
> :to somewhere near
> :  #include <sys/diskslice.h>
> :?
> :
> :Cheers.
> 
>     Bleh.  I'll run a full compile of HEAD on 1.8.  I was scratching my
>     head as to why dd even needs those headers, but apparently it tries
>     to write-enable the label area for block devices.  Kinda makes me wonder
>     what the point of having a write-protected label area is in the first
>     place if the only program one is likely to use to mess around with it
>     just unconditionally write-enables the area!

. .. and that very part has been ripped many year ago from FreeBSD :)

revision 1.38
date: 2003/01/26 11:13:40;  author: phk;  state: Exp;  lines: +1 -7
Don't call DIOCWLABEL on disks, it is not implemented, and calling it
like this negated any practical value of the feature.
===================================================================
RCS file: dd.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- dd.c	2002/06/30 05:13:52	1.37
+++ dd.c	2003/01/26 11:13:40	1.38
@@ -221,14 +221,8 @@
 		} else {
 			if (type & D_TAPE)
 				io->flags |= ISTAPE;
-			else if (type & (D_DISK | D_MEM)) {
-				if (type & D_DISK) {
-					const int one = 1;
-
-					(void)ioctl(io->fd, DIOCWLABEL, &one);
-				}
+			else if (type & (D_DISK | D_MEM))
 				io->flags |= ISSEEK;
-			}
 			if (S_ISCHR(sb.st_mode) && (type & D_TAPE) == 0)
 				io->flags |= ISCHR;
 		}





More information about the Kernel mailing list