[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1220394727.2985.28.camel@pmac.infradead.org>
Date: Tue, 02 Sep 2008 23:32:07 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: Andreas Dilger <adilger@....com>,
Artem Bityutskiy <dedekind@...radead.org>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Adrian Hunter <ext-adrian.hunter@...ia.com>
Subject: Re: [PATCH] UBIFS: fill f_fsid
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@...el.com Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists