Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Jan Kouba <kouba.honza@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Unable to remove read-only seeding device from a filesystem.
Date: Wed, 09 Apr 2014 13:00:13 +0200	[thread overview]
Message-ID: <1718136.Ye2ZxOq3uC@honzk> (raw)

When running this script:

dd if=/dev/zero of=seed-disk.img bs=1M seek=1k count=0
dd if=/dev/zero of=test-disk.img bs=1M seek=1k count=0

# Make image of seed device
mkfs.btrfs seed-disk.img
seed_dev=`losetup -f --show seed-disk.img`
mount $seed_dev /mnt/tmp
touch /mnt/tmp/a
umount /mnt/tmp
losetup -d $seed_dev
btrfstune -S 1 seed-disk.img

# Make read-only seed device
seed_dev=`losetup -f -r --show seed-disk.img`

test_dev=`losetup -f --show test-disk.img`

mount $seed_dev /mnt/tmp
btrfs dev add $test_dev /mnt/tmp
mount -o remount,rw /mnt/tmp

# This fails
btrfs dev delete $seed_dev /mnt/tmp

# cleanup
umount /mnt/tmp
losetup -d $seed_dev
losetup -d $test_dev

rm seed-disk.img
rm test-disk.img




the command 
"btrfs dev delete $seed_dev /mnt/tmp" fails with 
"ERROR: error removing the device '/dev/loop0' - Permission denied" message.

If /dev/loop0 is not read-only everything works. 

I tested this on ubuntu 13.10, 14.04 with stock kernel and btrfs-progs and on 
ubuntu 14.04 with latest PPA kernel (3.14.0-031400-generic) and v3.14 btrfs-
progs.

Is this behaviour expected or is it a bug? 

I thougt that btrfs never changes seeding devices, so I don't understand, why 
it needs to be writeable in order to remove it from a filesystem.


Jan Kouba






                 reply	other threads:[~2014-04-09 11:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1718136.Ye2ZxOq3uC@honzk \
    --to=kouba.honza@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox