From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.30.99 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796278878; b=fJpOBgpHAiPpsKs9/8Lr0C8lns1/y84VFHjKI72aglhllaTYxIrhG89165uNYTr0ssVR 29qndBVEbKflsLeXNM72hP4z9p8jGmTDRVvqMLRDeUJpLM0WtLj8Vol8nkN2JOB3H8WO2 U+ot5SiH4CzlgDBTsfTj7NUf5OgCn8UgMWNR1eYsujxcXdP1bDfEckdNyn1fZNme6aybw 8i4T3HjrKa7MhABrDD5oI4wdUcAx/Et+PWQyFKtF25Mc2bOEZSG+oBh453dpufihT8sDi AakW5S2KlXTHnc8PZsFkVAEHpf2Znmaj/bKm1IlcL8hPOwaMIHFkR3+Xyy5Rvpx+TBA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796278878; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=5ZoIWTccF5LlIKjLE/IURDykP8EH7cg4jZs/h8ptO84=; b=XiGA770L2HxxqUJMwhHEVBnrnbHP5xrbcatdGSOFEe5lDzhhGEJc4xGcxlhwU9fTOJ1T g9HYfCPMR7XSDragquS2JgRIQ7OhhmdORyJfbZz74CfGMBu7P0ppRYfKry5bCKz3OQ9tR 9nieTJCrNGAZUhQxnZoeN743n8xjSAdo0mPwtZ3nc4i249j+lWDrOaJBVFENrFByETIcv 6xQJPh/AxkVY1VVVY8oTPoQlpcrxP96IcUqWcF615NaCg8hC59y1GIMTuRRoRCmhA7Td3 L+gdrNJ7LnTysZXXGBFb2zSTAaV4sv0JCM4SApZzMnMYMvJihbm6WklWDW0hWO+YaDw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=ngf+OQ0H; arc=none smtp.remote-ip=115.124.30.99 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 980B9606A322 for ; Thu, 3 Dec 2026 06:21:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 980B9606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.a=rsa-sha256 header.s=default header.b=ngf+OQ0H DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1796278872; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=5ZoIWTccF5LlIKjLE/IURDykP8EH7cg4jZs/h8ptO84=; b=ngf+OQ0H3qcm0Jn+aTRwCcb426NSfN4A0a+2AFOuw1eFpUxrgIo0Crj4O8xnrULT40EtsjiLlcPj8Vwi9eHHZYAcGOwViab6N9y1qmjBS0vx3YQoD8t1mtlPBXXB1sVnXNIKXqDVEQDkPUFapgDCGu1oC0gkjwd1GuZeHg8373Y= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R121e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033065142238;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0XGD4KR8_1796278871; Received: from 30.221.129.217(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0XGD4KR8_1796278871 cluster:ay36) by smtp.aliyun-inc.com; Thu, 03 Dec 2026 14:21:11 +0800 Message-ID: <4240e030-e7e0-4532-87cd-41a521ef88df@linux.alibaba.com> Date: Thu, 3 Dec 2026 14:21:10 +0800 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v14 00/10] migrate ocfs2 DIO from buffer_head to iomap To: Nico Schmidt Cc: "akpm@linux-foundation.org" , "hch@lst.de" , "heming.zhao@suse.com" , "jlbec@evilplan.org" , "linux-kernel@vger.kernel.org" , "mark@fasheh.com" , "ocfs2-devel@lists.linux.dev" References: From: Joseph Qi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 > > 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