Thread (5 messages) 5 messages, 3 authors, 2011-08-15

Re: unlink directory with files (rm -d)

From: Sergei Trofimovich <hidden>
Date: 2011-08-14 08:03:04

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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help