Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2014 17:57:54 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Rick Macklem <rmacklem@uoguelph.ca>
Cc:        FreeBSD Filesystems <freebsd-fs@freebsd.org>
Subject:   Re: RFC: patch to make d_fileno 64bits
Message-ID:  <20141121155754.GN17068@kib.kiev.ua>
In-Reply-To: <539201047.4538834.1416539954794.JavaMail.root@uoguelph.ca>
References:  <683927697.4538805.1416539949195.JavaMail.root@uoguelph.ca> <539201047.4538834.1416539954794.JavaMail.root@uoguelph.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 20, 2014 at 10:19:14PM -0500, Rick Macklem wrote:
> The attached patch covers the basics of a way to
> convert the d_fileno field of "struct dirent" to
> 64bits. This patch is incomplete and won't even
> build, but I thought I'd post it in case anyone
> wanted to take a look and comment on the approach
> it uses.
> 
> - renames the old/current one "struct dirent32"
> - changes d_fileno to 64bits and adds a 64bit
>   d_off field for the offset of the underlying
>   file system
> - defines a new VOP_READDIR() that will return
>   the new "struct dirent" that is used as the
>   default one for a new getdirentries(2).
> - the old/current getdirentries(2) uses the old
>   VOP_READDIR32() by default.
> 
> For the case of a file system that supports both
> the new and old VOP_READDIR(), they are used by
> the corresponding new and old getdirentries(2)
> syscalls.
> 
> For a file system that only supports one of
> the VOP_READDIR()s, the "struct dirent32"
> is copied to "struct dirent" (or vice versa).
> 
> At this point, all file systems would support
> the old VOP_READDIR() and I think the new
> VOP_READDIR() can easily be added for NFS,
> ZFS. (OpenBSD already has UFS code for
> essentially a new struct dirent and hopefully
> that code could be ported easily, too.)
> 
> Anyhow, any comments on this approach? rick

I do not think we need to have in-kernel compatibility shims.
The work, big but relatively trivial, is to convert filesystems to
use the new ino_t, even if the on-disk structures still use 32bit
inode number.

Really problematic part of this change is the usermode ABI breakage.
The struct dirent is only the start of the whole issue. ino_t is
embedded into more structures which are part of the contract, e.g.
struct stat.  We have to provide new syscalls which accept or return
the affected structures.

And then, there are libraries which embed ino_t into their ABI.
Immediate example is fts(3) in libc. Look at the FTSENT.fts_ino. Even
after the base system is fixed by properly providing the compat shims
and symbol versions for the affected libraries, we get the same problem
with the binaries not from base.

Summary of the issue with ino_t is that it is not too hard to fix the
kernel, comparing with the ABI issues which must be solved in usermode.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141121155754.GN17068>