Linux NFS development
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "richard@nod.at" <richard@nod.at>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
	"david@sigma-star.at" <david@sigma-star.at>
Subject: Re: [RFC PATCH] NFS: Save 4 bytes when re-exporting
Date: Sun, 12 Dec 2021 21:53:36 +0000	[thread overview]
Message-ID: <7a8d59679ed2ab948b8b694eb1df94e3a90fcc8a.camel@hammerspace.com> (raw)
In-Reply-To: <1812588409.160456.1639344774221.JavaMail.zimbra@nod.at>

On Sun, 2021-12-12 at 22:32 +0100, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
> > Von: "Trond Myklebust" <trondmy@hammerspace.com>
> > On Sun, 2021-12-12 at 22:00 +0100, Richard Weinberger wrote:
> > > When re-exporting, the whole struct nfs_fh is embedded in the new
> > > fhandle.
> > > But we need only nfs_fh->data[], nfs_fh->size is not needed.
> > > So skip fs_fh->size and save a full word (4 bytes).
> > > The downside is the extra memcpy() in nfs_fh_to_dentry().
> > > 
> > > Signed-off-by: Richard Weinberger <richard@nod.at>
> > > ---
> > > While investigating into improving NFS re-export I noticed that
> > > we can already save 4 bytes of overhead.
> > > I don't think we need to embedd the full struct nfs_fh and
> > > can skip ->size.
> > > 
> > 
> > NACK. This will break existing running clients. Any code to change
> > the
> > filehandle format must be accompanied with code to detect and
> > service
> > filehandles that are presented in the old format.
> 
> One possible way to distinguish between old and new formats
> is looking at the length of the data.
> 2 * XDR_UNIT = new format (without ->size).
> 3 * XDR_UNIT = old format.
> 
> What do you think?
> 

You don't a priori know the length of the underlying filehandle or its
structure. All you know is that you have n bytes of data, and it is
possible that the first 2 bytes represent the size 'n-2'. However it is
also possible that those 2 bytes are something else that just happens
to match the value 'n-2'.

-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  parent reply	other threads:[~2021-12-12 21:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12 21:00 [RFC PATCH] NFS: Save 4 bytes when re-exporting Richard Weinberger
2021-12-12 21:19 ` Trond Myklebust
2021-12-12 21:32   ` Richard Weinberger
2021-12-12 21:51     ` Richard Weinberger
2021-12-12 21:53     ` Trond Myklebust [this message]
2021-12-12 21:57       ` Richard Weinberger

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=7a8d59679ed2ab948b8b694eb1df94e3a90fcc8a.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=anna.schumaker@netapp.com \
    --cc=david@sigma-star.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=richard@nod.at \
    /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