[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <406B4874-D3D8-4C05-9FA5-8A7A18ABF89C@mit.edu>
Date: Thu, 3 Mar 2011 09:34:08 -0500
From: Theodore Tso <tytso@....EDU>
To: Al Viro <viro@...IV.linux.org.uk>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC] st_nlink after rmdir() and rename()
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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists