The decision to not support link(2) of directories was very deliberate - it is an abomination that never should have been allowed in the first place. My guess is that the behavior of unlink(2) on directories is a direct side-effect of that (if link isn't supported, then why support unlink?). Also worth noting that ZFS also doesn't let you open(2) directories and read(2) from them, something (I believe) UFS does allow.
- Eric On Mon, Jun 25, 2012 at 10:40 AM, Garrett D'Amore <garr...@damore.org>wrote: > I don't know the precise history, but I think its a mistake to permit > direct link() or unlink() of directories. I do note that on BSD (MacOS at > least) unlink returns EPERM if the executing user is not superuser. I do > see that the man page for unlink() says this on illumos: > > The named file is a directory and > {PRIV_SYS_LINKDIR} is not asserted in the > effective set of the calling process, or the > filesystem implementation does not support > unlink() or unlinkat() on directories. > > I can't imagine why you'd *ever* want to support unlink() of a *directory* > -- what's the use case for it anyway (outside of filesystem repair)? > > Garrett D'Amore > garr...@damore.org > > > > On Jun 25, 2012, at 2:23 AM, Lionel Cons wrote: > > > Does someone know the history which led to the EPERM for unlink() of > > directories on ZFS? Why was this done this way, and not something like > > allowing the unlink and execute it on the next scrub or remount? > > > > Lionel > > > > > > ------------------------------------------- > > illumos-developer > > Archives: https://www.listbox.com/member/archive/182179/=now > > RSS Feed: > https://www.listbox.com/member/archive/rss/182179/21239177-c925e33f > > Modify Your Subscription: https://www.listbox.com/member/?& > > Powered by Listbox: http://www.listbox.com > > > > ------------------------------------------- > illumos-developer > Archives: https://www.listbox.com/member/archive/182179/=now > RSS Feed: > https://www.listbox.com/member/archive/rss/182179/21175057-f8151d0d > Modify Your Subscription: > https://www.listbox.com/member/?member_id=21175057&id_secret=21175057-02786781 > Powered by Listbox: http://www.listbox.com > -- Eric Schrock Delphix http://blog.delphix.com/eschrock 275 Middlefield Road, Suite 50 Menlo Park, CA 94025 http://www.delphix.com
_______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss