From: Olga Kornievskaia <aglo@umich.edu>
To: Olga Kornievskaia <okorniev@redhat.com>
Cc: trondmy@kernel.org, anna.schumaker@oracle.com, linux-nfs@vger.kernel.org
Subject: Re: [RFC PATCH 1/1] NFS: fix writeback in presence of errors
Date: Tue, 24 Mar 2026 13:21:32 -0400 [thread overview]
Message-ID: <CAN-5tyGWe+VVt3b-JegY7O0N_=zjbnnHRKDv0nStjcf9aa7smg@mail.gmail.com> (raw)
In-Reply-To: <20260312171526.85759-1-okorniev@redhat.com>
On Thu, Mar 12, 2026 at 1:15 PM Olga Kornievskaia <okorniev@redhat.com> wrote:
>
> After running xfstest generic/751, in certain conditions, can have
> a writeback IO stuck while experiencing one of the two patterns.
>
> Pattern#1: writeback IO experiences ENOSPC on an offset smaller
> than the filesize. Example,
> write offset=0 len=4096 how=unstable OK
> write offset=8192 len=4096 how=unstable OK
> write offset=12288 len=4096 how=unstable ENOSPC
> write offset=4096 len=4096 how=unstable ENOSPC
> client sends a commit and receives a verifier which is different
> from the last successful write. It marks pages dirty and writeback
> retries. But it again send writes unstable and gets into the same
> pattern, running into the ENOSPC error and sending a commit because
> writes were sent at unstable.
The patch doesn't actually fix this pattern. I mistakenly thought it
was. I continue working on trying to find the solution but it looks
like the same approach does not work (ie marking the request in some
way so that the next time writeback happens it does so sync doesn't
work as each time writeback creates a new request and thus the
requests that was marked is not useful).
> Pattern#2: an unstable write followed by a short write and ENOSPC.
> write offset=0 len=4096 how=unstable OK
> write offset=4096 len=4096 how=unstable returns OK but count=100
> write offset=4197 len=3996 how=stable returns ENOSPC
> client send a commit and receives a verifier different from
> the last unstable write. The same behaviour is retried in a loop.
This pattern the patch does fix though.
>
> Instead, this patch proposes to identify those conditions and mark
> requests to be done synchronously instead.
>
> Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
> ---
> fs/nfs/pagelist.c | 2 ++
> fs/nfs/write.c | 2 ++
> include/linux/nfs_page.h | 1 +
> 3 files changed, 5 insertions(+)
>
> diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
> index a9373de891c9..b835b197a223 100644
> --- a/fs/nfs/pagelist.c
> +++ b/fs/nfs/pagelist.c
> @@ -1186,6 +1186,8 @@ static int __nfs_pageio_add_request(struct nfs_pageio_descriptor *desc,
>
> nfs_page_group_lock(req);
>
> + if (test_bit(PG_SYNC, &req->wb_flags))
> + desc->pg_ioflags |= FLUSH_STABLE;
> subreq = req;
> subreq_size = subreq->wb_bytes;
> for(;;) {
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index 1ed4b3590b1a..78f412851d59 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1554,6 +1554,7 @@ static void nfs_writeback_result(struct rpc_task *task,
> if (resp->count < argp->count) {
> static unsigned long complain;
>
> + set_bit(PG_SYNC, &hdr->req->wb_flags);
> /* This a short write! */
> nfs_inc_stats(hdr->inode, NFSIOS_SHORTWRITE);
>
> @@ -1837,6 +1838,7 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)
> /* We have a mismatch. Write the page again */
> dprintk(" mismatch\n");
> nfs_mark_request_dirty(req);
> + set_bit(PG_SYNC, &req->wb_flags);
> atomic_long_inc(&NFS_I(data->inode)->redirtied_pages);
> next:
> nfs_unlock_and_release_request(req);
> diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
> index afe1d8f09d89..e28599bebd44 100644
> --- a/include/linux/nfs_page.h
> +++ b/include/linux/nfs_page.h
> @@ -37,6 +37,7 @@ enum {
> PG_REMOVE, /* page group sync bit in write path */
> PG_CONTENDED1, /* Is someone waiting for a lock? */
> PG_CONTENDED2, /* Is someone waiting for a lock? */
> + PG_SYNC, /* writeback must write stable */
> };
>
> struct nfs_inode;
> --
> 2.52.0
>
>
prev parent reply other threads:[~2026-03-24 17:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-12 17:15 [RFC PATCH 1/1] NFS: fix writeback in presence of errors Olga Kornievskaia
2026-03-24 17:21 ` Olga Kornievskaia [this message]
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='CAN-5tyGWe+VVt3b-JegY7O0N_=zjbnnHRKDv0nStjcf9aa7smg@mail.gmail.com' \
--to=aglo@umich.edu \
--cc=anna.schumaker@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=okorniev@redhat.com \
--cc=trondmy@kernel.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).