mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Nico Schmidt <nico.schmidt@pegaprox.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"hch@lst.de" <hch@lst.de>,
	"heming.zhao@suse.com" <heming.zhao@suse.com>,
	"jlbec@evilplan.org" <jlbec@evilplan.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mark@fasheh.com" <mark@fasheh.com>,
	"ocfs2-devel@lists.linux.dev" <ocfs2-devel@lists.linux.dev>
Subject: Re: [RFC PATCH v14 00/10] migrate ocfs2 DIO from buffer_head to iomap
Date: Thu, 3 Dec 2026 14:21:10 +0800	[thread overview]
Message-ID: <4240e030-e7e0-4532-87cd-41a521ef88df@linux.alibaba.com> (raw)
In-Reply-To: <XvWUYQJNxCY7Tr8fJbQxT7oIAti_xMh1UlG85gH5_Yt9z70Lu21lVvsFdYSlQRgseote3jTXPnFgxH_m-9IC7Q-uznbqUjd570dn5FGdOR8=@pegaprox.com>

Thanks for testing this series.

On 12/3/26 3:26 AM, Nico Schmidt wrote:
> Hi Joseph,
> 
> thanks for the quick answer. As offered, I ran v14 on our multipath SAN
> lab. In short: no data errors, the two-node and crash runs passed, and
> one small issue with error logging on misaligned reads (below).
> 
> Setup:
> - next-20261127, with and without v14, x86_64, Debian 13 userspace,
>   the nodes are KVM guests
> - one TrueNAS iSCSI LUN (100 GiB, 512 byte logical blocks) over two
>   paths, dm-multipath with two path groups
> - mkfs.ocfs2 -b 4K -C 1M -T vmstore -N 4, o2cb, local heartbeat
> - the second node ran a 7.0 distribution kernel (Proxmox 7.0.6), so the
>   domain had the old and the new DIO path side by side
> 
> Results:
> 1. One node, base and v14: qemu-io growing a qcow2 with aio=io_uring,
>    native and threads; fio O_DIRECT extending writes with io_uring at
>    iodepth 1 and 16, libaio and pvsync2; RWF_NOWAIT; local mode; ext4
>    on the same map as a control. No errors on either kernel.
> 2. Two nodes writing at the same time (v14 with io_uring, 7.0 with
>    libaio): per node a 1 GiB extending sequential file and 512 MiB of
>    random writes into its own half of one shared sparse file, 64k
>    blocks, crc32c verify. Then each node verified the data of the
>    other with the page cache dropped. No errors.
> 3. Crash: SysRq-b on the v14 node while both were writing. The other
>    node evicted it after the idle timeout, became recovery master and
>    replayed slot 0. Its verified writer saw no error; the longest
>    single write took 12.5 s.
> 
> The issue: ocfs2_dio_end_io_r_pr() logs every error it gets, and with
> iomap an O_DIRECT read into a misaligned user buffer, which correctly
> fails with EINVAL, now reaches it:
> 
>   (qemu-io,6254,1):ocfs2_dio_end_io_r_pr:3980 ERROR: Direct IO failed, bytes = 0 errno:-22
> 

Okay, will change to return -EINVAL silently without log any error, just like
the old buffer head path.

Thanks,
Joseph

> Reproducer: preadv() of 4096 bytes at offset 0 on an O_DIRECT fd, into
> a buffer at a page address + 1. A misaligned length (1 byte) does not
> log, an aligned read does not log. QEMU probes the buffer alignment
> exactly like this when it opens an image with cache.direct=on
> (raw_probe_alignment() in block/file-posix.c), so with v14 every VM
> start on OCFS2 logs this line. The buffer_head path returned the EINVAL
> without logging. Maybe leave -EINVAL out there, or do not log on the
> read side at all, as ext4 and xfs do. I did not test the same on the
> write side.
> 
> Tested-by: Nico Schmidt <nico.schmidt@pegaprox.com>
> 
> About the io_uring EIO from my first mail: it is not in the DIO code
> this series replaces, and it is fixed in mainline since 7.1. Up to 7.0,
> fs/direct-io.c set REQ_NOWAIT on write bios for IOCB_NOWAIT. ocfs2 sets
> FMODE_NOWAIT, so io_uring tries each write nonblocking first, and
> dm-multipath does not support REQ_NOWAIT: submit_bio_noacct() ends the
> bio with BLK_STS_NOTSUPP, dio_bio_complete() turns that into -EIO, and
> io_uring gets no -EAGAIN to retry with. Christoph's 38273e7b153d
> ("direct-io: remove IOCB_NOWAIT support") removed that code, with the
> note that no filesystem on the legacy path sets FMODE_NOWAIT; ocfs2
> does. The commit has no stable tag, so 6.1 to 6.18 still fail. I will
> ask stable for it in a separate mail, with you on Cc.
> 
> The testing and the analysis were done with the help of an AI coding
> assistant (Claude); I went through the results.
> 
> Best regards,
> Nico


  reply	other threads:[~2026-12-03  6:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02 19:26 Nico Schmidt
2026-12-03  6:21 ` Joseph Qi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-12-01 10:07 Joseph Qi

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=4240e030-e7e0-4532-87cd-41a521ef88df@linux.alibaba.com \
    --to=joseph.qi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=heming.zhao@suse.com \
    --cc=jlbec@evilplan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=nico.schmidt@pegaprox.com \
    --cc=ocfs2-devel@lists.linux.dev \
    /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

all inboxes | Powered by JetHome®