linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] autofs4 - follow_link missing funtionality
@ 2006-03-10 12:08 Ian Kent
  2006-03-10 22:50 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Kent @ 2006-03-10 12:08 UTC (permalink / raw)
  To: Andrew Morton; +Cc: autofs mailing list, Kernel Mailing List, linux-fsdevel


This functionality is also need for operation of autofs v5 direct mounts.

Signed-off-by: Ian Kent <raven@themaw.net>

---

--- linux-2.6.16-rc5-mm3/fs/autofs4/root.c.follow_link-ommission	2006-03-08 13:21:37.000000000 +0800
+++ linux-2.6.16-rc5-mm3/fs/autofs4/root.c	2006-03-08 13:27:47.000000000 +0800
@@ -57,6 +57,9 @@ struct inode_operations autofs4_indirect
 
 struct inode_operations autofs4_direct_root_inode_operations = {
 	.lookup		= autofs4_lookup,
+	.unlink		= autofs4_dir_unlink,
+	.mkdir		= autofs4_dir_mkdir,
+	.rmdir		= autofs4_dir_rmdir,
 	.follow_link	= autofs4_follow_link,
 };
 
@@ -337,10 +340,34 @@ static void *autofs4_follow_link(struct 
 	if (oz_mode || !lookup_type)
 		goto done;
 
+	/*
+	 * If the dentry contains directories then it is an
+	 * autofs multi-mount with no root offset. So don't
+	 * try to mount it again.
+	 */
+	spin_lock(&dcache_lock);
+	if (!list_empty(&dentry->d_subdirs)) {
+		spin_unlock(&dcache_lock);
+		goto done;
+	}
+	spin_unlock(&dcache_lock);
+
 	status = try_to_fill_dentry(dentry, 0);
 	if (status)
 		goto out_error;
 
+	/*
+	 * The mount succeeded but if there is no root mount
+	 * and directories have been created then it must
+	 * be an autofs multi-mount with no root offset.
+	 */
+	spin_lock(&dcache_lock);
+	if (!d_mountpoint(dentry) && !list_empty(&dentry->d_subdirs)) {
+		spin_unlock(&dcache_lock);
+		goto done;
+	}
+	spin_unlock(&dcache_lock);
+
 	if (!autofs4_follow_mount(&nd->mnt, &nd->dentry)) {
 		status = -ENOENT;
 		goto out_error;
--- linux-2.6.16-rc5-mm3/fs/autofs4/expire.c.follow_link-ommission	2006-03-08 14:18:25.000000000 +0800
+++ linux-2.6.16-rc5-mm3/fs/autofs4/expire.c	2006-03-08 13:28:21.000000000 +0800
@@ -113,10 +113,6 @@ static int autofs4_direct_busy(struct vf
 	DPRINTK("top %p %.*s",
 		top, (int) top->d_name.len, top->d_name.name);
 
-	/* Not a mountpoint - give up */
-	if (!d_mountpoint(top))
-		return 1;
-
 	/* If it's busy update the expiry counters */
 	if (!may_umount_tree(mnt)) {
 		struct autofs_info *ino = autofs4_dentry_ino(top);

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-26 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-10 12:08 [PATCH] autofs4 - follow_link missing funtionality Ian Kent
2006-03-10 22:50 ` Andrew Morton
2006-03-11 14:10   ` Ian Kent
2006-03-26 11:51   ` Ian Kent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).