Bug 1672851
Summary: | With parallel-readdir enabled, deleting a directory containing stale linkto files fails with "Directory not empty" | |||
---|---|---|---|---|
Product: | [Community] GlusterFS | Reporter: | Nithya Balachandran <nbalacha> | |
Component: | distribute | Assignee: | Nithya Balachandran <nbalacha> | |
Status: | CLOSED NEXTRELEASE | QA Contact: | ||
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | mainline | CC: | bugs | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | If docs needed, set a value | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 1672869 1679004 (view as bug list) | Environment: | ||
Last Closed: | 2019-02-13 18:24:39 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1672869, 1678183, 1679004 |
Description
Nithya Balachandran
2019-02-06 03:46:04 UTC
RCA: rm -rf <dir> works by first listing and unlinking all entries in <dir> and then calling an rmdir <dir>. As DHT readdirp does not return linkto files in the listing, they are not unlinked as part of the rm -rf itself. dht_rmdir handles this by performing a readdirp internally on <dir> and deleting all stale linkto files before proceeding with the actual rmdir operation. When parallel-readdir is enabled, the rda xlator is loaded below dht in the graph and proactively lists and caches entries when an opendir is performed. Entries are returned from this cache for any subsequent readdirp calls on the directory that was opened. DHT uses the presence of the trusted.glusterfs.dht.linkto xattr to determine whether a file is a linkto file. As this call to opendir does not set trusted.glusterfs.dht.linkto in the list of requested xattrs for the opendir call, the cached entries do not contain this xattr value. As none of the entries returned will have the xattr, DHT believes they are all data files and fails the rmdir with ENOTEMPTY. Turning off parallel-readdir allows the rm -rf to succeed. REVIEW: https://review.gluster.org/22160 (cluster/dht: Request linkto xattrs in dht_rmdir opendir) posted (#1) for review on master by N Balachandran REVIEW: https://review.gluster.org/22160 (cluster/dht: Request linkto xattrs in dht_rmdir opendir) merged (#3) on master by Raghavendra G |