i_ops->create needs flags

Peter J. Braam (braam@cs.cmu.edu)
Fri, 30 Jul 1999 17:39:18 -0600 (MDT)


Hi,

I'm working on a new distributed file system called InterMezzo (see
www.inter-mezzo.org), which has similar features to Coda, but is much
smaller and integrates better with existing disk file systems (for example
ext2 disk format is used for both caches and server data, and on servers
full access to InterMezzo file systems is available.).

I found the following hitch in the i_ops->create method: it needs to pass
the flags to the file system layer.

InterMezzo allows kernel level write back caching, and requests a write
token before it modifies a directory. This request for the token asks the
server to break any existing token, and to forward any pending updates
coming from the previous client token holder. We call this "update
forwarding" and it makes modifications to the file system.

So InterMezzo's "create" method starts by requesting a permit. In order
for this update forwarding to work, we

1. unlock the parent inode

2. allow the update forwarding to install the changes from write back log
of another client. Without unlocking the parent, this can deadlock, since
update forwarding may need the lock on this inode too.

3. relock the parent, and make the same checks as the VFS layer makes
before calling i_ops->create. This requires access to the flags, so that
the O_EXCL flag can be re-checked. The update forwarding may have
installed this file.

4. continue with the create in InterMezzo.

I think we need flags in the file system create method to deal with this.

If there are no other suggestions, then I think I'll make a patch for 2.3.
It would be nice to have this in 2.2 too - opinions?

- Peter -

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