linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Anna Schumaker <bjschuma@netapp.com>
Cc: Trond.Myklebust@netapp.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/3] NFS: Use WRITE_PLUS for hole punches
Date: Tue, 5 Nov 2013 01:37:00 -0800	[thread overview]
Message-ID: <20131105093700.GA31277@infradead.org> (raw)
In-Reply-To: <1382972418-2249-2-git-send-email-bjschuma@netapp.com>

On Mon, Oct 28, 2013 at 11:00:16AM -0400, Anna Schumaker wrote:
> +	struct nfs42_write_plus_args args = {
> +		.wp_fh		= NFS_FH(inode),
> +		.wp_stable	= NFS_FILE_SYNC,
> +		.wp_content	= NFS4_CONTENT_HOLE,
> +		.wp_offset	= offset,
> +		.wp_length	= len,
> +		.wp_allocated	= (mode == 0),
> +	};

After spending some time with draft 21 of the NFSv4.2 spec I don't think
we can use WRITE_PLUS for the prealloc mode of fallocate.  The problem
with the NFS4_CONTENT_HOLE arm of WRITE_PLUS is that it is defined to
zero the whole range, while fallocate is defined as being a no-op for
parts of the range that already contain data.  

In addition we'll also need more sanity checks on the flags argument,
there already is a FALLOC_FL_KEEP_SIZE not supportable by the NFS
semantics (not that it nessecarily should), and more may be added
in the future.  Take a a look at the other fallocate implementations tha
t have a quick check on the top for flags they don't support:

	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
		return -EOPNOTSUPP;


  parent reply	other threads:[~2013-11-05  9:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28 15:00 [PATCH 0/3] NFS: Add support for fallocate and llseek Anna Schumaker
2013-10-28 15:00 ` [PATCH 1/3] NFS: Use WRITE_PLUS for hole punches Anna Schumaker
2013-10-29  7:39   ` Christoph Hellwig
2013-10-29 12:41     ` Anna Schumaker
2013-11-05  9:37   ` Christoph Hellwig [this message]
2013-10-28 15:00 ` [PATCH 2/3] NFS: Allow for asynchronous WRITE_PLUS calls Anna Schumaker
2013-10-29  7:39   ` Christoph Hellwig
2013-10-29 12:44     ` Myklebust, Trond
2013-10-29 12:48       ` Hellwig Christoph
2013-10-29 13:05         ` Myklebust, Trond
2013-10-29 13:08           ` Hellwig Christoph
2013-10-29 13:21             ` Myklebust, Trond
2013-10-29 13:24               ` Hellwig Christoph
2013-10-29 13:41                 ` Myklebust, Trond
2013-10-29 13:44                 ` J. Bruce Fields
2013-10-28 15:00 ` [PATCH 3/3] NFS: Implement SEEK Anna Schumaker

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=20131105093700.GA31277@infradead.org \
    --to=hch@infradead.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bjschuma@netapp.com \
    --cc=linux-nfs@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).