All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miao Xie <miaox@cn.fujitsu.com>
To: cwillu <cwillu@cwillu.com>
Cc: Linux Btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] Btrfs: do not delete a subvolume which is in a R/O subvolume
Date: Wed, 24 Oct 2012 18:03:23 +0800	[thread overview]
Message-ID: <5087BCEB.8070303@cn.fujitsu.com> (raw)
In-Reply-To: <CAE5mzvhaQLZEMgyAPGZ7pFbNR9c17ke1FGRXUfY86vD31_3viQ@mail.gmail.com>

On Mon, 22 Oct 2012 05:57:12 -0600, cwillu wrote:
> On Mon, Oct 22, 2012 at 5:39 AM, Miao Xie <miaox@cn.fujitsu.com> wrote:
>> Step to reproduce:
>>  # mkfs.btrfs <disk>
>>  # mount <disk> <mnt>
>>  # btrfs sub create <mnt>/subv0
>>  # btrfs sub snap <mnt> <mnt>/subv0/snap0
>>  # change <mnt>/subv0 from R/W to R/O
>>  # btrfs sub del <mnt>/subv0/snap0
>>
>> We deleted the snapshot successfully. I think we should not be able to delete
>> the snapshot since the parent subvolume is R/O.
> 
> snap0 isn't read-only in that case, right?  From a user interaction
> standpoint, this seems like it just forces a user to rm -rf rather
> btrfs sub del, which strikes me as a bit ham-handed when all we really
> care about is leaving a (the?) directory entry where snap0 used to be.
> 

I don't think we can identify "btrfs sub del" with "rm -rf", because "rm -rf"
will check the permission of the parent directory of each file/directory which
is going to be deleted, but "btrfs sub del" doesn't do it, it will see all the
file/directory in the subvolume as one, so I think it seems like a special
"rmdir". From this standpoint, deleting a snapshot whose parent subvolume
is readonly should be forbidden.

Thanks
Miao

  reply	other threads:[~2012-10-24 10:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 11:39 [PATCH 2/2] Btrfs: do not delete a subvolume which is in a R/O subvolume Miao Xie
2012-10-22 11:57 ` cwillu
2012-10-24 10:03   ` Miao Xie [this message]
2012-10-24 10:13     ` cwillu

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=5087BCEB.8070303@cn.fujitsu.com \
    --to=miaox@cn.fujitsu.com \
    --cc=cwillu@cwillu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.