Re: [PATCH] UBIFS: fill f_fsid
From: David Woodhouse
Date: Tue Sep 02 2008 - 18:32:29 EST
On Tue, 2008-09-02 at 17:02 -0400, Christoph Hellwig wrote:
> Umm, different things. f_fsid in stat(v)fs is just a cookie exported to
> userspac that has never really been documented.
Our man page for statfs(2) says...
The f_fsid field
Solaris, Irix and POSIX have a system call statvfs(2) that returns a
struct statvfs (defined in <sys/statvfs.h>) containing an unsigned long
f_fsid. Linux, SunOS, HP-UX, 4.4BSD have a system call statfs() that
returns a struct statfs (defined in <sys/vfs.h>) containing a fsid_t
f_fsid, where fsid_t is defined as struct { int val[2]; }. The same
holds for FreeBSD, except that it uses the include file <sys/mount.h>.
The general idea is that f_fsid contains some random stuff such that
the pair (f_fsid,ino) uniquely determines a file. Some OSes use (a
variation on) the device number, or the device number combined with the
filesystem type. Several OSes restrict giving out the f_fsid field to
the superuser only (and zero it for unprivileged users), because this
field is used in the filehandle of the filesystem when NFS-exported,
and giving it out is a security concern.
Under some OSes the fsid can be used as second parameter to the sysfs()
system call.
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@xxxxxxxxx Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/