Received: by 10.192.165.148 with SMTP id m20csp2951072imm; Mon, 7 May 2018 04:12:43 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpEsQ6KzKtc+KFajS9jyjM9TX/n0L6gHcy2WPIji41f/nVp90/5NoW1ArEmwQ5wbBzSYTlS X-Received: by 2002:a63:ad03:: with SMTP id g3-v6mr29650390pgf.188.1525691563120; Mon, 07 May 2018 04:12:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525691563; cv=none; d=google.com; s=arc-20160816; b=BphJ1HgSpKuIOYU4qF0zs8Pf5/KLzwkWgQglTICr1fTO5WOATo0AKKabOT3o/ZEhMM 13PmZMkmqoZroCLErX3U2mnqev//c1/marYwpE/OiR3+xzHIcNylaq8Sue4xreDxLaep 0+Jnz1MFk16TSYMbL3nF2+TJhtFuCKG9ShqoyhKrF4FkecC1pYc/oktWiJoKaazqlMvz Ay4TEZyDvc38i5qTknFbkQl//n4pkOP1mcYS93pXBjZFXG93hspaWFAhpjvM9BEg30M1 kie3qLhsz/k/mcNNjIfy3KU88IyXMO9Ky2GarFhqkZPo0xhTjcIMLxtaYAqqoYH4usr9 QY7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=PijkAVy5+p3nLea8ntLy9L1bm1gb6wuPZh7hcFkx+kk=; b=G43vHUvAz3jSTjhoFn/zy0BV3uERR8gVhLNWFXcZezJiEbgY5xu1WUvxQOLQa9PLcZ GigC3Gm09Py0j6jChTYuwDcqwSzHNX3WIDz2XNYygv/CbRBTaL/vg9ZWoD3tLpIBR1Ra 9Tr/ISu3I+RQNgIfliMWj9+xpIHbAFQXP0TAr3mBr9Qsh6qXy4Qsu5TnXWY249q7GG1O baeO6TU+YhrvXY7k2bCpxIDSc7c2dA8QeDbA2LrIzlMy2nEo5e4g0cuOKhq4y9eacJSY LlkJP3OUuw2OnIZkusFnOfTEnQ2Z6afn+WHD0X2o89uQUNbHvzRA14q/OZHWeszApRY/ sr3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=JW0zBY8w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u4si21888238pfb.42.2018.05.07.04.12.28; Mon, 07 May 2018 04:12:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=JW0zBY8w; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751993AbeEGLLr (ORCPT + 99 others); Mon, 7 May 2018 07:11:47 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47534 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751794AbeEGLLo (ORCPT ); Mon, 7 May 2018 07:11:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PijkAVy5+p3nLea8ntLy9L1bm1gb6wuPZh7hcFkx+kk=; b=JW0zBY8wvGFiRfL7l9lOQqAMf tjtt/jkq/mfrzmboJOtWDWkP9KU4RRCsuNLLo/KjBGv2cNSW1b2bHebC9l8nFaeLMYQBE/EVCuMp6 tx28BPuiwHvMFaPMB5wmUWVvR2qZyO/f2N83OAayG7tcL5h4hhTy6/uwgowBcTw6t8/ePQhA9LMie nmEJMwHSI2ufOUzQoBx2DSzd2xiB688kGe2VzKc4w7zTcsxmZNaMhPAkyRUBiB2Xyw4QqZUp/7wzr e4Ax0O9Fy/J7MTqSUZ3+/ovitXD2TBDgmZjxnMWcO/Ky20vqrinkNtY4HnymPcL2tK4q7uNkmaCXJ gCBTIjgXg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fFe3S-0007jb-K5; Mon, 07 May 2018 11:11:42 +0000 Date: Mon, 7 May 2018 04:11:42 -0700 From: Matthew Wilcox To: Miklos Szeredi Cc: Al Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Amir Goldstein Subject: Re: [PATCH 1/3] vfs: dedpue: return s64 Message-ID: <20180507111142.GA18116@bombadil.infradead.org> References: <20180507082108.28186-1-mszeredi@redhat.com> <20180507082108.28186-2-mszeredi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180507082108.28186-2-mszeredi@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 07, 2018 at 10:21:06AM +0200, Miklos Szeredi wrote: > f_op->dedupe_file_range() gets a u64 length to dedup and returns an ssize_t > actual length deduped. This breaks badly on 32bit archs since the returned > length will be truncated and possibly overflow into the sign bit (xfs and > ocfs2 are affected, btrfs limits actual length to 16MiB). > > Returning s64 should be good, since clone_verify_area() makes sure that the > supplied length doesn't overflow. Why s64 rather than loff_t? Particularly since the next patch turns the paramters into loff_t.