All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: dhowells@redhat.com, Neil Brown <neilb@suse.de>,
	Christoph Hellwig <hch@infradead.org>,
	linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: Curiosities of Linux NFSD file handles
Date: Fri, 05 Dec 2008 09:07:00 +0000	[thread overview]
Message-ID: <25993.1228468020@redhat.com> (raw)
In-Reply-To: <20081204193511.GE7575@fieldses.org>

J. Bruce Fields <bfields@fieldses.org> wrote:

> > I've been poking around in the exportfs code, and I see that the handle
> > decode routines seem to expect that they may be given more data for a
> > handle than the encode_fh() routine produced.
> 
> Somebody else who understands what you're asking about off the top of
> their heads may be able to pop up and answer this.  But I'm a little
> confused.  Which encode/decode routines exactly, and where do you see
> them making assumptions about the size of the data?

The encode_fh() operation produces a blob of data and passes back the type and
length of this data.

The fh_to_dentry() and fh_to_parent() routines are given back the blob of
data, the handle type and a length, where the length, it would appear, may be
longer than that passed back by encode_fh().  To quote from the Exporting
document:

	The decode_fh routine should not depend on the stated size that is
	passed to it.  This size may be larger than the original filehandle
	generated by encode_fh, in which case it will have been padded with
	nuls.  Rather, the encode_fh routine should choose a "type" which
	indicates the decode_fh how much of the filehandle is valid, and how

Is this still true?

If it isn't true, then there's no need for separate FILEID_INO32_GEN and
FILEID_INO32_GEN_PARENT types.  If it is true, then FILEID_INO32_GEN_PARENT
and the generic routines that handle it are perhaps dodgy as they assume they
can simply set i_generation to 0 if the file handle is short.

David

WARNING: multiple messages have this Message-ID (diff)
From: David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: "J. Bruce Fields" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	Neil Brown <neilb-l3A5Bk7waGM@public.gmane.org>,
	Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Curiosities of Linux NFSD file handles
Date: Fri, 05 Dec 2008 09:07:00 +0000	[thread overview]
Message-ID: <25993.1228468020@redhat.com> (raw)
In-Reply-To: <20081204193511.GE7575-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>

J. Bruce Fields <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org> wrote:

> > I've been poking around in the exportfs code, and I see that the handle
> > decode routines seem to expect that they may be given more data for a
> > handle than the encode_fh() routine produced.
> 
> Somebody else who understands what you're asking about off the top of
> their heads may be able to pop up and answer this.  But I'm a little
> confused.  Which encode/decode routines exactly, and where do you see
> them making assumptions about the size of the data?

The encode_fh() operation produces a blob of data and passes back the type and
length of this data.

The fh_to_dentry() and fh_to_parent() routines are given back the blob of
data, the handle type and a length, where the length, it would appear, may be
longer than that passed back by encode_fh().  To quote from the Exporting
document:

	The decode_fh routine should not depend on the stated size that is
	passed to it.  This size may be larger than the original filehandle
	generated by encode_fh, in which case it will have been padded with
	nuls.  Rather, the encode_fh routine should choose a "type" which
	indicates the decode_fh how much of the filehandle is valid, and how

Is this still true?

If it isn't true, then there's no need for separate FILEID_INO32_GEN and
FILEID_INO32_GEN_PARENT types.  If it is true, then FILEID_INO32_GEN_PARENT
and the generic routines that handle it are perhaps dodgy as they assume they
can simply set i_generation to 0 if the file handle is short.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2008-12-05  9:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04 16:46 Curiosities of Linux NFSD file handles David Howells
2008-12-04 19:35 ` J. Bruce Fields
2008-12-04 22:28   ` NeilBrown
2008-12-05  9:07   ` David Howells [this message]
2008-12-05  9:07     ` David Howells

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=25993.1228468020@redhat.com \
    --to=dhowells@redhat.com \
    --cc=bfields@fieldses.org \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.