public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Dai Ngo <dai.ngo@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
	chuck.lever@oracle.com, jlayton@kernel.org, neil@brown.name,
	okorniev@redhat.com, tom@talpey.com, alex.aring@gmail.com,
	linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/1] NFSD: Enforce recall timeout for layout conflict
Date: Wed, 21 Jan 2026 09:38:07 +0100	[thread overview]
Message-ID: <20260121083807.GA15669@lst.de> (raw)
In-Reply-To: <0b0112f8-793c-42af-a2a7-ee662496a9e4@oracle.com>

On Tue, Jan 20, 2026 at 10:54:39AM -0800, Dai Ngo wrote:
> Thank you Christoph! I have a couple of questions regarding to
> xfs_break_layouts and xfs_break_leased_layouts.
>
> . Should we break out of the while loop in xfs_break_leased_layouts
> if the 2nd call to break_layout, inside the while loop, returns error
> other than -EWOULDBLOCK?

Good question.

> . In xfs_break_leased_layouts, the return value of the 2nd call to
> break_layout was rightly ignored since the call was made without
> holding the xfs_inode lock so there could be a race condition where
> a new layout was handled out to another client.

I have to admin that I'm not sure what other errors we could
have.  Looking through the code I see:

 o -EINVAL for incorrect flags.
 o the error from lease_alloc, which could be -ENOMEM, -EINVAL
   again for a wrong type
 o -EINTR or similar from wait_event_interruptible_timeout

The -EINVAL cases can't happen, for code hygiene they probably should be
handled.  -EINTR means the caller gave up, so it should be handled.
-ENOMEM for the tiny structure is basically impossible to hit, but there
is no point in not giving up, so it should be handled as well.

So yeah, I think we should break out of the loop on error.


  reply	other threads:[~2026-01-21  8:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19 17:47 [PATCH 1/1] NFSD: Enforce recall timeout for layout conflict Dai Ngo
2026-01-19 22:49 ` kernel test robot
2026-01-20  7:26 ` Christoph Hellwig
2026-01-20 18:54   ` Dai Ngo
2026-01-21  8:38     ` Christoph Hellwig [this message]
2026-01-20 15:19 ` Chuck Lever
2026-01-20 19:22   ` Dai Ngo
2026-01-20 20:55   ` Dai Ngo
2026-01-20 20:41 ` Jeff Layton
2026-01-20 21:22   ` Dai Ngo
2026-01-20 21:28     ` Jeff Layton
2026-01-20 21:42       ` Dai Ngo
2026-01-20 22:03         ` Jeff Layton
2026-01-20 22:48       ` Dai Ngo
2026-01-21 14:34         ` Jeff Layton

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=20260121083807.GA15669@lst.de \
    --to=hch@lst.de \
    --cc=alex.aring@gmail.com \
    --cc=chuck.lever@oracle.com \
    --cc=dai.ngo@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.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