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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CC0CC433E7 for ; Wed, 14 Oct 2020 17:42:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D46C2222C for ; Wed, 14 Oct 2020 17:42:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Nc/SMhiw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D46C2222C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 73F566B0062; Wed, 14 Oct 2020 13:42:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6C8F56B0068; Wed, 14 Oct 2020 13:42:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5902B6B006E; Wed, 14 Oct 2020 13:42:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0040.hostedemail.com [216.40.44.40]) by kanga.kvack.org (Postfix) with ESMTP id 2CDD26B0062 for ; Wed, 14 Oct 2020 13:42:06 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C24F9180AD806 for ; Wed, 14 Oct 2020 17:42:05 +0000 (UTC) X-FDA: 77371249410.13.juice57_4b095fa2720d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id A0BA518140B67 for ; Wed, 14 Oct 2020 17:42:05 +0000 (UTC) X-HE-Tag: juice57_4b095fa2720d X-Filterd-Recvd-Size: 2713 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Wed, 14 Oct 2020 17:42:03 +0000 (UTC) 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=N5SCUctooryolwHPCm/eaPiniU4nslCQLvVL8GRMMPE=; b=Nc/SMhiwi1YF/6L0yYbXv3s43a JZm89V8C74lfBiWNgv5Hq7T5THHPuaOQOapQYHXSbPK9qysoaGf18fBkJCIIw8TRkRuVqL+/iqz1E +Ycw8oXw5D+sTmZZMDJywSUG0DozxfB6spXavnr5NMR6njaFvxc6UvVYhBkxVY7+enq5rrBEB3g8X CIKbqk5IUUkcfnUyugWUVc2+UNNe3/+GZ7UrlSofnOL4spxFEnMckFwKnpCjOq4a5fVcr2mQxGmiR dKMkiqelTIM8REmIGJ20qmasTq1OPlcKdKrw5RvBi92LlF0pCRwTzAR0oFc2VWmCjl2dxFbANrh+L cYMC/NQA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSkmk-0005lv-Fc; Wed, 14 Oct 2020 17:41:58 +0000 Date: Wed, 14 Oct 2020 18:41:58 +0100 From: Matthew Wilcox To: "Darrick J. Wong" Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 09/14] iomap: Change iomap_write_begin calling convention Message-ID: <20201014174158.GS20115@casper.infradead.org> References: <20201014030357.21898-1-willy@infradead.org> <20201014030357.21898-10-willy@infradead.org> <20201014164744.GK9832@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201014164744.GK9832@magnolia> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 14, 2020 at 09:47:44AM -0700, Darrick J. Wong wrote: > > -static int > > -iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, unsigned flags, > > - struct page **pagep, struct iomap *iomap, struct iomap *srcmap) > > +static ssize_t iomap_write_begin(struct inode *inode, loff_t pos, loff_t len, > > + unsigned flags, struct page **pagep, struct iomap *iomap, > > loff_t len? You've been using size_t (ssize_t?) for length elsewhere, > can't return more than ssize_t, and afaik MAX_RW_COUNT will never go > larger than 2GB so I'm confused about types here...? Yes, you're right. This one should be size_t. > > if (page_ops && page_ops->page_prepare) { > > + if (len > UINT_MAX) > > + len = UINT_MAX; > > I'm not especially familiar with page_prepare (since it's a gfs2 thing); > why do you clamp len to UINT_MAX here? The len parameter of ->page_prepare is an unsigned int. I don't want a 1<<32+1 byte I/O to be seen as a 1 byte I/O. We could upgrade the parameter to size_t from unsigned int?