Linux-NFS Archive mirror
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: linux-nfs@vger.kernel.org,
	Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna@kernel.org>,
	Olga Kornievskaia <okorniev@redhat.com>
Subject: Re: [PATCH] pNFS/filelayout: fix cheking if a layout is striped
Date: Tue, 28 Apr 2026 11:13:29 +0300	[thread overview]
Message-ID: <d61888c7-347e-4ddd-a8f8-b0095c5c8700@grimberg.me> (raw)
In-Reply-To: <20260427062757.647256-1-sagi@grimberg.me>

CC Olga

On 27/04/2026 9:27, Sagi Grimberg wrote:
> A layout can be striped with num_fh = 1. It is perfectly possible that
> both MDS and DSs can handle the same filehandle, which is exactly the
> case in vast pnfs layouts. Hence check according to stripe_count > 1,
> which is the correct check to begin with.
>
> We should not be called with flseg->dsaddr = NULL, but if for some reason
> we do, return our best guess with is flseg->num_fh > 1.
>
> Fixes: a6b9d2fa0024 ("pNFS/filelayout: Fix coalescing test for single DS")
> Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>   fs/nfs/filelayout/filelayout.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c
> index 90a11afa5d05..c28b3d5bfa8c 100644
> --- a/fs/nfs/filelayout/filelayout.c
> +++ b/fs/nfs/filelayout/filelayout.c
> @@ -778,6 +778,8 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
>   static bool
>   filelayout_lseg_is_striped(const struct nfs4_filelayout_segment *flseg)
>   {
> +	if (flseg->dsaddr)
> +		return flseg->dsaddr->stripe_count > 1;
>   	return flseg->num_fh > 1;
>   }
>   


      reply	other threads:[~2026-04-28  8:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  6:27 [PATCH] pNFS/filelayout: fix cheking if a layout is striped Sagi Grimberg
2026-04-28  8:13 ` Sagi Grimberg [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=d61888c7-347e-4ddd-a8f8-b0095c5c8700@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=anna@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=okorniev@redhat.com \
    --cc=trond.myklebust@hammerspace.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 read-only IMAP folder(s) and NNTP newsgroup(s).