Re: Request: removal of fs/fs.h/super_block.u to enable partition locking

Andreas Dilger (adilger@turbolabs.com)
Wed, 19 Sep 2001 17:06:06 -0600


On Sep 19, 2001 15:50 -0400, Mark Swanson wrote:
> > However you don't need to remove anything for that
>
> But I can't distribute the file fs with my application, because I can't
> expect my user base to patch and recompile their kernel just so they can
> run my application.
>
> Perhaps what is needed is an 'inuse' filesystem or a way to make
> filesystem modules without patching the kernel.

You don't need to patch the kernel to add a new filesystem type. It
is possible to just use "&inode->u.generic_ip" as your filesystem
private inode storage (if you actually need any, which is unlikely with
such a simple filesystem). All of the other VFS interfaces are exported
to modules, so it is possible to just insert a module to add your fs
type.

When I was doing this (compiling a filesystem that is not part of the
kernel), we used the pcmcia-cs configure scripts to get all of the
relevant kernel config options. This can be done on a running kernel
without having the actual kernel sources, and if you do this as part
of the startup for your application, you can cache the kernel version
string (from /proc/version) to ensure that the module is always OK
for the current kernel.

Of course, if your code is good enough it may just make it into the
kernel.

> My concern is that ordinary tools like mount check the proc filesystem
> to see if a partition is already mounted and it seems likely that tools
> like mke2fs do this too. Sysadmins might feel that existing tools
> protect them from damaging something in use. I'm looking for a way to
> follow this general behavior with raw partitions.

You are correct. mke2fs refuses to run on a device where a filesystem
appears to be mounted (either in /proc/mounts or /etc/mtab), unless
you force it to do so.

Cheers, Andreas

--
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/