Re: [RFC] st_nlink after rmdir() and rename()

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

 



On Mar 2, 2011, at 10:24 PM, Al Viro wrote:

> We have an interesting problem.  Consider the following sequence
> of syscalls:
> 	mkdir("foo", 0777);
> 	mkdir("bar", 0777);
> 	fd1 = open("foo", O_DIRECTORY);
> 	fd2 = open("bar", O_DIRECTORY);
> 	rename("foo", "bar");	/* kill old bar */

I must be missing something.  I didn't think you could rename on
top of a directory and have the directory disappear.  Don't you get
an error in that case?  What happens if bar contains files?

We don't allow:  mkdir("bar", 0777); unlink("bar");

Why should this be any different?

-- Ted

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux