All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nested mounts with loop
@ 2007-09-25 16:21 Matthias Koenig
  2007-09-25 18:04 ` Ian Kent
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Matthias Koenig @ 2007-09-25 16:21 UTC (permalink / raw)
  To: autofs mailing list

Hi,

we noticed a problem concerning loop mounts on locations that 
have to be mounted before. E.g. consider the following situation,
a NFS server exporting a cd image, which we want to loop mount
locally to get access to the content:

auto.master:
/cdimage        auto.cdimage
/cdcontent      auto.cdcontent

auto.cdimage:
foo             nfsserver:/cdimage/foo.img

auto.cdcontent:
foo             -fstype=auto,loop       :/cdimage/foo/foo.img

The access to /cdcontent/foo will fail, when /cdimage/foo is not 
mounted before, because spawn_mount does not use SPAWN_OPT_ACCESS
in this case.
The patch below fixes this problem.

Matthias

Index: autofs-git20070924/daemon/spawn.c
===================================================================
--- autofs-git20070924.orig/daemon/spawn.c
+++ autofs-git20070924/daemon/spawn.c
@@ -293,6 +293,13 @@ int spawn_mount(logger *log, ...)
 	while ((*p++ = va_arg(arg, char *)));
 	va_end(arg);
 
+#ifndef ENABLE_MOUNT_LOCKING
+	/* validate loop mounts as they could be on some location to be
+	 * mounted first */
+	if (!strcmp(argv[4], "-o") && strstr(argv[5], "loop"))
+		options = SPAWN_OPT_ACCESS;
+#endif
+
 	while (retries--) {
 		ret = do_spawn(log, options, prog, (const char **) argv);
 		if (ret & MTAB_NOTUPDATED)

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

end of thread, other threads:[~2007-10-10  4:19 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-25 16:21 [PATCH] nested mounts with loop Matthias Koenig
2007-09-25 18:04 ` Ian Kent
2007-09-26 15:32   ` Matthias Koenig
2007-09-26 15:49     ` Ian Kent
2007-09-26 16:02       ` Jeff Moyer
2007-10-02  5:19         ` Ian Kent
2007-10-02  9:37           ` Matthias Koenig
2007-10-02 13:15             ` Ian Kent
2007-10-08  3:49 ` Ian Kent
2007-10-08  4:55 ` Ian Kent
2007-10-08 12:28   ` Matthias Koenig
2007-10-08 15:51     ` Ian Kent
2007-10-08 16:10       ` Matthias Koenig
2007-10-10  4:19     ` Ian Kent

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.