OpenSolaris

Printable Version Enter a New Search
Bug ID 6531759
Synopsis zfs_rmdir() can return EEXIST on an empty directory when spotlight is messing with it
State 10-Fix Delivered (Fix available in build)
Category:Subcategory kernel:zfs
Keywords
Responsible Engineer Mark Maybee
Reported Against
Duplicate Of
Introduced In solaris_nevada
Commit to Fix snv_62
Fixed In snv_62
Release Fixed solaris_nevada(snv_62) , solaris_10u6(s10u6_01) (Bug ID:2156315)
Related Bugs
Submit Date 7-March-2007
Last Update Date 29-April-2008
Description
zfs_dirempty() can return EEXIST even if its empty if there are other threads (say
a lookup) active on that directory.  This is due to dzp->z_dirlocks != 0.

Some possible solutions:
1) add a new "remove" reader/writer lock that blocks out new zfs_dirent_lock() requests
when grabbed as WRITER.

2) Simply delay and retry if the directory is really empty (dzp->z_phys->zp_size == 2), but
there are lookers (dzp->z_dirlocks != 0)

3) Set some flag in the dzp saying its removed, deny future creates, and immediatley
return success to user.  Real cleanup is delayed until final looker finishes.

1) currently seems like the best approach.  2) can conceivable loop forever.  3) this one
might add some code/interface ugliness.
Work Around
N/A
Comments
N/A