linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeffrey E Altman <jaltman@auristor.com>
To: "David Howells (dhowells@redhat.com)" <dhowells@redhat.com>,
	marc.dionne@auristor.com
Cc: linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] afs: Fix ENOSPC, EDQUOT and other errors to fail a write rather than retrying
Date: Wed, 3 Nov 2021 19:29:12 -0700	[thread overview]
Message-ID: <d65fda27-dd0c-a538-046b-6a599315879c@auristor.com> (raw)
In-Reply-To: <163598300034.1327800.8060660349996331911.stgit@warthog.procyon.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2525 bytes --]

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 <marc.dionne@auristor.com>
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Jeffrey E Altman <jaltman@auristor.com>
> 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:
>
>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4033 bytes --]

  reply	other threads:[~2021-11-04  2:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 23:43 [PATCH] afs: Fix ENOSPC, EDQUOT and other errors to fail a write rather than retrying David Howells
2021-11-04  2:29 ` Jeffrey E Altman [this message]
2021-11-04  3:22 ` Matthew Wilcox
2021-11-04 15:15   ` Jeffrey E Altman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d65fda27-dd0c-a538-046b-6a599315879c@auristor.com \
    --to=jaltman@auristor.com \
    --cc=dhowells@redhat.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.dionne@auristor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).