Project

General

Profile

Bug #7653

tmpfs: calling unlink() on a directory which isn't empty should fail

Added by Andrew Stormont over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
High
Category:
filesystems (not ZFS)
Start date:
2016-12-07
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

Calling unlink() on a directory which isn't empty should fail. Instead the directory gets removed but its entries don't get freed. This is similar to #7203, which is specific to freeing empty directories. How this wasn't caught sooner has me scratching my head.

It seems like we have two choices for the errno.
ENOTEMPTY - what freebsd would return
EEXIST - this seems more illumos-like

#1

Updated by Andrew Stormont over 4 years ago

I opted to have the function return EEXIST which seems to be in-keeping with the spec:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html

Webrev: http://cr.illumos.org/~webrev/andy_js/7653/

#2

Updated by Andrew Stormont over 4 years ago

  • Description updated (diff)
#3

Updated by Andrew Stormont over 4 years ago

Running unlink on directory that only contains directories also seems to cause a panic!
The webrev above fixes that issue too.

#4

Updated by Andrew Stormont over 4 years ago

  • Status changed from In Progress to Feedback
#5

Updated by Andrew Stormont over 4 years ago

  • Status changed from Feedback to Closed

Closing this as I think having tmpfs error out is the wrong approach.

Also available in: Atom PDF