Browse Source

Merge upstream version 23

Christoph Biedl 7 years ago
parent
commit
0cd12b037b
4 changed files with 59 additions and 6 deletions
  1. 10 0
      NEWS
  2. 2 4
      aoe.c
  3. 36 0
      sparsefile
  4. 11 2
      vblade.8

+ 10 - 0
NEWS

@@ -1,4 +1,14 @@
 -*- change-log -*-
+2015-06-14 Ed Cashin <ed.cashin@acm.org>
+	Add convenience script for creating sparse files
+	vblade-23
+
+2015-02-25 Catalin Salgau <csalgau@users.sourceforge.net>
+	Warn about Windows problem with CHS misalignment
+
+2014-09-13 Ed Cashin <ed.cashin@acm.org>
+	code cleanup: remove unused variables
+
 2014-08-10 Ed Cashin <ed.cashin@acm.org>
 	vblade-22
 

+ 2 - 4
aoe.c

@@ -237,11 +237,9 @@ static int
 aoemask(Aoemask *mh, int len)
 {
 	Mdir *md, *mdi, *mde;
-	uchar *e;
 	int i, n;
 
 	n = 0;
-	e = (uchar *) mh + len;
 	md = mdi = (Mdir *) ((uchar *)mh + Nmaskhdr);
 	switch (mh->cmd) {
 	case Medit:
@@ -449,7 +447,7 @@ rrok(uchar *ea)
 }
 
 void
-setserial(char *f, int sh, int sl)
+setserial(int sh, int sl)
 {
 	char h[32];
 
@@ -515,7 +513,7 @@ main(int argc, char **argv)
 	}
 	shelf = atoi(argv[0]);
 	slot = atoi(argv[1]);
-	setserial(argv[3], shelf, slot);
+	setserial(shelf, slot);
 	size = getsize(bfd);
 	size /= 512;
 	if (size <= offset) {

+ 36 - 0
sparsefile

@@ -0,0 +1,36 @@
+#! /bin/sh
+# sparsefile - create sparse files conveniently
+#
+# depends on dd and dc commands.
+
+usage() {
+	echo "usage: `basename $0` {10M|10G|10T} {filename}" 1>&2
+}
+size=$1
+if test "$size" = "-h"; then
+	usage
+	exit
+fi
+fnam=$2
+
+die() {
+	usage
+	exit 1
+}
+set -e
+units=`echo "$size" | sed 's!.*\(.\)$!\1!'`
+n=`echo "$size" | sed 's!\(.*\).$!\1!'`
+test "$units" && test "$n" && test "$units" != "$n" || die
+case "$units" in
+M)
+	seek=`echo "$n 1024 * 1 - p" | dc` ;;
+G)
+	seek=`echo "$n 1024 1024 * * 1 - p" | dc` ;;
+T)
+	seek=`echo "$n 1024 1024 1024 * * * 1 - p" | dc` ;;
+*)
+	die
+	;;
+esac
+sh -xc "dd bs=1k count=1 if=/dev/zero of=$fnam seek=$seek"
+ls -lh "$fnam"

+ 11 - 2
vblade.8

@@ -77,8 +77,17 @@ background.
 nai:~# vblade 11 1 eth0 /data/3TB
 .fi
 .EE
-.SH BUGS
+.SH NOTES AND WARNINGS
 Users of Jumbo frames should read the README file distributed with
-vblade to learn about a workaround for kernel buffering limitations.
+.I vblade
+to learn about a workaround for kernel buffering limitations.
+.PP
+At least one AoE initiator (WinAoE) has been found to enforce legacy
+CHS geometry for drives by discarding sectors. You should ensure that
+the underlaying regular file or block device size is a multiple of
+8225280 bytes (255 heads, 63 sectors/track, 512 bytes/sector) if you
+encounter filesystem corruption.
+.SH REPORTING BUGS
+Please report bugs to the aoetools-discuss mailing list.
 .SH AUTHOR
 Brantley Coile (brantley@coraid.com)