Skip to contentSkip to conversation

Bug in autofs4_d_automount()?

DISCUSSION David Howells 2 participants 2 messages Jun 17, 2011 – Jun 18, 2011 Kernel automounter

lore
Share & tools
lore
#0 lore raw

Hi Ian,

At the top of autofs4_d_automount() you have:

	/* The daemon never triggers a mount. */
	if (autofs4_oz_mode(sbi))
		return NULL;

I think this should be returning -EISDIR. If by some chance we do get here in Oz mode, this will cause the kernel to just loop forever. A return of NULL is meant to indicate that you got a collision and that it should recheck the mountpoint - but it does not advance path in follow_managed().

-EISDIR is the return to indicate this is to be treated as a normal directory.

David

maintainer
#1 lore raw
Quoted 4 lines · David Howells

Hi Ian,

At the top of autofs4_d_automount() you have:

Quoted 8 lines
	/* The daemon never triggers a mount. */
	if (autofs4_oz_mode(sbi))
		return NULL;

I think this should be returning -EISDIR. If by some chance we do get here in Oz mode, this will cause the kernel to just loop forever. A return of NULL is meant to indicate that you got a collision and that it should recheck the mountpoint - but it does not advance path in follow_managed().

I think your mistaken this time.

That was done to work around the fact that -EISDIR can't be returned in the case where the dentry doesn't and (and won't have) a explicit mount on it without entering an ELOOP situation. IIRC I needed to return NULL here and handle it in ->d_manage() to make this work.

Quoted 2 lines

-EISDIR is the return to indicate this is to be treated as a normal directory.

That would be the better way to do it but the logic doesn't allow it ATM.

Quoted 2 lines

David