linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andries Brouwer <aebr@win.tue.nl>
To: Andrew Morton <akpm@digeo.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	kernel@whiskerfish.com
Subject: Re: [Fwd: [Bug 136] New: FSID returned from statvfs always 0]
Date: Wed, 4 Dec 2002 04:25:11 +0100	[thread overview]
Message-ID: <20021204032511.GA7646@win.tue.nl> (raw)
In-Reply-To: <3DED43F7.AD396584@digeo.com>

On Tue, Dec 03, 2002 at 03:53:27PM -0800, Andrew Morton wrote:

> I've been hit with a bugzilla record alleging that statfs
> is failing to initialise the statfs.f_fsid field.
> 
> Can anyone suggest whether we should be putting something in 
> there and if so, what?
> 
> The submitter suggests using part of the UUID.
> 
> What is is used for?

There are system calls statfs (Linux, FreeBSD, SunOS, HPUX, 4.4BSD, not POSIX)
and statvfs (Solaris, POSIX) that return a struct with a f_fsid field.

For statvfs the type is unsigned long. (In struct defined in <sys/statvfs.h>.)
For statfs the type is fsid_t with

	typedef struct { int val[2]; } fsid_t;

(In struct defined in <sys/vfs.h>, but FreeBSD uses <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 nonprivileged 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.

Andries


[P.S. This is not used anywhere in Linux, I think.]


  parent reply	other threads:[~2002-12-04  3:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-03 23:53 [Fwd: [Bug 136] New: FSID returned from statvfs always 0] Andrew Morton
2002-12-04  3:11 ` Stephen Lord
2002-12-04  3:25 ` Andries Brouwer [this message]
2002-12-04  4:09   ` Andrew Morton
2002-12-04 18:00     ` Bryan Henderson
2002-12-09 22:15   ` H. Peter Anvin
2002-12-09 23:04     ` Andries Brouwer
2002-12-18  5:15       ` Andrew Morton
2002-12-18 16:25         ` Bryan Henderson
2002-12-18 20:18           ` H. Peter Anvin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021204032511.GA7646@win.tue.nl \
    --to=aebr@win.tue.nl \
    --cc=akpm@digeo.com \
    --cc=kernel@whiskerfish.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).