There are two checks in the code for ENOTEMPTY, clarify that the first check is
doing a fast check without locks.
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
return;
}
- // non-empty dir?
+ // non-empty dir? do trivial fast unlocked check, do another check later with read locks
if (oldin->is_dir() && _dir_is_nonempty_unlocked(mdr, oldin)) {
respond_to_request(mdr, -ENOTEMPTY);
return;
if (!check_access(mdr, srci, MAY_WRITE))
return;
+ // with read lock, really verify oldin is empty
if (oldin &&
oldin->is_dir() &&
_dir_is_nonempty(mdr, oldin)) {