Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5643396ybe; Tue, 10 Sep 2019 06:52:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGlZCshZg2fxXZ71ADWq0GHjDw5kYwxnaO+cDfLYlYl8H6Uu1wRDvpLAstoWkFJbxLlTML X-Received: by 2002:aa7:d899:: with SMTP id u25mr29554983edq.289.1568123560806; Tue, 10 Sep 2019 06:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568123560; cv=none; d=google.com; s=arc-20160816; b=g9rTQg2bivL4ma9nOif97/4diwLrI4zlc5WLg38SZThlJ0w+LwZW8BGBn+UUfx1TXw NDDIWqEO79ySn+QJghJaUZXLJJIQuYviK/Ab8HTuNadK+KVklTpNxnXG3aEf1q+vAxJq t3GRQId5yC04gznYg8aKevUCR1DIiLfalR+Ymac63cJOuutwjlDH8+fxFuDM42uLjntj x7XtPEm3z2kf4fvp4XjCzp0VUSIiA27OkrHxvfAHtNXHjJECcv26HkVtx0mcCGAh4SFz GmzQJcbw6iX2JJRGtEitiio3LlZoGyMQXu8c8yXl7Q0/tKXzFAMALqxKRZ8VHf4ENhIM cnzA== 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=C1Z+koESA0tQH6LggS0SKRq5MYqZrSJ6qIzXry3Qiuk=; b=y3ai9mCR1AKRr2ufdOMFj7XuezLwQhC2GmFXcWd6MVw5hqqrKkNKWCjzIDk6OqjhUc x+tCbzh/wGQ1TCcZ5z1GYIA0nTA5RjICAvy099TEbpK407rD5zlA3RdtH10Lpo5LaGE0 H0EV2ZYsFN/LbGl0kiUjRUT9nEv/XTRlOMAEUWrIu4NrzsCQ7KRQvhq3/+2mdrW9BRj+ pdXek5E9WR/tWHdiVA9TNeCEg81GGgpx/kL09/mYRftVQGOivfZD+eS4zgJhoVDiXMDb A8eL99SLlZpqgxF8m0PD4bdTgGpiSTylBhSv4Gg6spnqlCu0qYds0SWlSCiM4fmw0bjK okWw== 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 d15si11374442edb.7.2019.09.10.06.52.03; Tue, 10 Sep 2019 06:52:40 -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 S1730244AbfIJNLT (ORCPT + 99 others); Tue, 10 Sep 2019 09:11:19 -0400 Received: from fieldses.org ([173.255.197.46]:32792 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726107AbfIJNLS (ORCPT ); Tue, 10 Sep 2019 09:11:18 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 903522014; Tue, 10 Sep 2019 09:11:18 -0400 (EDT) Date: Tue, 10 Sep 2019 09:11:18 -0400 To: Trond Myklebust Cc: "J.Bruce Fields" , linux-nfs@vger.kernel.org Subject: Re: [PATCH v2 0/4] Handling NFSv3 I/O errors in knfsd Message-ID: <20190910131118.GA26695@fieldses.org> References: <20190902170258.92522-1-trond.myklebust@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190902170258.92522-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 Looks OK to me; applying for 5.4. Any ideas for easy ways to test this? Maybe I should look at Documentation/fault-injection/fault-injection.txt. --b. On Mon, Sep 02, 2019 at 01:02:54PM -0400, Trond Myklebust wrote: > Recently, a number of changes went into the kernel to try to ensure > that I/O errors (specifically write errors) are reported to the > application once and only once. The vehicle for ensuring the errors > are reported is the struct file, which uses the 'f_wb_err' field to > track which errors have been reported. > > The problem is that errors are mainly intended to be reported through > fsync(). If the client is doing synchronous writes, then all is well, > but if it is doing unstable writes, then the errors may not be > reported until the client calls COMMIT. If the file cache has > thrown out the struct file, due to memory pressure, or just because > the client took a long while between the last WRITE and the COMMIT, > then the error report may be lost, and the client may just think > its data is safely stored. > > Note that the problem is compounded by the fact that NFSv3 is stateless, > so the server never knows that the client may have rebooted, so there > can be no guarantee that a COMMIT will ever be sent. > > The following patch set attempts to remedy the situation using 2 > strategies: > > 1) If the inode is dirty, then avoid garbage collecting the file > from the file cache. > 2) If the file is closed, and we see that it would have reported > an error to COMMIT, then we bump the boot verifier in order to > ensure the client retransmits all its writes. > > Note that if multiple clients were writing to the same file, then > we probably want to bump the boot verifier anyway, since only one > COMMIT will see the error report (because the cached file is also > shared). > > So in order to implement the above strategy, we first have to do > the following: split up the file cache to act per net namespace, > since the boot verifier is per net namespace. Then add a helper > to update the boot verifier. > > --- > v2: > - Add patch to bump the boot verifier on all write/commit errors > - Fix initialisation of 'seq' in nfsd_copy_boot_verifier() > > Trond Myklebust (4): > nfsd: nfsd_file cache entries should be per net namespace > nfsd: Support the server resetting the boot verifier > nfsd: Don't garbage collect files that might contain write errors > nfsd: Reset the boot verifier on all write I/O errors > > fs/nfsd/export.c | 2 +- > fs/nfsd/filecache.c | 76 +++++++++++++++++++++++++++++++++++++-------- > fs/nfsd/filecache.h | 3 +- > fs/nfsd/netns.h | 4 +++ > fs/nfsd/nfs3xdr.c | 13 +++++--- > fs/nfsd/nfs4proc.c | 14 +++------ > fs/nfsd/nfsctl.c | 1 + > fs/nfsd/nfssvc.c | 32 ++++++++++++++++++- > fs/nfsd/vfs.c | 19 +++++++++--- > 9 files changed, 130 insertions(+), 34 deletions(-) > > -- > 2.21.0