* Mountpoint lookup
@ 2003-02-05 15:02 Florin Malita
2003-02-05 15:03 ` Christoph Hellwig
2003-02-05 19:13 ` Andrew Sharp
0 siblings, 2 replies; 9+ messages in thread
From: Florin Malita @ 2003-02-05 15:02 UTC (permalink / raw)
To: linux-fsdevel
[-- Attachment #1: Type: text/plain, Size: 722 bytes --]
Is there a way of finding the mountpoint a fs is being mounted on at
read_super time?
I'm developing a userland filesystem interface (LUFS -
http://lufs.sourceforge.net) and the only way of getting the mountpoint
I found so far is to wait until I get a struct file* (in readdir for
example) and then go through its f_vfsmount, building the mountpoint
path. This is race prone.
I suspect there's some sort of Zen restriction floating around the
mountpoint (the darn fs shall not need to know its mountpoint) but I'm
relying on it for absolute symlinks remapping.
Thanks,
--
Florin Malita web: http://www.malinux.net
public key: http://www.malinux.net/data/fmalita.gpg
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mountpoint lookup
2003-02-05 15:02 Mountpoint lookup Florin Malita
@ 2003-02-05 15:03 ` Christoph Hellwig
[not found] ` <1044459408.23735.147.camel@zed.malinux.net>
2003-02-05 19:13 ` Andrew Sharp
1 sibling, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2003-02-05 15:03 UTC (permalink / raw)
To: Florin Malita; +Cc: linux-fsdevel
On Wed, Feb 05, 2003 at 05:02:01PM +0200, Florin Malita wrote:
> Is there a way of finding the mountpoint a fs is being mounted on at
> read_super time?
No there is not, and there may in fact not even be a mount point.
Why do you think you need it?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mountpoint lookup
2003-02-05 15:02 Mountpoint lookup Florin Malita
2003-02-05 15:03 ` Christoph Hellwig
@ 2003-02-05 19:13 ` Andrew Sharp
2003-02-05 19:18 ` Christoph Hellwig
1 sibling, 1 reply; 9+ messages in thread
From: Andrew Sharp @ 2003-02-05 19:13 UTC (permalink / raw)
To: Florin Malita; +Cc: linux-fsdevel
On Wed, Feb 05, 2003 at 05:02:01PM +0200, Florin Malita wrote:
> Is there a way of finding the mountpoint a fs is being mounted on at
> read_super time?
>
> I'm developing a userland filesystem interface (LUFS -
> http://lufs.sourceforge.net) and the only way of getting the mountpoint
> I found so far is to wait until I get a struct file* (in readdir for
> example) and then go through its f_vfsmount, building the mountpoint
> path. This is race prone.
>
> I suspect there's some sort of Zen restriction floating around the
> mountpoint (the darn fs shall not need to know its mountpoint) but I'm
> relying on it for absolute symlinks remapping.
It's the bizarre code of the FS, happy to give you your 'device' but
not your mount path. It is, however, almost always in the data pointer.
Look at the source for the mount command, or write your own mount
command if that regular one isn't giving you what you want. I recently
dealt with this exact issue, but I am using my own mount command so it
was no biggy.
a
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mountpoint lookup
2003-02-05 19:13 ` Andrew Sharp
@ 2003-02-05 19:18 ` Christoph Hellwig
2003-02-05 20:06 ` Bryan Henderson
0 siblings, 1 reply; 9+ messages in thread
From: Christoph Hellwig @ 2003-02-05 19:18 UTC (permalink / raw)
To: Andrew Sharp; +Cc: Florin Malita, linux-fsdevel
On Wed, Feb 05, 2003 at 11:13:00AM -0800, Andrew Sharp wrote:
> It's the bizarre code of the FS, happy to give you your 'device' but
> not your mount path. It is, however, almost always in the data pointer.
> Look at the source for the mount command, or write your own mount
> command if that regular one isn't giving you what you want. I recently
> dealt with this exact issue, but I am using my own mount command so it
> was no biggy.
Unfortunately the second mount of the same device won't even call back into
your filesystem code. Or mount --move or mount --bind. Youre hack is
just broken, there is no non-ambiguous mount path -> superblock mapping
in linux.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mountpoint lookup
[not found] ` <20030205154536.A21838@infradead.org>
@ 2003-02-05 20:03 ` Florin Malita
2003-02-05 21:15 ` Bryan Henderson
0 siblings, 1 reply; 9+ messages in thread
From: Florin Malita @ 2003-02-05 20:03 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel
[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]
On Wed, 2003-02-05 at 17:45, Christoph Hellwig wrote:
> On Wed, Feb 05, 2003 at 05:39:03PM +0200, Florin Malita wrote:
> > On Wed, 2003-02-05 at 17:03, Christoph Hellwig wrote:
> > > No there is not, and there may in fact not even be a mount point.
> > >
> > > Why do you think you need it?
> >
> > For translating remote absolute symlinks to local ones. Lufs supports
> > several networked filesystems and I wanted to be able to map a remote
> > /path symlink to a local /mount_point/path.
> >
> > So I guess the solution would be to translate to a local relative
> > symlink?
>
> There is no way to do that translation, as there may be multiple mount points.
> I still don't see why you actually need to do that - anyone who uses absolute
> symlinks on exported filesystem deserves what he gets..
I agree to that. However, there are some lufs filesystem modules (sshfs,
ftpfs) which can give you access to the whole remote fs (which was never
meant to be exported this way). In this case, an absolute symlink
translation would come in handy.
Thanks for the clarification,
--
Florin Malita web: http://www.malinux.net
public key: http://www.malinux.net/data/fmalita.gpg
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mountpoint lookup
2003-02-05 19:18 ` Christoph Hellwig
@ 2003-02-05 20:06 ` Bryan Henderson
0 siblings, 0 replies; 9+ messages in thread
From: Bryan Henderson @ 2003-02-05 20:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Andrew Sharp, linux-fsdevel, linux-fsdevel-owner, Florin Malita
On Wed, Feb 05, 2003 at 11:13:00AM -0800, Andrew Sharp wrote:
>> It's the bizarre code of the FS, happy to give you your 'device' but
>> not your mount path.
>
>Your hack is
>just broken, there is no non-ambiguous mount path -> superblock mapping
>in linux.
I agree. People, remember that (in Unix in general, not just Linux)
mounting a filesystem and creating a filesystem image are quite separate
concepts, even though they have traditionally been done and undone at the
same time. Mounting is simply adding the files in a filesystem to the
system's name space. Creating a file system image means setting up all the
data structures, methods, etc. to access the files in a filesystem.
A filesystem driver is responsible for providing access to files, and thus
for creating a filesystem image at read_super time, but it is none of the
filesystem driver's business what naming system the code above uses to
identify that filesystem image. One way a filesystem image can exist
without being mounted is you create and
mount it, then open a file, then unmount it (I think the option you need on
the conventional Linux Mount program to do that is -l). The system
destroys the filesystem image when you later close that file. I don't
think there's a way today to open a file without ever mounting the
filesystem, but it's certainly a reasonable thing to do.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mountpoint lookup
2003-02-05 20:03 ` Florin Malita
@ 2003-02-05 21:15 ` Bryan Henderson
2003-02-06 10:39 ` Florin Malita
0 siblings, 1 reply; 9+ messages in thread
From: Bryan Henderson @ 2003-02-05 21:15 UTC (permalink / raw)
To: Florin Malita; +Cc: Christoph Hellwig, linux-fsdevel
>However, there are some lufs filesystem modules (sshfs,
>ftpfs) which can give you access to the whole remote fs (which was never
>meant to be exported this way). In this case, an absolute symlink
>translation would come in handy.
To the extent that this translation would be handy, it would be appropriate
to pass the information as a filesystem-type-specific mount parameter
(which is actually a parameter of the filesystem image, not of the mount),
but the semantics of the parameter wouldn't be "this is the mount point,"
but rather "translate absolute symlinks with respect to this base path."
You could have a mount program that automatically sets this parameter to
the same path as the mount point, but of course you'd still have to have a
lot of disclaimers that imported absolute symlinks don't always work the
way the user expects.
--
Bryan Henderson IBM Almaden Research Center
San Jose CA Filesystems
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mountpoint lookup
2003-02-05 21:15 ` Bryan Henderson
@ 2003-02-06 10:39 ` Florin Malita
2003-02-22 18:56 ` David Chow
0 siblings, 1 reply; 9+ messages in thread
From: Florin Malita @ 2003-02-06 10:39 UTC (permalink / raw)
To: Bryan Henderson; +Cc: linux-fsdevel
[-- Attachment #1: Type: text/plain, Size: 997 bytes --]
On Wed, 2003-02-05 at 23:15, Bryan Henderson wrote:
> To the extent that this translation would be handy, it would be appropriate
> to pass the information as a filesystem-type-specific mount parameter
> (which is actually a parameter of the filesystem image, not of the mount),
> but the semantics of the parameter wouldn't be "this is the mount point,"
> but rather "translate absolute symlinks with respect to this base path."
> You could have a mount program that automatically sets this parameter to
> the same path as the mount point, but of course you'd still have to have a
> lot of disclaimers that imported absolute symlinks don't always work the
> way the user expects.
Sounds reasonable.
But how about translating all remote absolute symlinks to relative ones?
Seems to be quite easy and eliminates any need of mount point knowledge.
--
Florin Malita web: http://www.malinux.net
public key: http://www.malinux.net/data/fmalita.gpg
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Mountpoint lookup
2003-02-06 10:39 ` Florin Malita
@ 2003-02-22 18:56 ` David Chow
0 siblings, 0 replies; 9+ messages in thread
From: David Chow @ 2003-02-22 18:56 UTC (permalink / raw)
To: Florin Malita; +Cc: Bryan Henderson, linux-fsdevel
Florin Malita wrote:
>On Wed, 2003-02-05 at 23:15, Bryan Henderson wrote:
>
>
>>To the extent that this translation would be handy, it would be appropriate
>>to pass the information as a filesystem-type-specific mount parameter
>>(which is actually a parameter of the filesystem image, not of the mount),
>>but the semantics of the parameter wouldn't be "this is the mount point,"
>>but rather "translate absolute symlinks with respect to this base path."
>>You could have a mount program that automatically sets this parameter to
>>the same path as the mount point, but of course you'd still have to have a
>>lot of disclaimers that imported absolute symlinks don't always work the
>>way the user expects.
>>
>>
>
>Sounds reasonable.
>
>But how about translating all remote absolute symlinks to relative ones?
>Seems to be quite easy and eliminates any need of mount point knowledge.
>
>
>
Actually, this question is some question I've asked before. Al response
to me with the same answer. However, I do find it important in
communicating with user land fs implementation or stackable fs
implementation. However, the file system path (user space view) doesn't
even exists after read_super() returns. I suggests the fs driver to
implement a /proc interface for communication to user space. Because the
user space path not always tells you or able to correctly locate the
root dentry of your file system. Think of --bind or othermounts ontop of
your previous mounts. User space must check fs type or as I said some
/proc or ioctls. Symlinks is even more complicate as it can be cross
devices, this is something impossible to handle with a couple of --bind
on one another. You have to make your choice of assumptions.
regards,
David Chow
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2003-02-22 18:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-05 15:02 Mountpoint lookup Florin Malita
2003-02-05 15:03 ` Christoph Hellwig
[not found] ` <1044459408.23735.147.camel@zed.malinux.net>
[not found] ` <20030205154536.A21838@infradead.org>
2003-02-05 20:03 ` Florin Malita
2003-02-05 21:15 ` Bryan Henderson
2003-02-06 10:39 ` Florin Malita
2003-02-22 18:56 ` David Chow
2003-02-05 19:13 ` Andrew Sharp
2003-02-05 19:18 ` Christoph Hellwig
2003-02-05 20:06 ` Bryan Henderson
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.