linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyich@gmail.com>
To: "krzf83@gmail.com " <krzf83@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: unlink directory with files (rm -d)
Date: Sun, 14 Aug 2011 11:03:04 +0300	[thread overview]
Message-ID: <20110814110304.1537a2a3@sf.home> (raw)
In-Reply-To: <CAJ1PRSnJHJ+fEgYRv3xN+3hzcvtreNZrnqJUszmoK8YjVCn4VA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]

> I wonder if it would be possible to implement instant unlinking
> directory with files in it. Since btrfs is based on b trees it could
> be possible. Filesystem would have to "loose" all information on
> directory and object in it, and allow overwriting this information.
> This would be great feature, because everyone knows that recursive
> deleting large directories, with milions of files require huge io
> traffic.

I think you'll have to read directory contents anyway in order not
to break permission/vfs-mountpoint/attributes violation.

Consider the following example:

# it's me
$ id
uid=1000(slyfox) gid=100(users)

# fun layout
$ ls -ld test test/root_o test/root_o/root_o 
drwxr-xr-x 3 slyfox users 60 Aug 14 10:56 test
drwxr-xr-x 2 root   root  60 Aug 14 10:56 test/root_o
-rw-r--r-- 1 root   root   0 Aug 14 10:56 test/root_o/root_o

$ rm -rf test/
rm: cannot remove `test/root_o/root_o': Permission denied

We can't delete it because of foreigner in our dir.

-- 

  Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-08-14  8:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJ1PRS=9obyg-FRq=V6pZ7J=tccYA_UXWvNzF-6SaywL6rBY9g@mail.gmail.com>
2011-08-13 21:59 ` unlink directory with files (rm -d) krzf83@gmail.com 
2011-08-14  8:03   ` Sergei Trofimovich [this message]
2011-08-14 14:18     ` krzf83@gmail.com 
2011-08-14 14:20       ` krzf83@gmail.com 
2011-08-15 15:58   ` Chris Mason

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=20110814110304.1537a2a3@sf.home \
    --to=slyich@gmail.com \
    --cc=krzf83@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;
as well as URLs for NNTP newsgroup(s).