Read-triggered corruption of swap backed MD devices

看板FB_current作者時間12年前 (2013/05/24 10:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
Hi all, I tracked the cause of a colleague's nanobsd image creation problem to what appears to be some nasty behaviour with swap-backed MD devices. I've verified the behaviour exists on three separate systems running 10-CURRENT r250260, 9-STABLE r250824 and 9-STABLE r250925. The following minimal reproduction recipe (run as root) deterministically triggers the behaviour for me on the 3 systems I've tested: env MD_DEV=`mdconfig -an -t swap -s 1m -x 63 -y 16` sh -c '(fdisk -I md${MD_DEV} ; bsdlabel -w -B md${MD_DEV}s1 ; bsdlabel md${MD_DEV}s1 ; dd if=/dev/md${MD_DEV} of=/dev/null bs=64k ; bsdlabel md${MD_DEV}s1 ; mdconfig -d -u ${MD_DEV})' By changing the mdconfig "-t swap" argument to "-t malloc", the bsdlabel remains intact after the dd command completes. I've included command line recipe runs from my 10-CURRENT r250260 laptop with both "-t swap" and "-t malloc" at the end of this email for reference. Smells like a VM related problem to me, but ENOCLUE so I would appreciate some help. Cheers, Lawrence root@lstewart-laptop:~ # uname -a FreeBSD lstewart-laptop 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r250260: Wed May 22 15:57:40 EST 2013 root@lstewart-laptop:/usr/obj/usr/src/sys/GENERIC amd64 root@lstewart-laptop:~ # env MD_DEV=`mdconfig -an -t swap -s 1m -x 63 -y 16` sh -c '(fdisk -I md${MD_DEV} ; bsdlabel -w -B md${MD_DEV}s1 ; bsdlabel md${MD_DEV}s1 ; dd if=/dev/md${MD_DEV} of=/dev/null bs=64k ; bsdlabel md${MD_DEV}s1 ; mdconfig -d -u ${MD_DEV})' ******* Working on device /dev/md0 ******* fdisk: invalid fdisk partition table found # /dev/md0s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 1937 16 unused 0 0 c: 1953 0 unused 0 0 # "raw" part, don't edit 16+0 records in 16+0 records out 1048576 bytes transferred in 0.001728 secs (606794497 bytes/sec) bsdlabel: /dev/md0s1: no valid label found root@lstewart-laptop:~ # env MD_DEV=`mdconfig -an -t malloc -s 1m -x 63 -y 16` sh -c '(fdisk -I md${MD_DEV} ; bsdlabel -w -B md${MD_DEV}s1 ; bsdlabel md${MD_DEV}s1 ; dd if=/dev/md${MD_DEV} of=/dev/null bs=64k ; bsdlabel md${MD_DEV}s1 ; mdconfig -d -u ${MD_DEV})' ******* Working on device /dev/md0 ******* fdisk: invalid fdisk partition table found # /dev/md0s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 1937 16 unused 0 0 c: 1953 0 unused 0 0 # "raw" part, don't edit 16+0 records in 16+0 records out 1048576 bytes transferred in 0.001251 secs (838202118 bytes/sec) # /dev/md0s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 1937 16 unused 0 0 c: 1953 0 unused 0 0 # "raw" part, don't edit _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1Hdj4Y_A (FB_current)
文章代碼(AID): #1Hdj4Y_A (FB_current)