[patches] RFC: Export inode generations to the userland

From: Maciej W. Rozycki (macro@ds2.pg.gda.pl)
Date: Mon Feb 18 2002 - 16:06:48 EST


Hello,

 As you may know, there are serious problems with creating unique file
handles in the userland NFS server. They exist because the inode
generation number, which allows to determine if an inode was deleted and
recreated, is currently only available to the kernel -- it's by no means
exported to user programs[1]. I've been working to remove this limitation
recently and here I am presenting the results.

1. Linux was modified to add another member of "struct stat" and "struct
stat64". The member provides the value of the inode generation at the
time one of the stat syscalls is invoked. It is named "st_gen" as it is
the name other systems give it (it seems DEC OSF/1 and IBM AIX define this
member currently). New syscalls have been defined wherever spare space
was not available in "struct stat" or "struct stat64", otherwise only the
semantics of old ones was extended. Due to its moderate size the patch is
not attached. It's available at:
'ftp://ftp.ds2.pg.gda.pl/pub/macro/st_gen/patches/patch-2.4.16-stat-st_gen-26.gz'.

2. Glibc was updated to make the Linux change usable. This is an example
implementation and may seriously differ from what might go into glibc
finally. The patch is available at:
'ftp://ftp.ds2.pg.gda.pl/pub/macro/st_gen/patches/glibc-2.2.5-stat-st_gen.patch.gz'.

3. The userland NFS server was changed to embed the inode generation into
file handles. The patch is available at:
'ftp://ftp.ds2.pg.gda.pl/pub/macro/st_gen/patches/nfs-server-2.2beta50-stat.patch.gz'.

 Patches were tested against versions embedded in their names. Tests were
successful on an i386 and a mipsel system. Additionally the Linux patch
was tested as is with Linux 2.4.17 (a 2.4.17 snapshot take on Jan 29th
from oss.sgi.com for mipsel; a slightly modified patch is available at the
site well). Glibc and nfs-server RPM packages are available at the site
as well.

 I'm looking forward to any constructive comments, whether positive or
critical. The destined target of the changes is obviously Linux 2.6 and
glibc 2.3; testing of such changes is better with stable versions, though.
I believe the changes may be useful to other software dealing with
filesystems as well, not only to the NFS server.

  Maciej

[1] There is that weird EXT2_IOC_GETVERSION ioctl, but it's neither
portable nor usable for anything but maybe debugging.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

- 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/



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:15 EST