Attempt on mounting a non-existing directory
Recently we migrated from static nfs mounts to autofs on our webserver. This concerns all /home/*/public_html/ directories which are mounted read-only by default. /etc/autofs/auto.home includes some exceptions whereas certain users requested their ~/public_html or even ~/ to be writable.
This setup works _almost_ all the time although syslog reveals some extremely strange behaviors, a snippet:
Oct 31 17:38:02 host1 automount[14335]: mount(nfs): nfs: mount failure
nfs.somewhere.com:/home/user/.bash_profile/public_html on /home/user/.bash_profile/public_html
There are numerous similair failures including normal webserver requests. The above sample was the result of a "su - user" if anyone wonders.
The big question mark is: Why does autofs try to mount ~/public_html one threshold/level lower? It shouldn't look any further than /home/anyuser/public_html.
~/public_html
Server info
===========
OS: 2.6.19-gentoo-r5
net-fs/nfs-utils: 1.0.12-r1
net-libs/libnfsidmap: 0.19
An offtopic question: what is the real function of the -g (ghost) flag?? manpages aren't any help.
Thank you in advance,
xiwen
Ian Kent
maintainerQuoted 22 lines · Xiwen Cheng
Recently we migrated from static nfs mounts to autofs on our webserver. This concerns all
/home/*/public_html/directories which are mounted read-only by default./etc/autofs/auto.homeincludes some exceptions whereas certain users requested their ~/public_html or even ~/ to be writable.This setup works _almost_ all the time although syslog reveals some extremely strange behaviors, a snippet:
Oct 31 17:38:02 host1 automount[14335]: mount(nfs): nfs: mount failurenfs.somewhere.com:/home/user/.bash_profile/public_html on
/home/user/.bash_profile/public_htmlThere are numerous similair failures including normal webserver requests. The above sample was the result of a "su - user" if anyone wonders.
The big question mark is: Why does autofs try to mount ~/public_html one threshold/level lower? It shouldn't look any further than
/home/anyuser/public_html.
~/public_html
Quoted 5 lines
Server info
===========
OS: 2.6.19-gentoo-r5
net-fs/nfs-utils: 1.0.12-r1
net-libs/libnfsidmap: 0.19
Strange you report the versions of these but not autofs, being the package your asking about.
Ian
Quoted 6 lines · Xiwen Cheng
Recently we migrated from static nfs mounts to autofs on our webserver. This concerns all
/home/*/public_html/directories which are mounted read-only by default./etc/autofs/auto.homeincludes some exceptions whereas certain users requested their ~/public_html or even ~/ to be writable.
Quoted 6 lines
This setup works _almost_ all the time although syslog reveals some extremely strange behaviors, a snippet:
Oct 31 17:38:02 host1 automount[14335]: mount(nfs): nfs: mount failurenfs.somewhere.com:/home/user/.bash_profile/public_html on
/home/user/.bash_profile/public_html
This looks a lot like a kernel bug we've chased down and fixed. It's hard to be sure, though, without more of the debug log. I can't recall exactly when the fix went in, either. Is it possible for you to upgrade your kernel and try again?
Quoted 4 lines
The big question mark is: Why does autofs try to mount ~/public_html one threshold/level lower? It shouldn't look any further than
/home/anyuser/public_html.
~/public_html
http://people.redhat.com/jmoyer has a section on filing bug reports. If you collect the data requested on that page, then we can get further in diagnosing your problem.
Quoted 6 lines
Server info
===========
OS: 2.6.19-gentoo-r5
net-fs/nfs-utils: 1.0.12-r1
net-libs/libnfsidmap: 0.19
net-fs/autofs: 4.1.3-r7
I have no idea what patches are applied to the kernel and the autofs package.
Quoted 2 lines
An offtopic question: what is the real function of the -g (ghost) flag?? manpages aren't any help.
On my systems (Red Hat based, go figure), the automount man page documents the flag.
-g, --ghost
Request that directories in the automount be shown but not mounted until accesssed. The wildcard entry is not ghosted.
This is the equivalent of browsable maps.
Cheers,
Jeff
Ian Kent
maintainerQuoted 17 lines · Xiwen Cheng
Recently we migrated from static nfs mounts to autofs on our webserver. This concerns all
/home/*/public_html/directories which are mounted read-only by default./etc/autofs/auto.homeincludes some exceptions whereas certain users requested their ~/public_html or even ~/ to be writable.This setup works _almost_ all the time although syslog reveals some extremely strange behaviors, a snippet:
Oct 31 17:38:02 host1 automount[14335]: mount(nfs): nfs: mount failurenfs.somewhere.com:/home/user/.bash_profile/public_html on
/home/user/.bash_profile/public_htmlThere are numerous similair failures including normal webserver requests. The above sample was the result of a "su - user" if anyone wonders.
Quoted 8 lines
The big question mark is: Why does autofs try to mount ~/public_html one threshold/level lower? It shouldn't look any further than
/home/anyuser/public_html.
~/public_htmlServer info
===========
OS: 2.6.19-gentoo-r5
I don't know what additional autofs4 patches may be included in this kernel but here is the patch for the 2.6.19 upstream kernel.
Can you give this a try and see if it applies cleanly and check if it resolves the problem please.
The other difficulty you face is that 4.1.3 is an old release and many things have been fixed in following releases. Lets see how this goes.
---
fs/autofs/inode.c +4 -3
@@ -28,10 +28,11 @@ void autofs_kill_sb(struct super_block */* * In the event of a failure in get_sb_nodev the superblock * info is not present so nothing else has been setup, so -* just exit when we are called from deactivate_super. +* just call kill_anon_super when we are called from +* deactivate_super. */ if (!sbi) -return ; + goto out_kill_sb;if ( !sbi->catatonic )autofs_catatonic_mode (sbi);/* Free wait queues, close pipe */
@@ -44,6 +45,7 @@ void autofs_kill_sb(struct super_block *kfree (sb->s_fs_info); +out_kill_sb:DPRINTK (("autofs: shutting down\n" ));kill_anon_super (sb); }
@@ -209,7 +211,6 @@ fail_iput: fail_free:kfree (sbi); s->s_fs_info =NULL ; -kill_anon_super (s); fail_unlock:return -EINVAL ; }
fs/autofs4/autofs_i.h +4 -0
@@ -52,6 +52,8 @@ struct autofs_info {int flags; +struct list_head rehash; +struct autofs_sb_info *sbi;unsigned long last_used;atomic_t count;
@@ -110,6 +112,8 @@ struct autofs_sb_info {struct mutex wq_mutex;spinlock_t fs_lock;struct autofs_wait_queue *queues;/* Wait queue pointer */ +spinlock_t rehash_lock; +struct list_head rehash_list; };static inline struct autofs_sb_info *autofs4_sbi (struct super_block *sb)
fs/autofs4/inode.c +10 -6
@@ -48,6 +48,8 @@ struct autofs_info *autofs4_init_ino(str ino->dentry =NULL ; ino->size =0 ; +INIT_LIST_HEAD (&ino->rehash); + ino->last_used = jiffies;atomic_set (&ino->count,0 );
@@ -152,21 +154,22 @@ void autofs4_kill_sb(struct super_block/* * In the event of a failure in get_sb_nodev the superblock * info is not present so nothing else has been setup, so -* just exit when we are called from deactivate_super. +* just call kill_anon_super when we are called from +* deactivate_super. */ if (!sbi) -return ; + goto out_kill_sb; - sb->s_fs_info =NULL ; - -if ( !sbi->catatonic ) +if (!sbi->catatonic)autofs4_catatonic_mode (sbi);/* Free wait queues, close pipe */ /* Clean up and release dangling references */ autofs4_force_release (sbi); + sb->s_fs_info =NULL ;kfree (sbi); +out_kill_sb:DPRINTK ("shutting down" );kill_anon_super (sb); }
@@ -334,6 +337,8 @@ int autofs4_fill_super(struct super_blocmutex_init (&sbi->wq_mutex);spin_lock_init (&sbi->fs_lock); sbi->queues =NULL ; +spin_lock_init (&sbi->rehash_lock); +INIT_LIST_HEAD (&sbi->rehash_list); s->s_blocksize =1024 ; s->s_blocksize_bits =10 ; s->s_magic =AUTOFS_SUPER_MAGIC ;
@@ -426,7 +431,6 @@ fail_ino: fail_free:kfree (sbi); s->s_fs_info =NULL ; -kill_anon_super (s); fail_unlock:return -EINVAL ; }
fs/autofs4/root.c +175 -26
290 lines not on this page · raw message
fs/autofs4/waitq.c +8 -4
@@ -84,7 +84,11 @@ static void autofs4_notify_daemon(struct struct autofs_wait_queue *wq, int type) { -union autofs_packet_union pkt; +union { +struct autofs_packet_hdr hdr; +union autofs_packet_union v4_pkt; +union autofs_v5_packet_union v5_pkt; + } pkt;size_t pktsz; DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d",
@@ -98,7 +102,7 @@ static void autofs4_notify_daemon(struct/* Kernel protocol v4 missing and expire packets */ case autofs_ptype_missing: { -struct autofs_packet_missing *mp = &pkt.missing; +struct autofs_packet_missing *mp = &pkt.v4_pkt.missing; pktsz =sizeof (*mp);
@@ -110,7 +114,7 @@ static void autofs4_notify_daemon(struct }case autofs_ptype_expire_multi: { -struct autofs_packet_expire_multi *ep = &pkt.expire_multi; +struct autofs_packet_expire_multi *ep = &pkt.v4_pkt.expire_multi; pktsz =sizeof (*ep);
@@ -129,7 +133,7 @@ static void autofs4_notify_daemon(structcase autofs_ptype_missing_direct:case autofs_ptype_expire_direct: { -struct autofs_v5_packet *packet = &pkt.v5_packet; +struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet; pktsz =sizeof (*packet);
include/linux/auto_fs4.h +12 -4
@@ -59,6 +59,13 @@ struct autofs_packet_expire_multi {char name[NAME_MAX +1 ]; }; +union autofs_packet_union { +struct autofs_packet_hdr hdr; +struct autofs_packet_missing missing; +struct autofs_packet_expire expire; +struct autofs_packet_expire_multi expire_multi; +}; +/* autofs v5 common packet struct */ struct autofs_v5_packet {struct autofs_packet_hdr hdr;
@@ -78,12 +85,13 @@ typedef struct autofs_v5_packet autofs_ptypedef struct autofs_v5_packet autofs_packet_missing_direct_t ;typedef struct autofs_v5_packet autofs_packet_expire_direct_t ; -union autofs_packet_union { +union autofs_v5_packet_union {struct autofs_packet_hdr hdr; -struct autofs_packet_missing missing; -struct autofs_packet_expire expire; -struct autofs_packet_expire_multi expire_multi;struct autofs_v5_packet v5_packet; +autofs_packet_missing_indirect_t missing_indirect; +autofs_packet_expire_indirect_t expire_indirect; +autofs_packet_missing_direct_t missing_direct; +autofs_packet_expire_direct_t expire_direct; };#define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int)