Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1157904pxb; Wed, 3 Nov 2021 19:37:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2kZDtYz7g01Wouq/+kaJqegbVUIC+uJYu8M3oxdOhTYlOTThVawvk1ung7ELqFaKeBpZs X-Received: by 2002:a17:907:7850:: with SMTP id lb16mr5743748ejc.67.1635993444203; Wed, 03 Nov 2021 19:37:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635993444; cv=none; d=google.com; s=arc-20160816; b=vpmruILQ9yJ8eS76WJ87vDyqY53lkFEoQmn3jxMSGr62v0t24w2kdFWKQhewtcb8Og ttr32dqAmaaaWN88LNAE/31thP14OKFxyMYbWHoCIwbSOICZVNmPpUMo9E4ODCDZ2EnS p3GoGjpEjUcf1D99Q7dgBK3Il0Y/s+UV7ja3gDkI6FcoX9tvboqb5bCjIzIOYEbew5nM EUl3cnoI9i/idW853fCG97qlOPaJ2qJ/ix1k+WCxLnE+57Ew0GvLT4G6ZrRVgAELfR9K +ZBBjrBSNnPKp1Xo+SVUN2btZyowvyfKX36vf1gygg3oSHsbXrlmniW1rGvxhjiAQiok W+nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:organization:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=87CEdR98Ghu4QblVfwvhG6g4XPGsU3H6UYandi0+O5M=; b=hLFul302cBn0OIgCZB0YoQUXBzjRAR0JjN+7ytEO4qc4XpE189nJbrljb4H46SOlYK /pKFYQZqUs/p5c/dace50YrXbcOnQeizjsKOcRNVE5qnPxFlNs400Q56i30RZE7NkgSe Okbu/zuXdasVGWNn2FjFg/2Ocb6Wnn/wCwOpu5ppYcJxdt4Xijdb/c5zFGOMk8HWSC+6 tFje9d0ih/Gg8SheLxCFEr9WZa7vJ2YZapRqEb46X2nLMHKvF9ZBVWzqC+WxiGH5f5CR uynbQI2XERNhTnoRnM4RaUcYUmlz6JFQ4RtbUqtShI8dv2SKTeY7y1FBzq8FxjK+gkJY YFXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@auristor.com header.s=MDaemon header.b=MEZrg1FN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=auristor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si9680908edf.92.2021.11.03.19.36.53; Wed, 03 Nov 2021 19:37:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@auristor.com header.s=MDaemon header.b=MEZrg1FN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=auristor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbhKDChQ (ORCPT + 99 others); Wed, 3 Nov 2021 22:37:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbhKDChP (ORCPT ); Wed, 3 Nov 2021 22:37:15 -0400 X-Greylist: delayed 313 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 03 Nov 2021 19:34:38 PDT Received: from sequoia-grove.ad.secure-endpoints.com (sequoia-grove.secure-endpoints.com [IPv6:2001:470:1f07:f77:70f5:c082:a96a:5685]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44E82C06127A for ; Wed, 3 Nov 2021 19:34:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/relaxed; d=auristor.com; s=MDaemon; r=y; t=1635992962; x=1636597762; i=jaltman@auristor.com; q=dns/txt; h=Message-ID:Date: MIME-Version:User-Agent:Subject:Content-Language:To:Cc: References:From:Organization:In-Reply-To:Content-Type; bh=87CEdR 98Ghu4QblVfwvhG6g4XPGsU3H6UYandi0+O5M=; b=MEZrg1FNp9QqiAwKUfZIyW ToFtQ/x6OJsDUs3Z7L1AbGa/xotfxUB3Lp/bGmCXwXfeC/+sbB5cxMO2EOVRrTiB SC34WdhAni8mLewV4UvcIPsN8lEmMxUJeXGBQFVo6BpSSRk17/qTx3vxP2B84ge6 +2Nfgn8H2P9rE3fT026j0= X-MDAV-Result: clean X-MDAV-Processed: sequoia-grove.ad.secure-endpoints.com, Wed, 03 Nov 2021 22:29:22 -0400 Received: by auristor.com (208.125.0.235) (MDaemon PRO v21.5.0) with ESMTPSA id md5001003025058.msg; Wed, 03 Nov 2021 22:29:21 -0400 X-Spam-Processed: sequoia-grove.ad.secure-endpoints.com, Wed, 03 Nov 2021 22:29:21 -0400 (not processed: message from trusted or authenticated source) X-MDRemoteIP: 50.204.136.171 X-MDArrival-Date: Wed, 03 Nov 2021 22:29:21 -0400 X-MDOrigin-Country: US, NA X-Authenticated-Sender: jaltman@auristor.com X-Return-Path: prvs=194251a06c=jaltman@auristor.com X-Envelope-From: jaltman@auristor.com X-MDaemon-Deliver-To: linux-kernel@vger.kernel.org Message-ID: Date: Wed, 3 Nov 2021 19:29:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH] afs: Fix ENOSPC, EDQUOT and other errors to fail a write rather than retrying Content-Language: en-US To: "David Howells (dhowells@redhat.com)" , marc.dionne@auristor.com Cc: linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <163598300034.1327800.8060660349996331911.stgit@warthog.procyon.org.uk> From: Jeffrey E Altman Organization: AuriStor, Inc. In-Reply-To: <163598300034.1327800.8060660349996331911.stgit@warthog.procyon.org.uk> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="------------ms090301090205030704020002" X-MDCFSigsAdded: auristor.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a cryptographically signed message in MIME format. --------------ms090301090205030704020002 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Looks good to me. Reviewed-by Jeffrey Altman On 11/3/2021 4:43 PM, David Howells (dhowells@redhat.com) wrote: > Currently, at the completion of a storage RPC from writepages, the errors > ENOSPC, EDQUOT, ENOKEY, EACCES, EPERM, EKEYREJECTED and EKEYREVOKED cause > the pages involved to be redirtied and the write to be retried by the VM at > a future time. > > However, this is probably not the right thing to do, and, instead, the > writes should be discarded so that the system doesn't get blocked (though > unmounting will discard the uncommitted writes anyway). > > Fix this by making afs_write_back_from_locked_page() call afs_kill_pages() > instead of afs_redirty_pages() in those cases. > > EKEYEXPIRED is left to redirty the pages on the assumption that the caller > just needs to renew their key. Unknown errors also do that, though it > might be better to squelch those too. > > This can be triggered by the generic/285 xfstest. The writes can be > observed in the server logs. If a write fails with ENOSPC (ie. CODE > 49733403, UAENOSPC) because a file is made really large, e.g.: > > Wed Nov 03 23:21:35.794133 2021 [1589] EVENT YFS_SRX_StData CODE 49733403 NAME --UnAuth-- HOST [192.168.1.2]:7001 ID 32766 FID 1048664:0.172306:30364251 UINT64 17592187027456 UINT64 65536 UINT64 17592187092992 UINT64 0 > > this should be seen once and not repeated. > > Reported-by: Marc Dionne > Signed-off-by: David Howells > cc: Jeffrey E Altman > cc: linux-afs@lists.infradead.org > --- > > fs/afs/write.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/fs/afs/write.c b/fs/afs/write.c > index 8b1d9c2f6bec..04f3f87b15cb 100644 > --- a/fs/afs/write.c > +++ b/fs/afs/write.c > @@ -620,22 +620,18 @@ static ssize_t afs_write_back_from_locked_page(struct address_space *mapping, > default: > pr_notice("kAFS: Unexpected error from FS.StoreData %d\n", ret); > fallthrough; > - case -EACCES: > - case -EPERM: > - case -ENOKEY: > case -EKEYEXPIRED: > - case -EKEYREJECTED: > - case -EKEYREVOKED: > afs_redirty_pages(wbc, mapping, start, len); > mapping_set_error(mapping, ret); > break; > > + case -EACCES: > + case -EPERM: > + case -ENOKEY: > + case -EKEYREJECTED: > + case -EKEYREVOKED: > case -EDQUOT: > case -ENOSPC: > - afs_redirty_pages(wbc, mapping, start, len); > - mapping_set_error(mapping, -ENOSPC); > - break; > - > case -EROFS: > case -EIO: > case -EREMOTEIO: > > --------------ms090301090205030704020002 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCC DGswggXSMIIEuqADAgECAhBAAW0B1qVVQ32wvx2EXYU6MA0GCSqGSIb3DQEBCwUAMDoxCzAJ BgNVBAYTAlVTMRIwEAYDVQQKEwlJZGVuVHJ1c3QxFzAVBgNVBAMTDlRydXN0SUQgQ0EgQTEy MB4XDTE5MDkwNTE0MzE0N1oXDTIyMTEwMTE0MzE0N1owcDEvMC0GCgmSJomT8ixkAQETH0Ew MTQxMEMwMDAwMDE2RDAxRDZBNTQwMDAwMDQ0NDcxGTAXBgNVBAMTEEplZmZyZXkgRSBBbHRt YW4xFTATBgNVBAoTDEF1cmlTdG9yIEluYzELMAkGA1UEBhMCVVMwggEiMA0GCSqGSIb3DQEB AQUAA4IBDwAwggEKAoIBAQCY1TC9QeWnUgEoJ81FcAVnhGn/AWuzvkYRUG5/ZyXDdaM212e8 ybCklgSmZweqNdrfaaHXk9vwjpvpD4YWgb07nJ1QBwlvRV/VPAaDdneIygJJWBCzaMVLttKO 0VimH/I/HUwFBQT2mrktucCEf2qogdi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