Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1534498rbb; Mon, 26 Feb 2024 12:25:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWSzC16eeUCwV9nXjDEpiNZDcEPnM6uLHUYBCMM34viKCnCttwZ6hPqSEk97riRW69N1UfwslouWKYIYYPTnx+VgAjfyMfathPdEN2xLg== X-Google-Smtp-Source: AGHT+IH3TXOTMoZfTe2tW7/aj9th7m6UQ/Lq7pcAD1GWSU6II0al9VjJaB0CF+aw+XCTsZ0Rqpdt X-Received: by 2002:a05:620a:66a:b0:787:bae4:247f with SMTP id a10-20020a05620a066a00b00787bae4247fmr213781qkh.29.1708979128584; Mon, 26 Feb 2024 12:25:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708979128; cv=pass; d=google.com; s=arc-20160816; b=s49oQ3jpyzvCvMpMuonedik7sevcf8KCe1hsSJAQIK+t837mUHT6USdRqcnMZBKQFS Qd6p4LsYT/zL8uSF92hbpjUOV5LXgt9VALRw9jBi9V9RJB7K9L2yF97JxToF85hph/PA +HhzdehT2/OySvJBOTTBYJdU9A4NW77BhCa5sfJnHgbgE8X19bXkuEcDHvgYZc2PiOIC Fp/jAfclMJVW2Xbbpfl2xzSCHGQEdld5fK3u440HB5XMzFK+9eMSP1AThZe4A1JHMA4R oT/G560MS3hdNjWj4tHcXLUUdf9oCNPsrX6r3w6FvT9BJ06kTXjmxVZWOlO6NwWUrkeK SZeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=29RQZolZJ+S71Y+xqolEPeXKycR8yatJmFhICqJiOuE=; fh=IrswWLQdr8RUReWLOUl6bTv3Gs7y0bSQu4ieH1tZUiQ=; b=C9BTrfS8ty8zXIYzevCgsts7TfzAZbqaZvu2FO39HZLwVJ46dUNy9mEbWX3iC6t1o4 BHoSWy2RjaVQAKsgQJUi+Pjf5AgqWnHurK/QggWo5X8oFT6G5904l88ZW6R+ctGlAAsp Bwe7MUJV8RhrPw+B2/fZB5uQ3sdJ5Oj4P+eVY5EutFx0Tj40zp3PU/W1uQjzOnen/vPd uORekV5z3TYOHDPG+rYgGrgXnXSyLapz9OnQi7/h8wvLbV4CxHXW6xrw3l1613/pwId/ YA6pPuOC/c2cDeEsaiqUA+BT4hZOV0NZ7oxffA2q3vR2SUgAlJvgi5X+k9Kr61sQsIsL dloA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JGn+ddpk; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-82111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82111-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bq7-20020a05620a468700b00787bc4464f4si6526735qkb.263.2024.02.26.12.25.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:25:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=JGn+ddpk; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-82111-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82111-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B87521C263E1 for ; Mon, 26 Feb 2024 17:58:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B4CF012EBED; Mon, 26 Feb 2024 17:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="JGn+ddpk" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C77012C815; Mon, 26 Feb 2024 17:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708970329; cv=none; b=fXw9A1/6MkgSmvUxMdIWrqnVhOoVtVViKNylQgz6I7COLnD4yVyPLYkJASimjE273Tt23K4niLpyyf72VMnJoHHjQtRnxIlD731RmqP4vbk8tMsFwqFd/7kcxHKY87scVSm3UKU8c4Go6CjPmZ/Gr0+K8fvJKElxZDDtPC5EIYM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708970329; c=relaxed/simple; bh=JCKGyXmXmi33uTluuNOUyXMVPJdU5wG6Bzr+GONc22A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Xr1A8LyvAMFv23tMqK0gxvrDKW6n/AcYw7xJiqJIJAvSmxw9yb1NBrkSKu1qZ4h3u0fLVzNUgXQI5W1xmCRMKWOmTdlsct28EGwRtaeZYaEn+KxMnXd9t1IW0MAOYuWv2tiEZf9OXuZ523sbU8J43U2lg7rVy5KnLqx1Q95HnD8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=JGn+ddpk; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=29RQZolZJ+S71Y+xqolEPeXKycR8yatJmFhICqJiOuE=; b=JGn+ddpkrdBTTW6om/gUMcO+ha pBUlwhCxIymXSDTVQ2PS/YUum0YlBaQoERJsHAfkOI0kU8bdOq2WUcqzjFm+7NInu9R7M9ZNEgjh9 BfTnjLwVQVeMt9hDDFVhKdHgQqtHkPljk7v9WPXSF+KYsC4utfxOQP4E8S9kKY19GIEZvBEzCD3bV mbrA/wD0H633S2uXVjCXsvoZzexM8sEeU67m6PvCd4zuC5uLp8o4svfLErdr6IlyPca2T6zjNxXQn eepmZFZCY/LmfekHWR5QnZX0D3SCKQw1oYZ0IdjbqhpG937wvZ70jZCPrxxR189CiHAJ6CfuxuqHI iAkwOwQQ==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1refFT-00000000Dcf-1Gir; Mon, 26 Feb 2024 17:58:43 +0000 Date: Mon, 26 Feb 2024 17:58:43 +0000 From: Matthew Wilcox To: "Pankaj Raghav (Samsung)" Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, david@fromorbit.com, chandan.babu@oracle.com, akpm@linux-foundation.org, mcgrof@kernel.org, ziy@nvidia.com, hare@suse.de, djwong@kernel.org, gost.dev@samsung.com, linux-mm@kvack.org, Pankaj Raghav Subject: Re: [PATCH 10/13] iomap: fix iomap_dio_zero() for fs bs > system page size Message-ID: References: <20240226094936.2677493-1-kernel@pankajraghav.com> <20240226094936.2677493-11-kernel@pankajraghav.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240226094936.2677493-11-kernel@pankajraghav.com> On Mon, Feb 26, 2024 at 10:49:33AM +0100, Pankaj Raghav (Samsung) wrote: > +++ b/fs/iomap/direct-io.c > @@ -239,14 +239,23 @@ static void iomap_dio_zero(const struct iomap_iter *iter, struct iomap_dio *dio, > struct page *page = ZERO_PAGE(0); > struct bio *bio; > > - bio = iomap_dio_alloc_bio(iter, dio, 1, REQ_OP_WRITE | REQ_SYNC | REQ_IDLE); > + WARN_ON_ONCE(len > (BIO_MAX_VECS * PAGE_SIZE)); > + > + bio = iomap_dio_alloc_bio(iter, dio, BIO_MAX_VECS, > + REQ_OP_WRITE | REQ_SYNC | REQ_IDLE); > fscrypt_set_bio_crypt_ctx(bio, inode, pos >> inode->i_blkbits, > GFP_KERNEL); > + > bio->bi_iter.bi_sector = iomap_sector(&iter->iomap, pos); > bio->bi_private = dio; > bio->bi_end_io = iomap_dio_bio_end_io; > > - __bio_add_page(bio, page, len, 0); > + while (len) { > + unsigned int io_len = min_t(unsigned int, len, PAGE_SIZE); > + > + __bio_add_page(bio, page, io_len, 0); > + len -= io_len; > + } I thought we were going to use the huge_zero_page for this?