[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unlink directory with files (rm -d)



> 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: signature.asc
Description: PGP signature


[Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux