All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pankaj Raghav (Samsung)" <pankaj.raghav@linux.dev>
To: Anthony Iliopoulos <ailiop@suse.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: skip iunlock with empty iolock flags in xfs_file_dio_write_aligned
Date: Thu, 22 Oct 2026 09:42:57 +0200	[thread overview]
Message-ID: <atm9R4iXS7vP-cBz@quentin> (raw)
In-Reply-To: <20261021210032.14001-1-ailiop@suse.com>

On Wed, Oct 21, 2026 at 11:00:32PM +0200, Anthony Iliopoulos wrote:
> When using RWF_NOWAIT, xfs_file_write_checks may fail to acquire an
> exclusive lock upgrade and return -EAGAIN for aligned DIO, setting
> iolock to 0.
> 
> In XFS_DEBUG kernels, passing no lock flags to xfs_iunlock triggers an
> assertion failure. Fix this by unlocking the iolock only when there are
> any flags set.
> 
> Fixes: 2e2383405824 ("xfs: implement direct writes to zoned RT devices")
> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>

Looks good.

Reviewed-by: Pankaj Raghav <p.raghav@samsung.com>

> ---
>  fs/xfs/xfs_file.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
> index 7d0c8a197575..1eab6dbb4c5f 100644
> --- a/fs/xfs/xfs_file.c
> +++ b/fs/xfs/xfs_file.c
> @@ -766,7 +766,8 @@ xfs_file_dio_write_aligned(
>  	trace_xfs_file_direct_write(iocb, from);
>  	ret = iomap_dio_rw(iocb, from, ops, dops, dio_flags, ac, 0);
>  out_unlock:
> -	xfs_iunlock(ip, iolock);
> +	if (iolock)
> +		xfs_iunlock(ip, iolock);
>  	return ret;
>  }
>  
> -- 
> 2.56.0
> 

-- 
Pankaj

  reply	other threads:[~2026-10-22  7:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 21:00 [PATCH] xfs: skip iunlock with empty iolock flags in xfs_file_dio_write_aligned Anthony Iliopoulos
2026-10-22  7:42 ` Pankaj Raghav (Samsung) [this message]
2026-10-27 15:43 ` Christoph Hellwig

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=atm9R4iXS7vP-cBz@quentin \
    --to=pankaj.raghav@linux.dev \
    --cc=ailiop@suse.com \
    --cc=linux-xfs@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.