[Bugs] [Bug 1442724] rm -rf <dir> returns ENOTEMPTY even though ls on the mount point returns no files

bugzilla at redhat.com bugzilla at redhat.com
Thu Apr 20 04:54:38 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1442724

Nithya Balachandran <nbalacha at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |POST



--- Comment #4 from Nithya Balachandran <nbalacha at redhat.com> ---
RCA:

The attached script creates a lot of files and renames them so we end up with
multiple linkto files on the bricks.
Start a remove brick and wait until the rebalance completes (do not commit the
remove brick). This ensures that the brick is still part of the volume so rmdir
commands will be sent to it as well.

rm -rf <dir> will send an unlink for each entry returned followed by an unlink
on the directory.

dht_rmdir first performs a readdirp on each subvol to make sure there are no
entries in the directories on the bricks. Any stale linkto files found will be
deleted. This is particularly useful as would not be cleaned up otherwise.

The issue is that dht sends the readdirp only once to each subvol. If there are
more stale linkto files on the brick than can be returned in a single readdirp
call, they will not be cleaned up and the rmdir will fail with ENOTEMPTY.

The fix involves sending readdirp to each brick until no more entries are
returned.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=0MKab43eK8&a=cc_unsubscribe


More information about the Bugs mailing list