Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1341390ybn; Wed, 25 Sep 2019 16:42:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAB5SrdBIRwsxGAPYBlPE4ro8MD2JiNDRfHm4XYO/spuXW2V8BROpcNcs/BoFT0rX8pLj9 X-Received: by 2002:a50:ab0f:: with SMTP id s15mr604599edc.119.1569454977621; Wed, 25 Sep 2019 16:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569454977; cv=none; d=google.com; s=arc-20160816; b=a56WakJav5wuw2tZURpIHC0G/mCcGFO6sJfb3KwzYL5KXog04sR1EyaEeH2QAJVQu7 PH9HGgk6LJh5R5/VVksZ+Rr56L4fFvmvHgzFWbsE5PNUqoYZW/s7yo2w+QLd2Tr8Volz I440WDpz6b4pWAafRl2BxlpQLMkvRsNf3yCX90Hpg3y3WxCFsblROYQP4BLbyFJFeVzN qLi+OgqkYHX9hnN9lrX7GCMMZB7y/ceOQyOqdniMp5C0JreRromVOuaSI61rPJlvJZwp CNnF36mwMjHjXfBn4BkkqTWVREeboe3Pv0nvfU7AhQVbBjs8Hio4PEStqciywR1/YoZg co+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date; bh=fLIpxteFsUgkuQypISxXtEJb1Yjo9laKWw+5gXoMUFU=; b=evvlGy1jCBJe+4piYSdqNdgcnxmlgR9KrmK7H/qwDw+IHxwBbihuFORSW1HVS1bfTT cGOn9WCo6gADl0zj4++TCAYubUOGaq3nZ9/eKLvkCpxDopaVsDkYa2GOjClo6nL9Qc2M JS66R04qHEm0iN4uTq3KYgQKNF8m7CECiO4eZzxV1/dGWdDCmUImESv0+skD7ilwyUly TbCdS4FdnQF8rsdjNUOfgdR5rsJ+2I1zp0tPLGwEB159zKoN3w7imQLz5sIIfywsKF8h lSRsms3ptrBkgD22UL/Y6k9tBooudNggKuYqqP4BzkBvP6btWeiLn0nFJIaHk3oGgIK8 d50A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s7si289351edd.290.2019.09.25.16.42.31; Wed, 25 Sep 2019 16:42:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2502627AbfIWUb1 (ORCPT + 99 others); Mon, 23 Sep 2019 16:31:27 -0400 Received: from fieldses.org ([173.255.197.46]:58046 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502593AbfIWUb1 (ORCPT ); Mon, 23 Sep 2019 16:31:27 -0400 Received: by fieldses.org (Postfix, from userid 2815) id CE1C3150F; Mon, 23 Sep 2019 16:31:26 -0400 (EDT) Date: Mon, 23 Sep 2019 16:31:26 -0400 To: Trond Myklebust Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org Subject: Re: [PATCH 0/1] Clean up and fix NFS server handling of eof Message-ID: <20190923203126.GB5085@fieldses.org> References: <20190826170311.81482-1-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190826170311.81482-1-trond.myklebust@hammerspace.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Thanks, applying! But I like your explanation better than your explanation on the patch--copying it into the changelog. --b On Mon, Aug 26, 2019 at 01:03:10PM -0400, Trond Myklebust wrote: > 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