Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4941919ybl; Wed, 22 Jan 2020 07:28:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxN/q5aE9Dw6gp8jhzr+lRAUr6x78tUHyiyrWR16rNuqzo16hOfhcnMJ7J54Hqn0jSFGl1J X-Received: by 2002:a9d:74c8:: with SMTP id a8mr7353995otl.57.1579706896084; Wed, 22 Jan 2020 07:28:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579706896; cv=none; d=google.com; s=arc-20160816; b=WvHdETlRT7POAsXrEi9Wp/5mURdWaU3ljrXN3mOqrt/ev26PgIljE9U1iW4KCIycBd 1V7jcY2v2tvx/K7aSLnEfbEVUJ48gtbZiWAC5cMxAY3tJERNBPQ6g3YSz5+VPickTiJy wFJ8b8iRUInnQM2igmxgFL86C1aqiXUjuyxEJXFdHlcJ8I1BuB6PMZl1ymJ5WxCT80oC lZJnPOphl/olX5Rozj937B/l85F9HHB/sClvOyV8uf1DsX3I1F9+d8kTLXoyr+8Oq/lP 8AuH0+AQLR+MDyJqPd4fPmTbbVpVvETG9xqWYt1NAKA7hh0VyyH9Wg3j1wwNeNc97TQY PLJg== 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=nzHUNhtHd3W9wX4XJXmlUu4bOy1t2CrW+tqvkft+9Ww=; b=M9HtMglKHhU89SxfUEM4lVe+H2MxSG37sZuoz41HC5ksZKIWp87KRu0EnISMoP+FMz e1x51WT5B1TA5pziStUPoOfPj9zsmAg9uhcSnZV6wbQZaI/kUcgfVtfKGASBoHcTqt2h jSC+42Ht0MuBBbNiqZxZERTOqfz8f32a3Ec2b/HmSaUtm06LrjNyjQhkbTJvqw424ACJ Ax0Bhh7mp9KiAyNFt6LfpNn7vezt5Dg0EimwiW1nzHApgKAltsXBYq6DhTogamc173oX yhNi2XTqbHUzHhQSjmgh7561aHG3eDP85SkgsP7qrxDQnSkdTjTbsHtgXIFTgAQxibxk CwCA== 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 q72si22311083oic.18.2020.01.22.07.28.04; Wed, 22 Jan 2020 07:28:16 -0800 (PST) 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 S1726194AbgAVP1w (ORCPT + 99 others); Wed, 22 Jan 2020 10:27:52 -0500 Received: from fieldses.org ([173.255.197.46]:38340 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726101AbgAVP1v (ORCPT ); Wed, 22 Jan 2020 10:27:51 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 8DC5C3EB; Wed, 22 Jan 2020 10:27:51 -0500 (EST) Date: Wed, 22 Jan 2020 10:27:51 -0500 To: Trond Myklebust Cc: "J. Bruce Fields" , linux-nfs@vger.kernel.org Subject: Re: [PATCH 0/9] Fix error reporting for NFS writes Message-ID: <20200122152751.GD2654@fieldses.org> References: <20200106184037.563557-1-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200106184037.563557-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 By the way, anyone know how to handle quoted-printable patches? For some reason, git-am seems to deal with them, but git-apply doesn't. So it's fine until there's some minor conflict. --b. On Mon, Jan 06, 2020 at 01:40:28PM -0500, Trond Myklebust wrote: > In cases where we have transient errors, such as ENOSPC, it is important > to ensure that errors are reported on all writes that may be affected. > > The problem we have is that not all errors are guaranteed to be reported > at write time. Some are reported only when we call fsync(). In > particular, this can be a problem for stable NFS writes. Since most > filesystems protect the write to the page cache with the inode lock, > but do not protect the subsequent call to generic_write_sync(), this > means that if we have parallel writes to the same file, we can end up > assigning the error to the wrong stable write call. If the application > expects to be able to fix the transient errors, it may end up replaying > the wrong write. One area where we have seen this happen is in flexfiles > writes, where the server is capable of freeing up space on the DS in > case of ENOSPC. > > The other area where we have seen a similar problem is when we have > unstable writes, and the client sends a backgrounded commit in order > to free up memory. If there are outstanding writes while the commit > gets a transient error and bumps the write verifier, then we want to > ensure that those writes get the approprite write verifier depending > on whether they were affected by the fsync() or not. Right now, > because the NFSv3 verifier is set in the XDR encoder well after the > write is done, there is fairly large window for a race with a > background commit. > > This patch series deals with both issues by adding per-file-descriptor > locking that ensures that writes, fsync error handling, and write verifier > updates are appropriately serialised. > > Trond Myklebust (9): > nfsd: Allow nfsd_vfs_write() to take the nfsd_file as an argument > nfsd: Fix stable writes > nfsd: Update the boot verifier on stable writes too. > nfsd: Pass the nfsd_file as arguments to nfsd4_clone_file_range() > nfsd: Ensure exclusion between CLONE and WRITE errors > sunrpc: Fix potential leaks in sunrpc_cache_unhash() > sunrpc: clean up cache entry add/remove from hashtable > nfsd: Ensure sampling of the commit verifier is atomic with the commit > nfsd: Ensure sampling of the write verifier is atomic with the write > > fs/nfsd/filecache.c | 1 + > fs/nfsd/filecache.h | 1 + > fs/nfsd/nfs3proc.c | 5 +-- > fs/nfsd/nfs3xdr.c | 16 +++------ > fs/nfsd/nfs4proc.c | 14 ++++---- > fs/nfsd/nfsproc.c | 2 +- > fs/nfsd/vfs.c | 79 ++++++++++++++++++++++++++++++++++----------- > fs/nfsd/vfs.h | 16 +++++---- > fs/nfsd/xdr3.h | 2 ++ > net/sunrpc/cache.c | 48 ++++++++++++++------------- > 10 files changed, 115 insertions(+), 69 deletions(-) > > -- > 2.24.1