History

autofs4: remove hashed check in validate_wait()

The recent ->lookup() deadlock correction required the directory inode mutex to be dropped while waiting for expire completion. We were concerned about side effects from this change and one has been identified. I saw several error messages. They cause autofs to become quite confused and don't really point to the actual problem. Things like: handle_packet_missing_direct:1376: can't find map entry for (43,1827932) which is usually totally fatal (although in this case it wouldn't be except that I treat is as such because it normally is). do_mount_direct: direct trigger not valid or already mounted /test/nested/g3c/s1/ss1 which is recoverable, however if this problem is at play it can cause autofs to become quite confused as to the dependencies in the mount tree because mount triggers end up mounted multiple times. It's hard to accurately check for this over mounting case and automount shouldn't need to if the kernel module is doing its job. There was one other message, similar in consequence of this last one but I can't locate a log example just now. When checking if a mount has already completed prior to adding a new mount request to the wait queue we check if the dentry is hashed and, if so, if it is a mount point. But, if a mount successfully completed while we slept on the wait queue mutex the dentry must exist for the mount to have completed so the test is not really needed. Mounts can also be done on top of a global root dentry, so for the above case, where a mount request completes and the wait queue entry has already been removed, the hashed test returning false can cause an incorrect callback to the daemon. Also, d_mountpoint() is not sufficient to check if a mount has completed for the multi-mount case when we don't have a real mount at the base of the tree.

Ian Kent committed 17 years ago

Commit 463aea11 parent 586c7e61 file · +8 −14Browse files

Unified · Split

fs/autofs4/waitq.c+8−14
@@ -297,20 +297,14 @@ static int validate_request(struct autofs_wait_queue **wait, · 296 unmodified lines
297 */297 */
298 if (notify == NFY_MOUNT) {298 if (notify == NFY_MOUNT) {
299 /*299 /*
300 * If the dentry isn't hashed just go ahead and try the300 * If the dentry was successfully mounted while we slept
301 * mount again with a new wait (not much else we can do).301 * on the wait queue mutex we can return success. If it
302 */302 * isn't mounted (doesn't have submounts for the case of
303 if (!d_unhashed(dentry)) {303 * a multi-mount with no mount at it's base) we can
304 /*304 * continue on and create a new request.
305 * But if the dentry is hashed, that means that we305 */
306 * got here through the revalidate path. Thus, we306 if (have_submounts(dentry))
307 * need to check if the dentry has been mounted307 return 0;
308 * while we waited on the wq_mutex. If it has,
309 * simply return success.
310 */
311 if (d_mountpoint(dentry))
312 return 0;
313 }
314 }308 }
315 309
316 return 1;310 return 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t