Date: Thu, 10 Feb 2011 15:07:18 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r218522 - in projects/graid/7: . contrib/bsnmp/snmpd contrib/wpa_supplicant gnu/usr.bin/groff/tmac sbin/geom/class/raid share/misc sys/geom/raid tools/tools/nanobsd usr.sbin usr.sbin/bs... Message-ID: <201102101507.p1AF7ISk025748@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Feb 10 15:07:17 2011 New Revision: 218522 URL: http://svn.freebsd.org/changeset/base/218522 Log: MFH r218470, r218472, r218479, r218480, r218481, r218486, r218491, r218504, r218512, r218514, r218515, r218516, r218518, r218519 Modified: projects/graid/7/sbin/geom/class/raid/geom_raid.c projects/graid/7/sbin/geom/class/raid/graid.8 projects/graid/7/sys/geom/raid/g_raid.c projects/graid/7/sys/geom/raid/g_raid.h projects/graid/7/sys/geom/raid/md_intel.c projects/graid/7/sys/geom/raid/tr_raid1.c Directory Properties: projects/graid/7/ (props changed) projects/graid/7/COPYRIGHT (props changed) projects/graid/7/Makefile (props changed) projects/graid/7/Makefile.inc1 (props changed) projects/graid/7/ObsoleteFiles.inc (props changed) projects/graid/7/UPDATING (props changed) projects/graid/7/bin/ (props changed) projects/graid/7/bin/chflags/ (props changed) projects/graid/7/bin/chio/ (props changed) projects/graid/7/bin/cp/ (props changed) projects/graid/7/bin/csh/ (props changed) projects/graid/7/bin/dd/ (props changed) projects/graid/7/bin/df/ (props changed) projects/graid/7/bin/echo/ (props changed) projects/graid/7/bin/expr/ (props changed) projects/graid/7/bin/kill/ (props changed) projects/graid/7/bin/ln/ (props changed) projects/graid/7/bin/ls/ (props changed) projects/graid/7/bin/pax/ (props changed) projects/graid/7/bin/ps/ (props changed) projects/graid/7/bin/rm/ (props changed) projects/graid/7/bin/sh/ (props changed) projects/graid/7/bin/test/ (props changed) projects/graid/7/cddl/contrib/opensolaris/ (props changed) projects/graid/7/cddl/lib/libzpool/ (props changed) projects/graid/7/contrib/bind9/ (props changed) projects/graid/7/contrib/binutils/ (props changed) projects/graid/7/contrib/bsnmp/ (props changed) projects/graid/7/contrib/bsnmp/snmpd/bsnmpd.1 (props changed) projects/graid/7/contrib/cpio/ (props changed) projects/graid/7/contrib/csup/ (props changed) projects/graid/7/contrib/expat/ (props changed) projects/graid/7/contrib/gcc/ (props changed) projects/graid/7/contrib/gdb/ (props changed) projects/graid/7/contrib/gdtoa/ (props changed) projects/graid/7/contrib/groff/ (props changed) projects/graid/7/contrib/ipfilter/ (props changed) projects/graid/7/contrib/less/ (props changed) projects/graid/7/contrib/libpcap/ (props changed) projects/graid/7/contrib/ncurses/ (props changed) projects/graid/7/contrib/netcat/ (props changed) projects/graid/7/contrib/ntp/ (props changed) projects/graid/7/contrib/nvi/ (props changed) projects/graid/7/contrib/pf/ (props changed) projects/graid/7/contrib/sendmail/ (props changed) projects/graid/7/contrib/smbfs/ (props changed) projects/graid/7/contrib/tcp_wrappers/ (props changed) projects/graid/7/contrib/tcsh/ (props changed) projects/graid/7/contrib/telnet/ (props changed) projects/graid/7/contrib/top/ (props changed) projects/graid/7/contrib/traceroute/ (props changed) projects/graid/7/contrib/wpa_supplicant/ (props changed) projects/graid/7/contrib/wpa_supplicant/wpa_supplicant.conf (props changed) projects/graid/7/crypto/openssh/ (props changed) projects/graid/7/crypto/openssl/ (props changed) projects/graid/7/etc/ (props changed) projects/graid/7/games/factor/ (props changed) projects/graid/7/games/fortune/ (props changed) projects/graid/7/games/grdc/ (props changed) projects/graid/7/gnu/ (props changed) projects/graid/7/gnu/lib/libstdc++/ (props changed) projects/graid/7/gnu/usr.bin/ (props changed) projects/graid/7/gnu/usr.bin/cc/ (props changed) projects/graid/7/gnu/usr.bin/cpio/ (props changed) projects/graid/7/gnu/usr.bin/cvs/ (props changed) projects/graid/7/gnu/usr.bin/gdb/ (props changed) projects/graid/7/gnu/usr.bin/gdb/kgdb/ (props changed) projects/graid/7/gnu/usr.bin/grep/ (props changed) projects/graid/7/gnu/usr.bin/groff/ (props changed) projects/graid/7/gnu/usr.bin/groff/tmac/mdoc.local (props changed) projects/graid/7/gnu/usr.bin/man/ (props changed) projects/graid/7/gnu/usr.bin/sort/ (props changed) projects/graid/7/include/ (props changed) projects/graid/7/kerberos5/ (props changed) projects/graid/7/lib/ (props changed) projects/graid/7/lib/bind/ (props changed) projects/graid/7/lib/csu/ (props changed) projects/graid/7/lib/libarchive/ (props changed) projects/graid/7/lib/libbluetooth/ (props changed) projects/graid/7/lib/libc/ (props changed) projects/graid/7/lib/libc/stdtime/ (props changed) projects/graid/7/lib/libc_r/ (props changed) projects/graid/7/lib/libcam/ (props changed) projects/graid/7/lib/libdisk/ (props changed) projects/graid/7/lib/libdwarf/ (props changed) projects/graid/7/lib/libelf/ (props changed) projects/graid/7/lib/libexpat/ (props changed) projects/graid/7/lib/libfetch/ (props changed) projects/graid/7/lib/libftpio/ (props changed) projects/graid/7/lib/libgeom/ (props changed) projects/graid/7/lib/libgssapi/ (props changed) projects/graid/7/lib/libkse/ (props changed) projects/graid/7/lib/libkvm/ (props changed) projects/graid/7/lib/libmagic/ (props changed) projects/graid/7/lib/libmemstat/ (props changed) projects/graid/7/lib/libpmc/ (props changed) projects/graid/7/lib/libradius/ (props changed) projects/graid/7/lib/libsm/ (props changed) projects/graid/7/lib/libstand/ (props changed) projects/graid/7/lib/libthr/ (props changed) projects/graid/7/lib/libthread_db/ (props changed) projects/graid/7/lib/libufs/ (props changed) projects/graid/7/lib/libutil/ (props changed) projects/graid/7/lib/msun/ (props changed) projects/graid/7/libexec/ (props changed) projects/graid/7/libexec/ftpd/ (props changed) projects/graid/7/libexec/rpc.rquotad/ (props changed) projects/graid/7/libexec/rpc.rstatd/ (props changed) projects/graid/7/libexec/rtld-elf/ (props changed) projects/graid/7/libexec/tftpd/ (props changed) projects/graid/7/release/ (props changed) projects/graid/7/release/doc/ (props changed) projects/graid/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) projects/graid/7/release/picobsd/tinyware/login/ (props changed) projects/graid/7/rescue/ (props changed) projects/graid/7/sbin/ (props changed) projects/graid/7/sbin/atacontrol/ (props changed) projects/graid/7/sbin/bsdlabel/ (props changed) projects/graid/7/sbin/clri/ (props changed) projects/graid/7/sbin/ddb/ (props changed) projects/graid/7/sbin/devd/ (props changed) projects/graid/7/sbin/devfs/ (props changed) projects/graid/7/sbin/dhclient/ (props changed) projects/graid/7/sbin/dumpfs/ (props changed) projects/graid/7/sbin/fdisk/ (props changed) projects/graid/7/sbin/fdisk_pc98/ (props changed) projects/graid/7/sbin/fsck/ (props changed) projects/graid/7/sbin/fsck_ffs/ (props changed) projects/graid/7/sbin/fsck_msdosfs/ (props changed) projects/graid/7/sbin/geom/ (props changed) projects/graid/7/sbin/geom/class/label/ (props changed) projects/graid/7/sbin/geom/class/part/ (props changed) projects/graid/7/sbin/geom/class/stripe/ (props changed) projects/graid/7/sbin/geom/misc/ (props changed) projects/graid/7/sbin/growfs/ (props changed) projects/graid/7/sbin/ifconfig/ (props changed) projects/graid/7/sbin/init/ (props changed) projects/graid/7/sbin/ipf/ (props changed) projects/graid/7/sbin/ipfw/ (props changed) projects/graid/7/sbin/md5/ (props changed) projects/graid/7/sbin/mdconfig/ (props changed) projects/graid/7/sbin/mksnap_ffs/ (props changed) projects/graid/7/sbin/mount/ (props changed) projects/graid/7/sbin/mount_msdosfs/ (props changed) projects/graid/7/sbin/natd/ (props changed) projects/graid/7/sbin/newfs/ (props changed) projects/graid/7/sbin/newfs_msdos/ (props changed) projects/graid/7/sbin/ping6/ (props changed) projects/graid/7/sbin/reboot/ (props changed) projects/graid/7/sbin/restore/ (props changed) projects/graid/7/sbin/route/ (props changed) projects/graid/7/sbin/savecore/ (props changed) projects/graid/7/sbin/sconfig/ (props changed) projects/graid/7/sbin/shutdown/ (props changed) projects/graid/7/sbin/sysctl/ (props changed) projects/graid/7/sbin/tunefs/ (props changed) projects/graid/7/secure/lib/libcrypto/ (props changed) projects/graid/7/secure/lib/libssh/ (props changed) projects/graid/7/secure/lib/libssl/ (props changed) projects/graid/7/secure/libexec/sftp-server/ (props changed) projects/graid/7/secure/usr.bin/bdes/ (props changed) projects/graid/7/secure/usr.bin/openssl/ (props changed) projects/graid/7/secure/usr.bin/ssh/ (props changed) projects/graid/7/secure/usr.sbin/sshd/ (props changed) projects/graid/7/share/ (props changed) projects/graid/7/share/colldef/ (props changed) projects/graid/7/share/dict/ (props changed) projects/graid/7/share/doc/bind9/ (props changed) projects/graid/7/share/doc/papers/jail/ (props changed) projects/graid/7/share/doc/smm/01.setup/ (props changed) projects/graid/7/share/examples/ (props changed) projects/graid/7/share/man/ (props changed) projects/graid/7/share/man/man1/ (props changed) projects/graid/7/share/man/man3/ (props changed) projects/graid/7/share/man/man4/ (props changed) projects/graid/7/share/man/man5/ (props changed) projects/graid/7/share/man/man7/ (props changed) projects/graid/7/share/man/man8/ (props changed) projects/graid/7/share/man/man9/ (props changed) projects/graid/7/share/misc/ (props changed) projects/graid/7/share/misc/iso639 (props changed) projects/graid/7/share/misc/pci_vendors (props changed) projects/graid/7/share/mk/ (props changed) projects/graid/7/share/mklocale/ (props changed) projects/graid/7/share/monetdef/ (props changed) projects/graid/7/share/msgdef/ (props changed) projects/graid/7/share/numericdef/ (props changed) projects/graid/7/share/sendmail/ (props changed) projects/graid/7/share/syscons/ (props changed) projects/graid/7/share/syscons/keymaps/ (props changed) projects/graid/7/share/termcap/ (props changed) projects/graid/7/share/timedef/ (props changed) projects/graid/7/share/zoneinfo/ (props changed) projects/graid/7/sys/ (props changed) projects/graid/7/sys/cddl/contrib/opensolaris/ (props changed) projects/graid/7/sys/contrib/dev/acpica/ (props changed) projects/graid/7/sys/contrib/pf/ (props changed) projects/graid/7/tools/ (props changed) projects/graid/7/tools/build/ (props changed) projects/graid/7/tools/build/options/ (props changed) projects/graid/7/tools/debugscripts/ (props changed) projects/graid/7/tools/regression/acct/ (props changed) projects/graid/7/tools/regression/atm/ (props changed) projects/graid/7/tools/regression/bin/ (props changed) projects/graid/7/tools/regression/bin/date/ (props changed) projects/graid/7/tools/regression/bin/sh/ (props changed) projects/graid/7/tools/regression/file/ (props changed) projects/graid/7/tools/regression/file/flock/ (props changed) projects/graid/7/tools/regression/lib/libc/ (props changed) projects/graid/7/tools/regression/usr.bin/ (props changed) projects/graid/7/tools/regression/usr.bin/jot/ (props changed) projects/graid/7/tools/regression/usr.bin/tr/ (props changed) projects/graid/7/tools/sched/ (props changed) projects/graid/7/tools/test/ (props changed) projects/graid/7/tools/tools/ (props changed) projects/graid/7/tools/tools/aac/ (props changed) projects/graid/7/tools/tools/crypto/ (props changed) projects/graid/7/tools/tools/editing/ (props changed) projects/graid/7/tools/tools/nanobsd/ (props changed) projects/graid/7/tools/tools/nanobsd/FlashDevice.sub (props changed) projects/graid/7/tools/tools/nanobsd/nanobsd.sh (props changed) projects/graid/7/tools/tools/netrate/ (props changed) projects/graid/7/tools/tools/umastat/ (props changed) projects/graid/7/tools/tools/usb/ (props changed) projects/graid/7/usr.bin/ (props changed) projects/graid/7/usr.bin/basename/ (props changed) projects/graid/7/usr.bin/bluetooth/rfcomm_sppd/ (props changed) projects/graid/7/usr.bin/calendar/ (props changed) projects/graid/7/usr.bin/catman/ (props changed) projects/graid/7/usr.bin/cksum/ (props changed) projects/graid/7/usr.bin/comm/ (props changed) projects/graid/7/usr.bin/cpuset/ (props changed) projects/graid/7/usr.bin/csup/ (props changed) projects/graid/7/usr.bin/dirname/ (props changed) projects/graid/7/usr.bin/du/ (props changed) projects/graid/7/usr.bin/fetch/ (props changed) projects/graid/7/usr.bin/file/ (props changed) projects/graid/7/usr.bin/find/ (props changed) projects/graid/7/usr.bin/finger/ (props changed) projects/graid/7/usr.bin/fold/ (props changed) projects/graid/7/usr.bin/fstat/ (props changed) projects/graid/7/usr.bin/gcore/ (props changed) projects/graid/7/usr.bin/gprof/ (props changed) projects/graid/7/usr.bin/gzip/ (props changed) projects/graid/7/usr.bin/hexdump/ (props changed) projects/graid/7/usr.bin/id/ (props changed) projects/graid/7/usr.bin/indent/ (props changed) projects/graid/7/usr.bin/ipcrm/ (props changed) projects/graid/7/usr.bin/ipcs/ (props changed) projects/graid/7/usr.bin/jot/ (props changed) projects/graid/7/usr.bin/kdump/ (props changed) projects/graid/7/usr.bin/ktrace/ (props changed) projects/graid/7/usr.bin/ldd/ (props changed) projects/graid/7/usr.bin/less/ (props changed) projects/graid/7/usr.bin/locate/ (props changed) projects/graid/7/usr.bin/lockf/ (props changed) projects/graid/7/usr.bin/logger/ (props changed) projects/graid/7/usr.bin/make/ (props changed) projects/graid/7/usr.bin/ncal/ (props changed) projects/graid/7/usr.bin/netstat/ (props changed) projects/graid/7/usr.bin/newgrp/ (props changed) projects/graid/7/usr.bin/nsupdate/ (props changed) projects/graid/7/usr.bin/pkill/ (props changed) projects/graid/7/usr.bin/procstat/ (props changed) projects/graid/7/usr.bin/quota/ (props changed) projects/graid/7/usr.bin/rpcgen/ (props changed) projects/graid/7/usr.bin/ruptime/ (props changed) projects/graid/7/usr.bin/script/ (props changed) projects/graid/7/usr.bin/sed/ (props changed) projects/graid/7/usr.bin/shar/ (props changed) projects/graid/7/usr.bin/sockstat/ (props changed) projects/graid/7/usr.bin/stat/ (props changed) projects/graid/7/usr.bin/su/ (props changed) projects/graid/7/usr.bin/systat/ (props changed) projects/graid/7/usr.bin/tail/ (props changed) projects/graid/7/usr.bin/tar/ (props changed) projects/graid/7/usr.bin/tftp/ (props changed) projects/graid/7/usr.bin/tip/ (props changed) projects/graid/7/usr.bin/top/ (props changed) projects/graid/7/usr.bin/truncate/ (props changed) projects/graid/7/usr.bin/truss/ (props changed) projects/graid/7/usr.bin/uname/ (props changed) projects/graid/7/usr.bin/unifdef/ (props changed) projects/graid/7/usr.bin/units/ (props changed) projects/graid/7/usr.bin/uudecode/ (props changed) projects/graid/7/usr.bin/vmstat/ (props changed) projects/graid/7/usr.bin/w/ (props changed) projects/graid/7/usr.bin/wc/ (props changed) projects/graid/7/usr.bin/whereis/ (props changed) projects/graid/7/usr.bin/whois/ (props changed) projects/graid/7/usr.bin/window/ (props changed) projects/graid/7/usr.bin/xargs/ (props changed) projects/graid/7/usr.bin/ypcat/ (props changed) projects/graid/7/usr.bin/ypmatch/ (props changed) projects/graid/7/usr.bin/ypwhich/ (props changed) projects/graid/7/usr.sbin/ (props changed) projects/graid/7/usr.sbin/Makefile (props changed) projects/graid/7/usr.sbin/acpi/ (props changed) projects/graid/7/usr.sbin/adduser/ (props changed) projects/graid/7/usr.sbin/arp/ (props changed) projects/graid/7/usr.sbin/bluetooth/ (props changed) projects/graid/7/usr.sbin/bluetooth/btpand/ (props changed) projects/graid/7/usr.sbin/bluetooth/hcsecd/ (props changed) projects/graid/7/usr.sbin/bluetooth/hcseriald/ (props changed) projects/graid/7/usr.sbin/bluetooth/rfcomm_pppd/ (props changed) projects/graid/7/usr.sbin/bluetooth/sdpd/ (props changed) projects/graid/7/usr.sbin/boot0cfg/ (props changed) projects/graid/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (props changed) projects/graid/7/usr.sbin/bsnmpd/modules/snmp_pf/ (props changed) projects/graid/7/usr.sbin/burncd/ (props changed) projects/graid/7/usr.sbin/cdcontrol/ (props changed) projects/graid/7/usr.sbin/chown/ (props changed) projects/graid/7/usr.sbin/chroot/ (props changed) projects/graid/7/usr.sbin/config/ (props changed) projects/graid/7/usr.sbin/config/SMM.doc/ (props changed) projects/graid/7/usr.sbin/cpucontrol/ (props changed) projects/graid/7/usr.sbin/crashinfo/ (props changed) projects/graid/7/usr.sbin/cron/ (props changed) projects/graid/7/usr.sbin/cron/cron/ (props changed) projects/graid/7/usr.sbin/crunch/ (props changed) projects/graid/7/usr.sbin/cxgbtool/ (props changed) projects/graid/7/usr.sbin/eeprom/ (props changed) projects/graid/7/usr.sbin/extattr/ (props changed) projects/graid/7/usr.sbin/faithd/ (props changed) projects/graid/7/usr.sbin/fdcontrol/ (props changed) projects/graid/7/usr.sbin/fdformat/ (props changed) projects/graid/7/usr.sbin/fdread/ (props changed) projects/graid/7/usr.sbin/fdwrite/ (props changed) projects/graid/7/usr.sbin/fifolog/ (props changed) projects/graid/7/usr.sbin/freebsd-update/ (props changed) projects/graid/7/usr.sbin/fwcontrol/ (props changed) projects/graid/7/usr.sbin/gstat/ (props changed) projects/graid/7/usr.sbin/iostat/ (props changed) projects/graid/7/usr.sbin/jail/ (props changed) projects/graid/7/usr.sbin/jexec/ (props changed) projects/graid/7/usr.sbin/jls/ (props changed) projects/graid/7/usr.sbin/lpr/ (props changed) projects/graid/7/usr.sbin/mailwrapper/ (props changed) projects/graid/7/usr.sbin/makefs/ (props changed) projects/graid/7/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) projects/graid/7/usr.sbin/makefs/ffs/ffs_subr.c (props changed) projects/graid/7/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) projects/graid/7/usr.sbin/makefs/getid.c (props changed) projects/graid/7/usr.sbin/mergemaster/ (props changed) projects/graid/7/usr.sbin/mfiutil/ (props changed) projects/graid/7/usr.sbin/mountd/ (props changed) projects/graid/7/usr.sbin/mptutil/ (props changed) projects/graid/7/usr.sbin/mtree/ (props changed) projects/graid/7/usr.sbin/ndiscvt/ (props changed) projects/graid/7/usr.sbin/ndp/ (props changed) projects/graid/7/usr.sbin/newsyslog/ (props changed) projects/graid/7/usr.sbin/nscd/ (props changed) projects/graid/7/usr.sbin/ntp/ (props changed) projects/graid/7/usr.sbin/pciconf/ (props changed) projects/graid/7/usr.sbin/pkg_install/ (props changed) projects/graid/7/usr.sbin/pmccontrol/ (props changed) projects/graid/7/usr.sbin/pmcstat/ (props changed) projects/graid/7/usr.sbin/portsnap/ (props changed) projects/graid/7/usr.sbin/powerd/ (props changed) projects/graid/7/usr.sbin/ppp/ (props changed) projects/graid/7/usr.sbin/pstat/ (props changed) projects/graid/7/usr.sbin/pw/ (props changed) projects/graid/7/usr.sbin/pwd_mkdb/ (props changed) projects/graid/7/usr.sbin/rpc.lockd/ (props changed) projects/graid/7/usr.sbin/rpc.statd/ (props changed) projects/graid/7/usr.sbin/rpc.yppasswdd/ (props changed) projects/graid/7/usr.sbin/rtadvd/ (props changed) projects/graid/7/usr.sbin/rtsold/ (props changed) projects/graid/7/usr.sbin/sade/ (props changed) projects/graid/7/usr.sbin/service/ (props changed) projects/graid/7/usr.sbin/setfib/ (props changed) projects/graid/7/usr.sbin/sysinstall/ (props changed) projects/graid/7/usr.sbin/syslogd/ (props changed) projects/graid/7/usr.sbin/traceroute/ (props changed) projects/graid/7/usr.sbin/traceroute6/ (props changed) projects/graid/7/usr.sbin/tzsetup/ (props changed) projects/graid/7/usr.sbin/ugidfw/ (props changed) projects/graid/7/usr.sbin/wpa/wpa_supplicant/ (props changed) projects/graid/7/usr.sbin/ypserv/ (props changed) projects/graid/7/usr.sbin/zic/ (props changed) Modified: projects/graid/7/sbin/geom/class/raid/geom_raid.c ============================================================================== --- projects/graid/7/sbin/geom/class/raid/geom_raid.c Thu Feb 10 14:46:37 2011 (r218521) +++ projects/graid/7/sbin/geom/class/raid/geom_raid.c Thu Feb 10 15:07:17 2011 (r218522) @@ -49,19 +49,21 @@ static intmax_t zero = 0; struct g_command class_commands[] = { { "label", G_FLAG_VERBOSE, NULL, { + { 'f', "force", NULL, G_TYPE_BOOL }, { 'S', "size", &zero, G_TYPE_NUMBER }, { 's', "strip", &zero, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-S size] [-s stripsize] format label level prov ..." + NULL, "[-fv] [-S size] [-s stripsize] format label level prov ..." }, { "add", G_FLAG_VERBOSE, NULL, { + { 'f', "force", NULL, G_TYPE_BOOL }, { 'S', "size", &zero, G_TYPE_NUMBER }, { 's', "strip", &zero, G_TYPE_NUMBER }, G_OPT_SENTINEL }, - NULL, "[-S size] [-s stripsize] name label level" + NULL, "[-fv] [-S size] [-s stripsize] name label level" }, { "delete", G_FLAG_VERBOSE, NULL, { Modified: projects/graid/7/sbin/geom/class/raid/graid.8 ============================================================================== --- projects/graid/7/sbin/geom/class/raid/graid.8 Thu Feb 10 14:46:37 2011 (r218521) +++ projects/graid/7/sbin/geom/class/raid/graid.8 Thu Feb 10 15:07:17 2011 (r218522) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 5, 2011 +.Dd February 10, 2011 .Dt GRAID 8 .Os .Sh NAME @@ -33,6 +33,7 @@ .Sh SYNOPSIS .Nm .Cm label +.Op Fl f .Op Fl S Ar size .Op Fl s Ar strip .Ar format @@ -41,6 +42,7 @@ .Ar prov ... .Nm .Cm add +.Op Fl f .Op Fl S Ar size .Op Fl s Ar strip .Ar name @@ -114,6 +116,9 @@ and metadata format. .Pp Additional options include: .Bl -tag -width ".Fl s Ar strip" +.It Fl f +Enforce specified configuration creation if it is officially unsupported, +but technically can be created. .It Fl S Ar size Use .Ar size @@ -200,6 +205,8 @@ The format used by Intel RAID BIOS. Supports up to two volumes per array. Supports configurations: RAID0 (2+ disks), RAID1 (2 disks), RAID5 (3+ disks), RAID10 (4 disks). +Configurations not supported by Intel RAID BIOS, but enforsable on your own +risk: RAID1 (3+ disks), RAID1E (3+ disks), RAID10 (6+ disks). .El .Sh SUPPORTED RAID LEVELS The GEOM RAID class follows a modular design, allowing different RAID levels Modified: projects/graid/7/sys/geom/raid/g_raid.c ============================================================================== --- projects/graid/7/sys/geom/raid/g_raid.c Thu Feb 10 14:46:37 2011 (r218521) +++ projects/graid/7/sys/geom/raid/g_raid.c Thu Feb 10 15:07:17 2011 (r218522) @@ -275,8 +275,6 @@ g_raid_volume_level2str(int level, int q return ("RAID5"); case G_RAID_VOLUME_RL_RAID6: return ("RAID6"); - case G_RAID_VOLUME_RL_RAID10: - return ("RAID10"); case G_RAID_VOLUME_RL_RAID1E: return ("RAID1E"); case G_RAID_VOLUME_RL_SINGLE: @@ -310,9 +308,8 @@ g_raid_volume_str2level(const char *str, *level = G_RAID_VOLUME_RL_RAID5; else if (strcasecmp(str, "RAID6") == 0) *level = G_RAID_VOLUME_RL_RAID6; - else if (strcasecmp(str, "RAID10") == 0) - *level = G_RAID_VOLUME_RL_RAID10; - else if (strcasecmp(str, "RAID1E") == 0) + else if (strcasecmp(str, "RAID10") == 0 || + strcasecmp(str, "RAID1E") == 0) *level = G_RAID_VOLUME_RL_RAID1E; else if (strcasecmp(str, "SINGLE") == 0) *level = G_RAID_VOLUME_RL_SINGLE; @@ -909,6 +906,7 @@ g_raid_start_request(struct bio *bp) sc = bp->bio_to->geom->softc; sx_assert(&sc->sc_lock, SX_LOCKED); vol = bp->bio_to->private; + /* * Check to see if this item is in a locked range. If so, * queue it to our locked queue and return. We'll requeue @@ -1072,7 +1070,7 @@ void g_raid_subdisk_iostart(struct g_raid_subdisk *sd, struct bio *bp) { struct g_consumer *cp; - struct g_raid_disk *disk; + struct g_raid_disk *disk, *tdisk; bp->bio_caller1 = sd; @@ -1102,6 +1100,17 @@ nodisk: bp->bio_from = cp; bp->bio_to = cp->provider; cp->index++; + + /* Update average disks load. */ + TAILQ_FOREACH(tdisk, &sd->sd_softc->sc_disks, d_next) { + if (tdisk->d_consumer == NULL) + tdisk->d_load = 0; + else + tdisk->d_load = (tdisk->d_consumer->index * + G_RAID_SUBDISK_LOAD_SCALE + tdisk->d_load * 7) / 8; + } + + disk->d_last_offset = bp->bio_offset + bp->bio_length; if (dumping) { G_RAID_LOGREQ(3, bp, "Sending dumping request."); if (bp->bio_cmd == BIO_WRITE) { @@ -1308,10 +1317,11 @@ out: static void g_raid_launch_provider(struct g_raid_volume *vol) { -// struct g_raid_disk *disk; + struct g_raid_disk *disk; struct g_raid_softc *sc; struct g_provider *pp; char name[G_RAID_MAX_VOLUMENAME]; + off_t off; sc = vol->v_softc; sx_assert(&sc->sc_lock, SX_LOCKED); @@ -1330,14 +1340,25 @@ g_raid_launch_provider(struct g_raid_vol pp->sectorsize = vol->v_sectorsize; pp->stripesize = 0; pp->stripeoffset = 0; -#if 0 - TAILQ_FOREACH(disk, &sc->sc_disks, d_next) { - if (disk->d_consumer && disk->d_consumer->provider && - disk->d_consumer->provider->stripesize > pp->stripesize) { + if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1 || + vol->v_raid_level == G_RAID_VOLUME_RL_RAID3 || + vol->v_raid_level == G_RAID_VOLUME_RL_SINGLE || + vol->v_raid_level == G_RAID_VOLUME_RL_CONCAT) { + if ((disk = vol->v_subdisks[0].sd_disk) != NULL && + disk->d_consumer != NULL && + disk->d_consumer->provider != NULL) { pp->stripesize = disk->d_consumer->provider->stripesize; + off = disk->d_consumer->provider->stripeoffset; + pp->stripeoffset = off + vol->v_subdisks[0].sd_offset; + if (off > 0) + pp->stripeoffset %= off; } - } -#endif + if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID3) { + pp->stripesize *= (vol->v_disks_count - 1); + pp->stripeoffset *= (vol->v_disks_count - 1); + } + } else + pp->stripesize = vol->v_strip_size; vol->v_provider = pp; g_error_provider(pp, 0); g_topology_unlock(); Modified: projects/graid/7/sys/geom/raid/g_raid.h ============================================================================== --- projects/graid/7/sys/geom/raid/g_raid.h Thu Feb 10 14:46:37 2011 (r218521) +++ projects/graid/7/sys/geom/raid/g_raid.h Thu Feb 10 15:07:17 2011 (r218522) @@ -98,6 +98,7 @@ extern struct g_class g_raid_class; * doing some desirable action such as bad * block remapping after we detect a bad part * of the disk. + * G_RAID_BIO_FLAG_LOCKED I/O holds range lock that should re released. * * and the following meta item: * G_RAID_BIO_FLAG_SPECIAL And of the I/O flags that need to make it @@ -107,8 +108,9 @@ extern struct g_class g_raid_class; */ #define G_RAID_BIO_FLAG_SYNC 0x01 #define G_RAID_BIO_FLAG_REMAP 0x02 -#define G_RAID_BIO_FLAG_SPECIAL \ +#define G_RAID_BIO_FLAG_SPECIAL \ (G_RAID_BIO_FLAG_SYNC|G_RAID_BIO_FLAG_REMAP) +#define G_RAID_BIO_FLAG_LOCKED 0x80 struct g_raid_lock { off_t l_offset; @@ -145,10 +147,11 @@ struct g_raid_disk { struct g_consumer *d_consumer; /* GEOM disk consumer. */ void *d_md_data; /* Disk's metadata storage. */ struct g_kerneldump d_kd; /* Kernel dumping method/args. */ - u_int d_state; /* Disk state. */ uint64_t d_flags; /* Additional flags. */ + u_int d_state; /* Disk state. */ u_int d_load; /* Disk average load. */ off_t d_last_offset; /* Last head offset. */ + int d_read_errs; /* Count of the read errors */ TAILQ_HEAD(, g_raid_subdisk) d_subdisks; /* List of subdisks. */ TAILQ_ENTRY(g_raid_disk) d_next; /* Next disk in the node. */ }; @@ -167,6 +170,13 @@ struct g_raid_disk { #define G_RAID_SUBDISK_E_DISCONNECTED 0x03 /* A subdisk removed from volume. */ #define G_RAID_SUBDISK_E_FIRST_TR_PRIVATE 0x80 /* translation private events */ +#define G_RAID_SUBDISK_POS(sd) \ + ((sd)->sd_disk ? ((sd)->sd_disk->d_last_offset - (sd)->sd_offset) : 0) +#define G_RAID_SUBDISK_TRACK_SIZE (1 * 1024 * 1024) +#define G_RAID_SUBDISK_LOAD(sd) \ + ((sd)->sd_disk ? ((sd)->sd_disk->d_load) : 0) +#define G_RAID_SUBDISK_LOAD_SCALE 256 + struct g_raid_subdisk { struct g_raid_softc *sd_softc; /* Back-pointer to softc. */ struct g_raid_disk *sd_disk; /* Where this subdisk lives. */ @@ -176,7 +186,7 @@ struct g_raid_subdisk { u_int sd_pos; /* Position in volume. */ u_int sd_state; /* Subdisk state. */ off_t sd_rebuild_pos; /* Rebuild position. */ - int sd_read_errs; /* Count of the read errors */ + int sd_recovery; /* Count of recovery reqs. */ TAILQ_ENTRY(g_raid_subdisk) sd_next; /* Next subdisk on disk. */ }; @@ -206,7 +216,6 @@ struct g_raid_subdisk { #define G_RAID_VOLUME_RL_RAID4 0x04 #define G_RAID_VOLUME_RL_RAID5 0x05 #define G_RAID_VOLUME_RL_RAID6 0x06 -#define G_RAID_VOLUME_RL_RAID10 0x0a #define G_RAID_VOLUME_RL_RAID1E 0x11 #define G_RAID_VOLUME_RL_SINGLE 0x0f #define G_RAID_VOLUME_RL_CONCAT 0x1f Modified: projects/graid/7/sys/geom/raid/md_intel.c ============================================================================== --- projects/graid/7/sys/geom/raid/md_intel.c Thu Feb 10 14:46:37 2011 (r218521) +++ projects/graid/7/sys/geom/raid/md_intel.c Thu Feb 10 15:07:17 2011 (r218522) @@ -568,6 +568,43 @@ g_raid_md_intel_get_disk(struct g_raid_s return (disk); } +static int +g_raid_md_intel_supported(int level, int qual, int disks, int force) +{ + + switch (level) { + case G_RAID_VOLUME_RL_RAID0: + if (disks < 1) + return (0); + if (!force && (disks < 2 || disks > 6)) + return (0); + break; + case G_RAID_VOLUME_RL_RAID1: + if (disks < 1) + return (0); + if (!force && (disks != 2)) + return (0); + break; + case G_RAID_VOLUME_RL_RAID1E: + if (disks < 3) + return (0); + if (!force && (disks != 4)) + return (0); + break; + case G_RAID_VOLUME_RL_RAID5: + if (disks < 3) + return (0); + if (!force && disks > 6) + return (0); + break; + default: + return (0); + } + if (qual != G_RAID_VOLUME_RLQ_NONE) + return (0); + return (1); +} + static struct g_raid_volume * g_raid_md_intel_get_volume(struct g_raid_softc *sc, int id) { @@ -898,11 +935,20 @@ g_raid_md_intel_start(struct g_raid_soft if (mmap->type == INTEL_T_RAID0) vol->v_raid_level = G_RAID_VOLUME_RL_RAID0; else if (mmap->type == INTEL_T_RAID1 && - mmap->total_disks < 4) /* >= 4 disks -> RAID10 */ - vol->v_raid_level = G_RAID_VOLUME_RL_RAID1; - else if (mmap->type == INTEL_T_RAID1) /* SIC */ - vol->v_raid_level = G_RAID_VOLUME_RL_RAID10; - else if (mmap->type == INTEL_T_RAID5) + mmap->total_domains >= 2 && + mmap->total_domains <= mmap->total_disks) { + /* Assume total_domains is correct. */ + if (mmap->total_domains == mmap->total_disks) + vol->v_raid_level = G_RAID_VOLUME_RL_RAID1; + else + vol->v_raid_level = G_RAID_VOLUME_RL_RAID1E; + } else if (mmap->type == INTEL_T_RAID1) { + /* total_domains looks wrong. */ + if (mmap->total_disks <= 2) + vol->v_raid_level = G_RAID_VOLUME_RL_RAID1; + else + vol->v_raid_level = G_RAID_VOLUME_RL_RAID1E; + } else if (mmap->type == INTEL_T_RAID5) vol->v_raid_level = G_RAID_VOLUME_RL_RAID5; else vol->v_raid_level = G_RAID_VOLUME_RL_UNKNOWN; @@ -954,6 +1000,8 @@ g_raid_md_intel_start(struct g_raid_soft } while (disk != NULL); mdi->mdio_started = 1; + G_RAID_DEBUG1(0, sc, "Array started."); + g_raid_md_write_intel(md, NULL, NULL, NULL); /* Pickup any STALE/SPARE disks to refill array if needed. */ g_raid_md_intel_refill(sc); @@ -1348,16 +1396,17 @@ g_raid_md_ctl_intel(struct g_raid_md_obj gctl_error(req, "Unknown RAID level '%s'.", levelname); return (-4); } - if (level != G_RAID_VOLUME_RL_RAID0 && - level != G_RAID_VOLUME_RL_RAID1 && - level != G_RAID_VOLUME_RL_RAID5 && - level != G_RAID_VOLUME_RL_RAID10) { - gctl_error(req, "Unsupported RAID level."); + numdisks = *nargs - 3; + force = gctl_get_paraml(req, "force", sizeof(*force)); + if (!g_raid_md_intel_supported(level, qual, numdisks, + force ? *force : 0)) { + gctl_error(req, "Unsupported RAID level " + "(0x%02x/0x%02x), or number of disks (%d).", + level, qual, numdisks); return (-5); } /* Search for disks, connect them and probe. */ - numdisks = *nargs - 3; size = 0x7fffffffffffffffllu; sectorsize = 0; for (i = 0; i < numdisks; i++) { @@ -1515,8 +1564,10 @@ makedisk: vol->v_mediasize = size; else if (level == G_RAID_VOLUME_RL_RAID5) vol->v_mediasize = size * (numdisks - 1); - else /* RAID10 */ - vol->v_mediasize = size * (numdisks / 2); + else { /* RAID1E */ + vol->v_mediasize = ((size * numdisks) / strip / 2) * + strip; + } vol->v_sectorsize = sectorsize; g_raid_start_volume(vol); @@ -1541,6 +1592,7 @@ makedisk: } /* Write metadata based on created entities. */ + G_RAID_DEBUG1(0, sc, "Array started."); g_raid_md_write_intel(md, NULL, NULL, NULL); /* Pickup any STALE/SPARE disks to refill array if needed. */ @@ -1570,13 +1622,6 @@ makedisk: gctl_error(req, "Unknown RAID level '%s'.", levelname); return (-4); } - if (level != G_RAID_VOLUME_RL_RAID0 && - level != G_RAID_VOLUME_RL_RAID1 && - level != G_RAID_VOLUME_RL_RAID5 && - level != G_RAID_VOLUME_RL_RAID10) { - gctl_error(req, "Unsupported RAID level."); - return (-5); - } /* Look for existing volumes. */ i = 0; @@ -1594,10 +1639,19 @@ makedisk: return (-7); } + numdisks = vol1->v_disks_count; + force = gctl_get_paraml(req, "force", sizeof(*force)); + if (!g_raid_md_intel_supported(level, qual, numdisks, + force ? *force : 0)) { + gctl_error(req, "Unsupported RAID level " + "(0x%02x/0x%02x), or number of disks (%d).", + level, qual, numdisks); + return (-5); + } + /* Collect info about present disks. */ size = 0x7fffffffffffffffllu; sectorsize = 512; - numdisks = vol1->v_disks_count; for (i = 0; i < numdisks; i++) { disk = vol1->v_subdisks[i].sd_disk; pd = (struct g_raid_md_intel_perdisk *) @@ -1692,8 +1746,10 @@ makedisk: vol->v_mediasize = size; else if (level == G_RAID_VOLUME_RL_RAID5) vol->v_mediasize = size * (numdisks - 1); - else /* RAID10 */ - vol->v_mediasize = size * (numdisks / 2); + else { /* RAID1E */ + vol->v_mediasize = ((size * numdisks) / strip / 2) * + strip; + } vol->v_sectorsize = sectorsize; g_raid_start_volume(vol); @@ -2138,15 +2194,15 @@ g_raid_md_write_intel(struct g_raid_md_o if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID0) mmap0->type = INTEL_T_RAID0; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1 || - vol->v_raid_level == G_RAID_VOLUME_RL_RAID10) + vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) mmap0->type = INTEL_T_RAID1; else mmap0->type = INTEL_T_RAID5; mmap0->total_disks = vol->v_disks_count; - if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID10) - mmap0->total_domains = vol->v_disks_count / 2; - else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1) + if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1) mmap0->total_domains = vol->v_disks_count; + else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID1E) + mmap0->total_domains = 2; else mmap0->total_domains = 1; mmap0->stripe_count = sd->sd_size / vol->v_strip_size / Modified: projects/graid/7/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/7/sys/geom/raid/tr_raid1.c Thu Feb 10 14:46:37 2011 (r218521) +++ projects/graid/7/sys/geom/raid/tr_raid1.c Thu Feb 10 15:07:17 2011 (r218522) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include <sys/endian.h> #include <sys/kernel.h> #include <sys/kobj.h> +#include <sys/limits.h> #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mutex.h> @@ -162,10 +163,12 @@ g_raid_tr_update_state_raid1(struct g_ra struct g_raid_subdisk *sd) { struct g_raid_tr_raid1_object *trs; + struct g_raid_softc *sc; struct g_raid_subdisk *tsd, *bestsd; u_int s; int i, na, ns; + sc = vol->v_softc; trs = (struct g_raid_tr_raid1_object *)vol->v_tr; if (trs->trso_stopping && (trs->trso_flags & TR_RAID1_F_DOING_SOME) == 0) @@ -193,13 +196,13 @@ g_raid_tr_update_state_raid1(struct g_ra } if (bestsd->sd_state >= G_RAID_SUBDISK_S_UNINITIALIZED) { /* We found reasonable candidate. */ - G_RAID_DEBUG1(1, vol->v_softc, + G_RAID_DEBUG1(1, sc, "Promote subdisk %s:%d from %s to ACTIVE.", vol->v_name, bestsd->sd_pos, g_raid_subdisk_state2str(bestsd->sd_state)); g_raid_change_subdisk_state(bestsd, G_RAID_SUBDISK_S_ACTIVE); - g_raid_write_metadata(vol->v_softc, + g_raid_write_metadata(sc, vol, bestsd, bestsd->sd_disk); } } @@ -221,11 +224,32 @@ g_raid_tr_update_state_raid1(struct g_ra G_RAID_VOLUME_E_UP : G_RAID_VOLUME_E_DOWN, G_RAID_EVENT_VOLUME); g_raid_change_volume_state(vol, s); + if (!trs->trso_starting && !trs->trso_stopping) + g_raid_write_metadata(sc, vol, NULL, NULL); } return (0); } static void +g_raid_tr_raid1_fail_disk(struct g_raid_softc *sc, struct g_raid_subdisk *sd, + struct g_raid_disk *disk) +{ + /* + * We don't fail the last disk in the pack, since it still has decent + * data on it and that's better than failing the disk if it is the root + * file system. + * + * XXX should this be controlled via a tunable? It makes sense for + * the volume that has / on it. I can't think of a case where we'd + * want the volume to go away on this kind of event. + */ + if (g_raid_nsubdisks(sd->sd_volume, G_RAID_SUBDISK_S_ACTIVE) == 1 && + g_raid_get_subdisk(sd->sd_volume, G_RAID_SUBDISK_S_ACTIVE) == sd) + return; + g_raid_fail_disk(sc, sd, disk); +} + +static void g_raid_tr_raid1_rebuild_some(struct g_raid_tr_object *tr, struct g_raid_subdisk *sd) { @@ -471,22 +495,46 @@ g_raid_tr_stop_raid1(struct g_raid_tr_ob } /* - * Select the disk to do the reads to. For now, we just pick the first one in - * the list that's active always. This ensures we favor one disk on boot, and - * have more deterministic recovery from the weird edge cases of power - * failure. In the future, we can imagine policies that go for the least - * loaded disk to improve performance, or we need to limit reads to a disk - * during some kind of error recovery with that disk. + * Select the disk to read from. Take into account: subdisk state, running + * error recovery, average disk load, head position and possible cache hits. */ +#define ABS(x) (((x) >= 0) ? (x) : (-(x))) static struct g_raid_subdisk * -g_raid_tr_raid1_select_read_disk(struct g_raid_volume *vol) +g_raid_tr_raid1_select_read_disk(struct g_raid_volume *vol, struct bio *bp, + u_int mask) { - int i; + struct g_raid_subdisk *sd, *best; + int i, prio, bestprio; - for (i = 0; i < vol->v_disks_count; i++) - if (vol->v_subdisks[i].sd_state == G_RAID_SUBDISK_S_ACTIVE) - return (&vol->v_subdisks[i]); - return (NULL); + best = NULL; + bestprio = INT_MAX; + for (i = 0; i < vol->v_disks_count; i++) { + sd = &vol->v_subdisks[i]; + if (sd->sd_state != G_RAID_SUBDISK_S_ACTIVE && + !((sd->sd_state == G_RAID_SUBDISK_S_REBUILD || + sd->sd_state == G_RAID_SUBDISK_S_RESYNC) && + bp->bio_offset + bp->bio_length < + sd->sd_rebuild_pos)) + continue; + if ((mask & (1 << i)) != 0) + continue; + prio = G_RAID_SUBDISK_LOAD(sd); + prio += min(sd->sd_recovery, 255) << 22; + prio += (G_RAID_SUBDISK_S_ACTIVE - sd->sd_state) << 16; + /* If disk head is precisely in position - highly prefer it. */ + if (G_RAID_SUBDISK_POS(sd) == bp->bio_offset) + prio -= 2 * G_RAID_SUBDISK_LOAD_SCALE; + else + /* If disk head is close to position - prefer it. */ + if (ABS(G_RAID_SUBDISK_POS(sd) - bp->bio_offset) < + G_RAID_SUBDISK_TRACK_SIZE) + prio -= 1 * G_RAID_SUBDISK_LOAD_SCALE; + if (prio < bestprio) { + best = sd; + bestprio = prio; + } + } + return (best); } static void @@ -495,7 +543,7 @@ g_raid_tr_iostart_raid1_read(struct g_ra struct g_raid_subdisk *sd; struct bio *cbp; - sd = g_raid_tr_raid1_select_read_disk(tr->tro_volume); + sd = g_raid_tr_raid1_select_read_disk(tr->tro_volume, bp, 0); KASSERT(sd != NULL, ("No active disks in volume %s.", tr->tro_volume->v_name)); @@ -630,10 +678,11 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ struct g_raid_volume *vol; struct bio *pbp; struct g_raid_tr_raid1_object *trs; - int i, error; + uintptr_t *mask; + int error, do_write; trs = (struct g_raid_tr_raid1_object *)tr; - pbp = bp->bio_parent; + vol = tr->tro_volume; if (bp->bio_cflags & G_RAID_BIO_FLAG_SYNC) { /* * This operation is part of a rebuild or resync operation. @@ -650,20 +699,30 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * 5MB of data, for inactive ones, we do 50MB. */ if (trs->trso_type == TR_RAID1_REBUILD) { - vol = tr->tro_volume; if (bp->bio_cmd == BIO_READ) { + + /* Immediately abort rebuild, if requested. */ + if (trs->trso_flags & TR_RAID1_F_ABORT) { + trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; + g_raid_tr_raid1_rebuild_abort(tr); + return; + } + + /* On read error, skip and cross fingers. */ + if (bp->bio_error != 0) { + G_RAID_LOGREQ(0, bp, + "Read error during rebuild (%d), " + "possible data loss!", + bp->bio_error); + goto rebuild_round_done; + } + /* * The read operation finished, queue the * write and get out. */ G_RAID_LOGREQ(4, bp, "rebuild read done. %d", bp->bio_error); - if (bp->bio_error != 0 || - trs->trso_flags & TR_RAID1_F_ABORT) { - trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; - g_raid_tr_raid1_rebuild_abort(tr); - return; - } bp->bio_cmd = BIO_WRITE; bp->bio_cflags = G_RAID_BIO_FLAG_SYNC; bp->bio_offset = bp->bio_offset; @@ -685,7 +744,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ trs->trso_flags & TR_RAID1_F_ABORT) { if ((trs->trso_flags & TR_RAID1_F_ABORT) == 0) { - g_raid_fail_disk(sd->sd_softc, + g_raid_tr_raid1_fail_disk(sd->sd_softc, nsd, nsd->sd_disk); } trs->trso_flags &= ~TR_RAID1_F_DOING_SOME; @@ -693,6 +752,8 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ return; } /* XXX A lot of the following is needed when we kick of the work -- refactor */ +rebuild_round_done: + nsd = trs->trso_failed_sd; trs->trso_flags &= ~TR_RAID1_F_LOCKED; g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); @@ -749,6 +810,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ } return; } + pbp = bp->bio_parent; pbp->bio_inbed++; if (bp->bio_cmd == BIO_READ && bp->bio_error != 0) { /* @@ -756,11 +818,10 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * another disk drive, if available, before erroring out the * read. */ - vol = tr->tro_volume; - sd->sd_read_errs++; + sd->sd_disk->d_read_errs++; G_RAID_LOGREQ(0, bp, "Read error (%d), %d read errors total", - bp->bio_error, sd->sd_read_errs); + bp->bio_error, sd->sd_disk->d_read_errs); /* * If there are too many read errors, we move to degraded. @@ -768,33 +829,37 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ * everything to get it back in sync), or just degrade the * drive, which kicks off a resync? */ - if (sd->sd_read_errs > g_raid1_read_err_thresh) { - g_raid_fail_disk(sd->sd_softc, sd, sd->sd_disk); + do_write = 1; + if (sd->sd_disk->d_read_errs > g_raid1_read_err_thresh) { + g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); if (pbp->bio_children == 1) - goto remapdone; + do_write = 0; } /* * Find the other disk, and try to do the I/O to it. */ - for (nsd = NULL, i = 0; i < vol->v_disks_count; i++) { - if (pbp->bio_children > 1) - break; - nsd = &vol->v_subdisks[i]; - if (sd == nsd) - continue; - if (nsd->sd_state != G_RAID_SUBDISK_S_ACTIVE) - continue; - cbp = g_clone_bio(pbp); - if (cbp == NULL) - break; - G_RAID_LOGREQ(2, cbp, "Retrying read"); - pbp->bio_driver1 = sd; /* Save original subdisk. */ - cbp->bio_caller1 = nsd; - cbp->bio_cflags = G_RAID_BIO_FLAG_REMAP; - /* Lock callback starts I/O */ - g_raid_lock_range(sd->sd_volume, - cbp->bio_offset, cbp->bio_length, pbp, cbp); + mask = (uintptr_t *)(&pbp->bio_driver2); + if (pbp->bio_children == 1) { + /* Save original subdisk. */ + pbp->bio_driver1 = do_write ? sd : NULL; + *mask = 0; + } + *mask |= 1 << sd->sd_pos; + nsd = g_raid_tr_raid1_select_read_disk(vol, pbp, *mask); + if (nsd != NULL && (cbp = g_clone_bio(pbp)) != NULL) { + G_RAID_LOGREQ(2, cbp, "Retrying read from %d", + nsd->sd_pos); + if (pbp->bio_children == 2 && do_write) { + sd->sd_recovery++; + cbp->bio_caller1 = nsd; + pbp->bio_pflags = G_RAID_BIO_FLAG_LOCKED; + /* Lock callback starts I/O */ + g_raid_lock_range(sd->sd_volume, + cbp->bio_offset, cbp->bio_length, pbp, cbp); + } else { + g_raid_subdisk_iostart(nsd, cbp); + } return; } /* @@ -805,10 +870,12 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ */ G_RAID_LOGREQ(2, bp, "Couldn't retry read, failing it"); } - if (bp->bio_cmd == BIO_READ && bp->bio_error == 0 && - pbp->bio_children > 1) { + if (bp->bio_cmd == BIO_READ && + bp->bio_error == 0 && + pbp->bio_children > 1 && + pbp->bio_driver1 != NULL) { /* - * If it was a read, and bio_children is 2, then we just + * If it was a read, and bio_children is >1, then we just * recovered the data from the second drive. We should try to * write that data to the first drive if sector remapping is * enabled. A write should put the data in a new place on the @@ -823,16 +890,15 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ if (cbp != NULL) { cbp->bio_cmd = BIO_WRITE; cbp->bio_cflags = G_RAID_BIO_FLAG_REMAP; - G_RAID_LOGREQ(3, cbp, + G_RAID_LOGREQ(2, cbp, "Attempting bad sector remap on failing drive."); g_raid_subdisk_iostart(pbp->bio_driver1, cbp); return; } } -remapdone: - if (bp->bio_cflags & G_RAID_BIO_FLAG_REMAP) { + if (pbp->bio_pflags & G_RAID_BIO_FLAG_LOCKED) { /* - * We're done with a remap write, mark the range as unlocked. + * We're done with a recovery, mark the range as unlocked. * For any write errors, we agressively fail the disk since * there was both a READ and a WRITE error at this location. * Both types of errors generally indicates the drive is on @@ -840,12 +906,16 @@ remapdone: * it now. However, we need to reset error to 0 in that case * because we're not failing the original I/O which succeeded. */ - if (pbp->bio_cmd == BIO_WRITE && bp->bio_error) { + if (bp->bio_cmd == BIO_WRITE && bp->bio_error) { G_RAID_LOGREQ(0, bp, "Remap write failed: " "failing subdisk."); - g_raid_fail_disk(sd->sd_softc, sd, sd->sd_disk); + g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); bp->bio_error = 0; } + if (pbp->bio_driver1 != NULL) { + ((struct g_raid_subdisk *)pbp->bio_driver1) + ->sd_recovery--; + } G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error); g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102101507.p1AF7ISk025748>