Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp242190pxa; Fri, 31 Jul 2020 10:47:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz16umwOvCg7xr2E/YIsnvTPVtLEnpYILLWe7r5mDhpGzaTdi2TMuFDs0EF9CjxJF3YVTTl X-Received: by 2002:a05:6402:6cc:: with SMTP id n12mr5168899edy.258.1596217633701; Fri, 31 Jul 2020 10:47:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596217633; cv=none; d=google.com; s=arc-20160816; b=XvS63YPWT2s3F/CEVeulka2ffCnCRL1AcmfW5HyGVog/dVlC66WtCjXIE9Ots+gWCn W4E0uuJtQoackv463rFxC43RW2ujwzb0isUgdFIxSzmwqx1svxC1thSa04X4tS6YwUoe 03Zn3/vocGuwPWeSu6secq6wpFIj3k+itQGBqn4lPdqYlKiPtyIGttMCYEiC0ovotXtT FjP2bIwZVKc+Tm6eoJ7TBuJDlGldJp1BU97po9/N0/RCjcA5dqPEnOga8ay09cUnCvSc JjcyVhZNP+ZY0CNFRMLWoHTkenPqaIMMjWjUEhmo88KsMGQ8tOKyHJrEZg0+cfqAmc3u kRHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xiiP36tfbwvvObrNRZ6Hnur1uEP0vsW4lm684yYKuBI=; b=uEZvuXwnkx83hNnNMXnvVob/e2w+OXlc3GlsVMh7nNZW9vVWgvZ6yb4x4l96ml5BpS epHJb7RKAGi+tQt20umvtqLPy/gvl0KqiqkwU03lczyNjCU0VD7TkZeAkAeA7EP1S/H2 WH8iYNpuiNc4G94plF5F8fvFSDVya06lcXQ8zNe4Shqm33ucLIDuDwyZoipzEZLv0lkR vc1YLx3ccumGif2pSIOvflnTyjIQwdDX9Qdj5eJwOKbK+HXM8q5hbhK7ouOONWNqMtVr 13izbdGgW0GOes//Yzvp20u2l5lqRraTmpXh0rH2n5szKf2dZ0FPt7A3+XRLtwhZfWBy lUcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WgF4cLrq; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn28si5518754edb.195.2020.07.31.10.46.40; Fri, 31 Jul 2020 10:47:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WgF4cLrq; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387429AbgGaRqU (ORCPT + 99 others); Fri, 31 Jul 2020 13:46:20 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42569 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729018AbgGaRqT (ORCPT ); Fri, 31 Jul 2020 13:46:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596217578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=xiiP36tfbwvvObrNRZ6Hnur1uEP0vsW4lm684yYKuBI=; b=WgF4cLrqlVCjKEoVUKKWMWT4s1GYZdZWrZUUHem0+E1IRVez56yXqcR+BpUpYqpQeJ4CBi hIw1dFb0i8GN+vdLWqYpalz9jwdwuuZa+CaRTBT8jTXOhnar4Xh/Nx5wnxlqpzjnL3+tgm iePs4bBbCxxYvDXdUyKtL5rpITHSqBE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-435-mePwr5_5OHeLtjVAKpcb7w-1; Fri, 31 Jul 2020 13:46:16 -0400 X-MC-Unique: mePwr5_5OHeLtjVAKpcb7w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5E895100AA21; Fri, 31 Jul 2020 17:46:15 +0000 (UTC) Received: from aion.usersys.redhat.com (ovpn-115-198.rdu2.redhat.com [10.10.115.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 43E451C92D; Fri, 31 Jul 2020 17:46:15 +0000 (UTC) Received: by aion.usersys.redhat.com (Postfix, from userid 1000) id 746DF1A0006; Fri, 31 Jul 2020 13:46:14 -0400 (EDT) From: Scott Mayhew To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 0/2] nfs: two writeback error reporting fixes Date: Fri, 31 Jul 2020 13:46:12 -0400 Message-Id: <20200731174614.1299346-1-smayhew@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org These fixes fix two regressions reported by Red Hat QE. This first issue reported was that writing a file larger than the available space would result in a client hang instead of returning -ENOSPC. The second issue reported was that the client was returning -EIO instead of -EDQUOT when a quota is exceeded. On further investigation, I found that in the first issue the client wasn't really hung. Instead it was performing all of the requested writes before it would eventually return -ENOSPC. The dd command was writing 400TB, which would have taken a few weeks to complete. Adjusting the 'bs' and 'count' arguments so that the resulting file would be much smaller (but still enough to fill up the space on the NFS server) showed that the dd command would indeed complete with -ENOSPC. But on older kernels even the 400TB dd would return -ENOSPC quickly. In the second issue, I found that adding 'conv=fsync' would make the dd command return -EDQUOT. So what was happening with the original command was that it was doing a close() without first calling fsync() and the close() was returning -EIO. I bisected both of these down to commit aded8d7b54f2 ("NFS: Don't inadvertently clear writeback errors"). HOWEVER, as a test I reverted that commit and it wasn't sufficient to bring back the old behavior. I turns out that was due to commit 6fbda89b257f ("NFS: Replace custom error reporting mechanism with generic one"). This is why I listed the second commit in the 'Fixes:' tag of both of my patches. The first patch fixes the -EDQUOT issue and the second one fixes the -ENOSPC issue. -Scott Scott Mayhew (2): nfs: ensure correct writeback errors are returned on close() nfs: nfs_file_write() should check for writeback errors fs/nfs/file.c | 15 +++++++++++---- fs/nfs/nfs4file.c | 3 ++- 2 files changed, 13 insertions(+), 5 deletions(-) -- 2.25.4