Linux-BTRFS Archive on
 help / Atom feed
* mkfs.btrfs reports Device or resource busy for unmounted device
@ 2019-01-31 17:36 Karollil, Anoop (GE Digital)
  0 siblings, 0 replies; 1+ messages in thread
From: Karollil, Anoop (GE Digital) @ 2019-01-31 17:36 UTC (permalink / raw)
  To: linux-btrfs

I faced an issue with mkfs.btrfs reporting “Device or resource busy” for an unmounted device. Maybe the umount should have failed as a process listed the btrfs filesystem in its /proc/PID/mountinfo after the umount. A subsequent mkfs.btrfs did fail when it tried to open the device with O_EXCL.
I think I am seeing the same thing by doing the following on Ubuntu 18.04.1 x86_64 with btrfs-progs v4.15.1-1build1 and kernel v4.15.0-43-generic:

Initial setup based on
dd if=/dev/zero of=btrfs.img bs=4k count=100000
mkfs.btrfs btrfs.img
losetup /dev/loop1 btrfs.img
mkdir /mnt/test
mount -t btrfs /dev/loop1 /mnt/test
Then run the following in one terminal:
sudo sh -c "while true; do mount -t btrfs /dev/loop1 /mnt/test; echo "foobar" > /mnt/test/foobar; umount /mnt/test; sleep 1; done"
And run the following in another terminal:
while true; do sudo mkfs.btrfs -f /dev/loop1;sleep 1;done
You should see the mkfs.btrfs fail occasionally with “ERROR: unable to open /dev/loop1: Device or resource busy”. Something similar seems to have been fixed by this patch: but I couldn’t reproduce this problem with the steps mentioned there.

Unsubscribe from GE's commercial electronic messages:*casl-unsubscribe 
Désabonner des messages électroniques commerciaux de GE:*lcap-desabonnement

^ permalink raw reply	[flat|nested] 1+ messages in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31 17:36 mkfs.btrfs reports Device or resource busy for unmounted device Karollil, Anoop (GE Digital)

Linux-BTRFS Archive on

Archives are clonable:
	git clone --mirror linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ \
	public-inbox-index linux-btrfs

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox