Commit 9d459f2
committed
fix(rclone/operations): fix CheckPermissions for NFS
4f1adf6 introduced explicit cleanup of test dirs in CheckPermissions.
The problem was that the Purge happened while the file descriptor from
the "cat" verification was still held. On a regular filesystem this is
not an issue, as Purge would still just remove the dir with its contents
and make the file descriptor broken. The situation is different with
NFS, as when another process tries to remove file with open descriptor,
NFS will perform a "silly rename" and create an ephemeral .nfsXXX file
so that the descriptor is not broken. So when rclone runs Purge, it first
removes all its files, this results in creation of .nfsXXX files and when
it proceeds with dir removal, it fails with "directory not empty".
This commit fixes the bug related to holding the file descriptor for too
long. It also explicitly checks the permission to remove a file and
performs the cleanup without failing the CheckPermissions if just
the cleanup failed, as it is not critical.1 parent ebb4191 commit 9d459f2
1 file changed
Lines changed: 13 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
126 | 130 | | |
127 | 131 | | |
128 | 132 | | |
129 | | - | |
| 133 | + | |
130 | 134 | | |
131 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
132 | 139 | | |
133 | 140 | | |
134 | 141 | | |
| |||
0 commit comments