Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 285796 - sys-fs/mdadm-3.0 can't stop arrays that aren't in use.
Summary: sys-fs/mdadm-3.0 can't stop arrays that aren't in use.
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-21 00:02 UTC by Chad A. Simmons
Modified: 2009-09-21 00:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chad A. Simmons 2009-09-21 00:02:44 UTC
phenom / # mdadm --stop /dev/md2
mdadm: failed to stop array /dev/md2: Device or resource busy
Perhaps a running process, mounted filesystem or active volume group?
phenom / # lsof /dev/md2
phenom / #


Reproducible: Always

Steps to Reproduce:
1. unmount a raid0 array
2. try to stop array with mdadm
3. fail

Actual Results:  
stop failed

Expected Results:  
stopped unused array

phenom / # emerge --info
Portage 2.2_rc41 (unavailable, gcc-4.4.1, glibc-2.10.1-r0, 2.6.30-gentoo-r6 x86_64)
=================================================================
System uname: Linux-2.6.30-gentoo-r6-x86_64-AMD_Phenom-tm-_II_X4_955_Processor-with-gentoo-2.0.1
Timestamp of tree: Unknown
distcc 3.1 x86_64-pc-linux-gnu [disabled]
dev-lang/python:     2.6.2-r1, 3.1.1
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=amdfam10 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=amdfam10 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans user-sandbox userfetch userpriv"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/tmp/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/sunrise"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 64bit aften bash-completion blas caps chroot cleartype corefonts css divx djbfft erandom extrafilters faac faad ffmpeg git glib imagemagick kdehiddenvisibility kvm lvm lzma lzo md5sum-external mjpeg mmap mmx mmxext modules mp2 mpi mplayer mysql offensive opencore-amr pcap phonon plasma rar rdp sha512 shm sql sse sse2 sse3 sse4 sse4a subversion theora transcode upnp userlocales wav webdav webkit wma wmp"
Unset:  EMERGE_DEFAULT_OPTS
Comment 1 Chad A. Simmons 2009-09-21 00:04:26 UTC
Not sure but it looks like mdadm might be opening the raid array before it actually tries to stop it.

phenom / # strace mdadm --stop /dev/md2
execve("/sbin/mdadm", ["mdadm", "--stop", "/dev/md2"], [/* 35 vars */]) = 0
brk(0)                                  = 0x1115000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0c57c61000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0c57c60000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=132129, ...}) = 0
mmap(NULL, 132129, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f0c57c3f000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\353\1\0\0\0\0\0@"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1387696, ...}) = 0
mmap(NULL, 3495976, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f0c576f0000
mprotect(0x7f0c5783c000, 2097152, PROT_NONE) = 0
mmap(0x7f0c57a3c000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14c000) = 0x7f0c57a3c000
mmap(0x7f0c57a41000, 18472, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f0c57a41000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0c57c3e000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0c57c3d000
arch_prctl(ARCH_SET_FS, 0x7f0c57c3d6f0) = 0
mprotect(0x7f0c57a3c000, 16384, PROT_READ) = 0
mprotect(0x644000, 4096, PROT_READ)     = 0
mprotect(0x7f0c57c62000, 4096, PROT_READ) = 0
munmap(0x7f0c57c3f000, 132129)          = 0
getpid()                                = 10832
brk(0)                                  = 0x1115000
brk(0x1136000)                          = 0x1136000
open("/etc/mdadm.conf", O_RDONLY)       = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=210, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0c57c5f000
read(3, "ARRAY /dev/md1 metadata=0.90 UUID"..., 4096) = 210
read(3, ""..., 4096)                    = 0
read(3, ""..., 4096)                    = 0
close(3)                                = 0
munmap(0x7f0c57c5f000, 4096)            = 0
uname({sys="Linux", node="phenom", ...}) = 0
open("/dev/md2", O_RDWR)                = 3
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 2), ...}) = 0
ioctl(3, 0x800c0910, 0x7fff8ab81670)    = 0
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 2), ...}) = 0
ioctl(3, 0x800c0910, 0x7fff8ab81150)    = 0
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 2), ...}) = 0
ioctl(3, 0x800c0910, 0x7fff8ab81150)    = 0
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 2), ...}) = 0
ioctl(3, 0x800c0910, 0x7fff8ab80c60)    = 0
fstat(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(9, 2), ...}) = 0
open("/sys/block/md2/md/metadata_version", O_RDONLY) = 4
read(4, "0.90\n"..., 1024)              = 5
close(4)                                = 0
open("/sys/block/md2/md/level", O_RDONLY) = 4
read(4, "raid0\n"..., 1024)             = 6
close(4)                                = 0
ioctl(3, 0x932, 0)                      = -1 EBUSY (Device or resource busy)
write(2, "mdadm: failed to stop array /dev/"..., 62mdadm: failed to stop array /dev/md2: Device or resource busy
) = 62
write(2, "Perhaps a running process, mounte"..., 70Perhaps a running process, mounted filesystem or active volume group?
) = 70
close(3)                                = 0
exit_group(1)                           = ?
Comment 2 Chad A. Simmons 2009-09-21 00:17:20 UTC
Had a ghost bindmount going to the system where this raid was previously mounted. That was keeping md2 from stopping.