Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp202497lqf; Fri, 26 Apr 2024 04:28:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQfIVxIzM7K6LF1wkUcAA3YZiQmHLE+P3lD7oR/7mRFkKej3i/9TBwCcJXvHrF+VWT0TXJMRCigorUSWOi+HO8SPdBitwwULMS9w5bnw== X-Google-Smtp-Source: AGHT+IHsg/wcKy/+/9NZc8iesGYrB2xlh+mMR7ojv+dOh+Uk+6gOhsFxvMr4hKXjrsSPcmT2LMB4 X-Received: by 2002:a17:902:b68e:b0:1e7:8686:c37b with SMTP id c14-20020a170902b68e00b001e78686c37bmr2324964pls.22.1714130885014; Fri, 26 Apr 2024 04:28:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714130884; cv=pass; d=google.com; s=arc-20160816; b=cE465+OHzXMSzg1S6T+xi1GAzjawbgtmnmgJYBPRHGsWGTMOFrrAB/YjjJ05YrN5Gh rIoy/2fAUiZNjreJghYTy7uE3eg2DMoRDG0Z2Heq+2CO4Rxnw1c3wnIXnFnDu/ef+QSd 4CKmtW59AF/O9dkx6tVewPqxiXZTie0vnTE1CBcSPU4L4mRn9DCxvqxWigtJH+6XmON0 R0fVRTymsloPmwPFYLY8qNFdG48wf2TueDyFdQTuZB/fBiMsULD7FJ4JZhNL78pPGg+g jNYkpLcpTsr4f72MKJ3rRZ3tzSAtepQirmFZUvHpNlB03MZdOmtVC7fGuYtKtfVnnZMD 15Bw== 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=OsCAXcsOgjQmywmQiyJHHP0zBpAzxY9THRzdMHy/kms=; fh=wtfDnH9OgMmQvdL3AQJYFuv0cmuONU+xUAgm37ktAAM=; b=XFEUVwo5Glu+AqyZ6d4oblQuAF/b+L+SbTV+JStmQS2Sq03+6/ofw2WL8oINccClJR zOP+43qvVrkJBgrP3LF3UhuPouXkkooyQyRJJS4BY4i9C47ZOZbb9JCSt6DEde+7egLB ab689IELSpVh6jL+kysLAKeSaNfhSdA19Q9Ll9pmqJiWzgU14FzmZHKxzfWIRnYYUXdy 3wgwrqc4JEXgWMDECjSrVlR+bgt0mucDDnvhKjebciZ8glx/QeDIHr+U6U5FeAt/nxZj MtGWRLhHagt4xOqH4fF1N6TNa/xiwv/E5/SxUw51bC/6b4SyC5sOtEa51eplrDjiW9Fc wW+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=wZKm1ytG; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-159558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159558-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j4-20020a170902da8400b001e41c66599fsi15024694plx.478.2024.04.26.04.28.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 04:28:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=wZKm1ytG; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-159558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159558-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E466528388C for ; Fri, 26 Apr 2024 06:22:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0589713A886; Fri, 26 Apr 2024 06:22:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="wZKm1ytG" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D7FD013A3F6; Fri, 26 Apr 2024 06:22:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714112560; cv=none; b=bJXNhmt1jATPH/LnBT5UCdwfxAd/R9KIik786NEsfCi0marLjXbEZzevCerLY0xYCJ2W2ksqhYnGCGDAXEU5vJoZimqM4qNFe+dUgbkoDOBAo17Qn71ypZOR80p4+1u+9XlTehkLx8SJGg94EwEu1szKqI6Q85R82KFCiq2RmME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714112560; c=relaxed/simple; bh=BR48DrtgCPpatn69kUSmi7M2D+owOLBvQdsaqG/9+R8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P8Q30rSK2vPta8y+2JP7Yx7Fp80GiqXRuk5LX5YAjY8ivMfs0HEh4Q5OZ3h3H8NpEN3Ox0z4nzR/0DeH/h3YTZW1CdpZr4GUdndhz/ovutGqNojmZ6i7YEPlTBBCEvw301AMlB3w7OKcPOOGXXhUwrDv/rZY0P57uu4MbBsJoGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=wZKm1ytG; arc=none smtp.client-ip=198.137.202.133 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=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=OsCAXcsOgjQmywmQiyJHHP0zBpAzxY9THRzdMHy/kms=; b=wZKm1ytG9a1ZnUonedxPFrvO0g U6Q9t7hfkAQkIP4+Z8OfwFc8wekHFirxtyScMm48irq7pVsay7NEyvMEpQwDtOdfFm+eVU/RyVmhX TjGhLKN66BuY73OHbrT8FobgqymnsDyIHM4d/8fiySCT0VT6qzOWIzO0eU7v4TvYTaFz/Mai9i1SN 2dEmpYu9o7smJ/sa9OE30EXtdIUA3coUZcGA+lMJhRiSh4PoMESXTlRS+Oxh5fOW112QWNssSuygu t3UpOPkOfOd61djqpu1+q/wnQhuEeaG3NkSl4JwjUWNfENMbDcQUoRNaD8nyeMyIU+dDqioWNwFPC GsILR2+g==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s0Eyh-0000000BI6s-392P; Fri, 26 Apr 2024 06:22:35 +0000 Date: Thu, 25 Apr 2024 23:22:35 -0700 From: Christoph Hellwig To: "Pankaj Raghav (Samsung)" Cc: willy@infradead.org, djwong@kernel.org, brauner@kernel.org, david@fromorbit.com, chandan.babu@oracle.com, akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org, hare@suse.de, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, mcgrof@kernel.org, gost.dev@samsung.com, p.raghav@samsung.com Subject: Re: [PATCH v4 07/11] iomap: fix iomap_dio_zero() for fs bs > system page size Message-ID: References: <20240425113746.335530-1-kernel@pankajraghav.com> <20240425113746.335530-8-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: <20240425113746.335530-8-kernel@pankajraghav.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Thu, Apr 25, 2024 at 01:37:42PM +0200, Pankaj Raghav (Samsung) wrote: > From: Pankaj Raghav > > iomap_dio_zero() will pad a fs block with zeroes if the direct IO size > < fs block size. iomap_dio_zero() has an implicit assumption that fs block > size < page_size. This is true for most filesystems at the moment. > > If the block size > page size, this will send the contents of the page > next to zero page(as len > PAGE_SIZE) to the underlying block device, > causing FS corruption. > > iomap is a generic infrastructure and it should not make any assumptions > about the fs block size and the page size of the system. So what happened to the plan to making huge_zero_page a folio and have it available for non-hugetlb setups? Not only would this be cleaner and more efficient, but it would actually work for the case where you'd have to zero more than 1MB on a 4k PAGE_SIZE system, which doesn't seem impossible with 2MB folios.