Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
From: Trond Myklebust <trondmy@gmail.com>
To: "J. Bruce Fields" <bfields@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 0/1] Clean up and fix NFS server handling of eof
Date: Mon, 26 Aug 2019 13:03:10 -0400
Message-ID: <20190826170311.81482-1-trond.myklebust@hammerspace.com> (raw)

Currently, the knfsd server assumes that a short read indicates and
end of file. That assumption is incorrect. The short read means that
either we've hit the end of file, or we've hit a read error.

In the case of a read error, the client may want to retry (as per
the implementation recommendations in RFC1813, and RFC7530), but
currently it is being told that it hit an eof.

The following patch cleans up read, and fixes the eof reporting
to the two following cases:
1) read() returns a zero length short read with no error.
2) the offset+length of the read is >= the file size.

Trond Myklebust (1):
  nfsd: Clean up nfs read eof detection

 fs/nfsd/nfs3proc.c |  9 ++-------
 fs/nfsd/nfs4xdr.c  | 11 +++--------
 fs/nfsd/nfsproc.c  |  4 +++-
 fs/nfsd/vfs.c      | 37 ++++++++++++++++++++++++++-----------
 fs/nfsd/vfs.h      | 28 ++++++----------------------
 fs/nfsd/xdr3.h     |  2 +-
 6 files changed, 41 insertions(+), 50 deletions(-)

-- 
2.21.0


             reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 17:03 Trond Myklebust [this message]
2019-08-26 17:03 ` [PATCH 1/1] nfsd: Clean up nfs read eof detection Trond Myklebust
2019-09-23 20:31 ` [PATCH 0/1] Clean up and fix NFS server handling of eof bfields

Reply instructions:

You may reply publically 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=20190826170311.81482-1-trond.myklebust@hammerspace.com \
    --to=trondmy@gmail.com \
    --cc=bfields@redhat.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

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git