Skip to contentSkip to conversation

autofs5 patches for older kernels

DISCUSSION Michael 2 participants 3 messages Nov 5, 2007 – Nov 26, 2007

Subsystems (2)
lore
Share & tools
lore

Michael

author
#0 lore raw

Hello,

I am running an older SuSE SLES9 release. It ships with autofs-4.1.3 with a 2.6.5 kernel.

We are having a number of issues with the automount daemon dying on certain mounts, failing to be responsive, etc in a rather large environment.

We would like to upgrade to autofs5 but the kernel shipped ( 2.6.5 ) doesn't include support for autofs5 or a great number of patches that have gone into 2.6.16+ kernels.

Is anyone maintaining a current autofs patch set against older 2.6.x kernels?

Michael

maintainer
#1 lore raw
Quoted 9 lines · Michael

Hello,

I am running an older SuSE SLES9 release. It ships with autofs-4.1.3 with a 2.6.5 kernel.

We are having a number of issues with the automount daemon dying on certain mounts, failing to be responsive, etc in a rather large environment.

Quoted 6 lines

We would like to upgrade to autofs5 but the kernel shipped ( 2.6.5 ) doesn't include support for autofs5 or a great number of patches that have gone into 2.6.16+ kernels.

Is anyone maintaining a current autofs patch set against older 2.6.x kernels?

Only back to 2.6.9.

Let me tell, you this really difficult.
I've already spent some time on it and it is hard work.
If I was able to get time to complete the port then you would need to be prepared to help debug errors introduced in the transcription. There are bound to be some as I don't have 2.6.5 based machines for testing.

Ian

maintainer
#2 lore raw
In reply to Michael
Quoted 9 lines · Michael

Hello,

I am running an older SuSE SLES9 release. It ships with autofs-4.1.3 with a 2.6.5 kernel.

We are having a number of issues with the automount daemon dying on certain mounts, failing to be responsive, etc in a rather large environment.

Quoted 6 lines

We would like to upgrade to autofs5 but the kernel shipped ( 2.6.5 ) doesn't include support for autofs5 or a great number of patches that have gone into 2.6.16+ kernels.

Is anyone maintaining a current autofs patch set against older 2.6.x kernels?

Here is a first attempt at a version 5 update for 2.6.5.

I'm not sure this will even compile because the 2.6.5 compile fails early on so I can't test it.

Not also that the patch is against the standard released 2.6.5 and includes a couple of VFS changes. If there are any vendor changes they could cause the patch to not apply to the kernel.

Ian

---

fs/autofs/autofs_i.h +1 -0
diff -Nurp linux-2.6.5.orig/fs/autofs/autofs_i.h linux-2.6.5/fs/autofs/autofs_i.h
@@ -150,6 +150,7 @@ extern struct file_operations autofs_roo
 /* Initializing function */
 
 int autofs_fill_super(struct super_block *, void *, int);
+void autofs_kill_sb(struct super_block *);
 
 /* Queue management functions */
 
fs/autofs/dirhash.c +1 -1
diff -Nurp linux-2.6.5.orig/fs/autofs/dirhash.c linux-2.6.5/fs/autofs/dirhash.c
@@ -92,7 +92,7 @@ struct autofs_dir_ent *autofs_expire(str
 			;
 		dput(dentry);
 
-		if ( may_umount(mnt) == 0 ) {
+		if ( may_umount(mnt) ) {
 			mntput(mnt);
 			DPRINTK(("autofs: signaling expire on %s\n", ent->name));
 			return ent; /* Expirable! */
fs/autofs/init.c +1 -1
diff -Nurp linux-2.6.5.orig/fs/autofs/init.c linux-2.6.5/fs/autofs/init.c
@@ -24,7 +24,7 @@ static struct file_system_type autofs_fs
 	.owner		= THIS_MODULE,
 	.name		= "autofs",
 	.get_sb		= autofs_get_sb,
-	.kill_sb	= kill_anon_super,
+	.kill_sb	= autofs_kill_sb,
 };
 
 static int __init init_autofs_fs(void)
fs/autofs/inode.c +16 -3
diff -Nurp linux-2.6.5.orig/fs/autofs/inode.c linux-2.6.5/fs/autofs/inode.c
@@ -19,11 +19,20 @@
 #include "autofs_i.h"
 #include <linux/module.h>
 
-static void autofs_put_super(struct super_block *sb)
+void autofs4_kill_sb(struct super_block *sb)
 {
 	struct autofs_sb_info *sbi = autofs_sbi(sb);
 	unsigned int n;
 
+	/*
+	 * In the event of a failure in get_sb_nodev the superblock
+	 * info is not present so nothing else has been setup, so
+	 * just call kill_anon_super when we are called from
+	 * deactivate_super.
+	 */
+	if (!sbi)
+		goto out_kill_sb;
+
 	if ( !sbi->catatonic )
 		autofs_catatonic_mode(sbi); /* Free wait queues, close pipe */
 
@@ -35,14 +44,15 @@ static void autofs_put_super(struct supe
 
 	kfree(sb->s_fs_info);
 
+out_kill_sb:
 	DPRINTK(("autofs: shutting down\n"));
+	kill_anon_super(sb);
 }
 
 static void autofs_read_inode(struct inode *inode);
 
 static struct super_operations autofs_sops = {
 	.read_inode	= autofs_read_inode,
-	.put_super	= autofs_put_super,
 	.statfs		= simple_statfs,
 };
 
@@ -136,7 +146,8 @@ int autofs_fill_super(struct super_block
 
 	s->s_fs_info = sbi;
 	sbi->magic = AUTOFS_SBI_MAGIC;
-	sbi->catatonic = 0;
+	sbi->pipe = NULL;
+	sbi->catatonic = 1;
 	sbi->exp_timeout = 0;
 	sbi->oz_pgrp = process_group(current);
 	autofs_initialize_hash(&sbi->dirhash);
@@ -178,6 +189,7 @@ int autofs_fill_super(struct super_block
 	if ( !pipe->f_op || !pipe->f_op->write )
 		goto fail_fput;
 	sbi->pipe = pipe;
+	sbi->catatonic = 0;
 
 	/*
 	 * Success! Install the root dentry now to indicate completion.
@@ -196,6 +208,7 @@ fail_iput:
 	iput(root_inode);
 fail_free:
 	kfree(sbi);
+	s->s_fs_info = NULL;
 fail_unlock:
 	return -EINVAL;
 }
fs/autofs/waitq.c +1 -0
diff -Nurp linux-2.6.5.orig/fs/autofs/waitq.c linux-2.6.5/fs/autofs/waitq.c
@@ -41,6 +41,7 @@ void autofs_catatonic_mode(struct autofs
 		wq = nwq;
 	}
 	fput(sbi->pipe);	/* Close the pipe */
+	sbi->pipe = NULL;
 	autofs_hash_dputall(&sbi->dirhash); /* Remove all dentry pointers */
 }
 
fs/autofs4/autofs_i.h +100 -26

206 lines not on this page · raw message

fs/autofs4/expire.c +325 -151

572 lines not on this page · raw message

fs/autofs4/init.c +1 -1
diff -Nurp linux-2.6.5.orig/fs/autofs4/init.c linux-2.6.5/fs/autofs4/init.c
@@ -24,7 +24,7 @@ static struct file_system_type autofs_fs
 	.owner		= THIS_MODULE,
 	.name		= "autofs",
 	.get_sb		= autofs_get_sb,
-	.kill_sb	= kill_anon_super,
+	.kill_sb	= autofs4_kill_sb,
 };
 
 static int __init init_autofs4_fs(void)
fs/autofs4/inode.c +180 -25

345 lines not on this page · raw message

fs/autofs4/root.c +641 -182

1,123 lines not on this page · raw message

fs/autofs4/symlink.c +3 -10
diff -Nurp linux-2.6.5.orig/fs/autofs4/symlink.c linux-2.6.5/fs/autofs4/symlink.c
@@ -12,21 +12,14 @@
 
 #include "autofs_i.h"
 
-static int autofs4_readlink(struct dentry *dentry, char *buffer, int buflen)
-{
-	struct autofs_info *ino = autofs4_dentry_ino(dentry);
-
-	return vfs_readlink(dentry, buffer, buflen, ino->u.symlink);
-}
-
 static int autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
 {
 	struct autofs_info *ino = autofs4_dentry_ino(dentry);
-
-	return vfs_follow_link(nd, ino->u.symlink);
+	nd_set_link(nd, (char *)ino->u.symlink);
+	return 0;
 }
 
 struct inode_operations autofs4_symlink_inode_operations = {
-	.readlink	= autofs4_readlink,
+	.readlink	= generic_readlink,
 	.follow_link	= autofs4_follow_link
 };
fs/autofs4/waitq.c +217 -60

385 lines not on this page · raw message

fs/namei.c +44 -15

96 lines not on this page · raw message

fs/namespace.c +62 -3

78 lines not on this page · raw message

include/linux/auto_fs4.h +64 -5

73 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.