public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Anna.Schumaker@netapp.com
Cc: bfields@fieldses.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH v2 1/2] nfsd: Add ALLOCATE support
Date: Tue, 28 Oct 2014 01:41:08 -0700	[thread overview]
Message-ID: <20141028084108.GC25532@infradead.org> (raw)
In-Reply-To: <1414161705-26617-2-git-send-email-Anna.Schumaker@Netapp.com>

> +	error = vfs_fallocate(file, flags, offset, len);
> +	if (error == -ENODEV)
> +		return nfserr_inval;
> +	else if (error < 0)
> +		return nfserrno(error);
> +	return nfserrno(commit_metadata(fhp));


Shouldn't this be something like:

	error = vfs_fallocate(file, flags, offset, len);
	if (!error)
		error = commit_metadata(fhp);

	if (error == -ENODEV)
		return nfserr_inval;
	return nfserrno(error);

I think we really should move the ENODEV mapping to nfserrno, but
this patch isn't the right place for that.

  reply	other threads:[~2014-10-28  8:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 14:41 [PATCH v2 0/2] NFSD: Add ALLOCATE and DEALLOCATE support Anna.Schumaker
2014-10-24 14:41 ` [PATCH v2 1/2] nfsd: Add ALLOCATE support Anna.Schumaker
2014-10-28  8:41   ` Christoph Hellwig [this message]
2014-10-28 19:09     ` Anna Schumaker
2014-10-24 14:41 ` [PATCH v2 2/2] nfsd: Add DEALLOCATE support Anna.Schumaker
2014-10-28  8:37 ` [PATCH v2 0/2] NFSD: Add ALLOCATE and " Christoph Hellwig
2014-10-28 20:48 ` J. Bruce Fields

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=20141028084108.GC25532@infradead.org \
    --to=hch@infradead.org \
    --cc=Anna.Schumaker@netapp.com \
    --cc=bfields@fieldses.org \
    --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