From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72EB5C433EF for ; Thu, 26 May 2022 18:13:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243254AbiEZSN4 (ORCPT ); Thu, 26 May 2022 14:13:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236329AbiEZSN4 (ORCPT ); Thu, 26 May 2022 14:13:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964AFB2272; Thu, 26 May 2022 11:13:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C85AE61640; Thu, 26 May 2022 18:13:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B241AC385A9; Thu, 26 May 2022 18:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653588834; bh=e6S1wsx8dmsbh7szOOlugfAeR1nroErTcI2BgiOX/FU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QCgShyLY+H5CQf3JN8bBEE7latBQ1v5NiNG0GuvYaFefMGEm7yVcxpP4hoCJDaXX8 AdYKSYAQCi5hQwepnCCNe+EQv1KxgaojqJ++ItqeJWr4cwJu41CUTPu6EMtgVGcFmX k/1bXzqgDJ+EcdV3d96001eIDoVwh5u6F+E4zrRE1UstKRPSKKOQuf0ej58ElEHKLQ +VxjNnU7TAeo4l+lfv9iuL/UOY8XWAu2qWDTxkMRkXSMGPpyv7xlrqbYT9Z2byd4uY 7uJU3inaSu7Qf5z65rvHQ8ktq/MtGggMpPvRk0GB214PSWr+rtybLbMdqNFiP4aZv/ Dm1Zu8FmwCNjg== Date: Thu, 26 May 2022 11:13:52 -0700 From: Eric Biggers To: Keith Busch Cc: Keith Busch , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, axboe@kernel.dk, Kernel Team , hch@lst.de, bvanassche@acm.org, damien.lemoal@opensource.wdc.com, pankydev8@gmail.com Subject: Re: [PATCHv4 8/9] block: relax direct io memory alignment Message-ID: References: <20220526010613.4016118-1-kbusch@fb.com> <20220526010613.4016118-9-kbusch@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu, May 26, 2022 at 07:50:45AM -0600, Keith Busch wrote: > On Thu, May 26, 2022 at 12:29:41AM -0700, Eric Biggers wrote: > > On Wed, May 25, 2022 at 06:06:12PM -0700, Keith Busch wrote: > > > + /* > > > + * Each segment in the iov is required to be a block size multiple. > > > > Where is this enforced? > > Right below the comment. If it isn't a block size multiple, then ALIGN_DOWN > will eventually result in 0 and -EFAULT is returned. That's interesting, I would have expected it to be checked in blkdev_dio_aligned(). EFAULT isn't the correct error code for this case; it should be EINVAL as is normally the case for bad alignment. See the man pages for read and write. - Eric