Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1540091pxy; Fri, 23 Apr 2021 10:23:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2L35Ds8e6sVzrNLEnCzBgRAg1fl04kN/zAF21Uih7etjNDwgPjqap76LwuJnKWjkJ1HuZ X-Received: by 2002:a63:5222:: with SMTP id g34mr4921584pgb.309.1619198633690; Fri, 23 Apr 2021 10:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619198633; cv=none; d=google.com; s=arc-20160816; b=RZ/oqRWl7yBVr/AoCTmqjJJanqfmsLQ/Nej+r5Lkx2Ls2Gr98o026nBuVi1eLj/yIC W1em1EwMuxSAvJaAoo5adtHsvpavvnSzDJl+k/h32FvXYh7EX5h7HeIPbA/LMZv8G0kI uc2j6dxLNmOF0aCK8nTa5BdGPJH0LpyqXxOVzIgrAZ08QxZhj5p6nI+81VnJse/JwjjX wQuQNDY0C+q0MGSgwIRirovrSPzmZ5WOAeRGE8U0bDGM1U6yv0MA4dvQ02t51xSYMLid AbySRFtrpNXCubOua1i9tNA3b7rcnExofu6DOuAHlVW2SVWTcjsPrPwjAVO3RfQUtik7 ukhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=ab9jbz5NwGYvcWYzomBqApXdriLZ2AGZKnvLPb80Lgs=; b=wNMkbiU9W4pPHvzX2Hib1Z6NIywWrG+3uvXmz89GuM8D2m/1K7szliDu34/OG1+YXs QHMmIZfGRnzlfXxpFxAFsB1mLs0Nwo7N9gmLBmWnz7fHkcD6rQPBLnIV9ej8u2DVXbMq S0Vznmvb5ADfME5yJ4tnvIoIOdZ0wqj/mAQCa+Ua6jViQ1b/yagwgLsK2sVyv8V4bgh/ NwxP+Y5NOZ9Rv+fEhcHCOFEHs0kgjCl9/cl8nRqbaePcrBrrmBIo/KZm+IgIy038gqb5 Fz2zbm0gvQ8e5apQqzu7TRJHS4TuYqC2Cbb6EruZOMRXZki3QddNF4bIFwanoqEUcC8N GSqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=M88KIhhr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si9207603pfv.33.2021.04.23.10.23.40; Fri, 23 Apr 2021 10:23:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=M88KIhhr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231767AbhDWRXp (ORCPT + 99 others); Fri, 23 Apr 2021 13:23:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229691AbhDWRXo (ORCPT ); Fri, 23 Apr 2021 13:23:44 -0400 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B555C061574 for ; Fri, 23 Apr 2021 10:23:07 -0700 (PDT) Received: by mail-qt1-x833.google.com with SMTP id 18so23500337qtz.6 for ; Fri, 23 Apr 2021 10:23:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=ab9jbz5NwGYvcWYzomBqApXdriLZ2AGZKnvLPb80Lgs=; b=M88KIhhroqFdlNzBy1544DT7e2YEw9mbFHH30yeXQKwC6vbDM49367m9NJ573gXn6b fpGXo25Pw/E/tc2chnR7vMVy/f9qg4dnq2G7z/dF5NMXj2Olh2noyPDUZshmLsuJopno 5cEWSCvSwG4hB5yoW+uHA5KqvLk4AfMXksRvqh408+FGsItAKv5soCRXegR7z+KPWgAK unaifcX3LCr+yWUoKVpWklJ8tEnm7w3FNNuywP9KYILwfAFvi9WH4fOSiS3UoSBjqieX 36JdZug4uP0YfUDRvdBAQWDzpPzRij6QBdNnMdOifYTRMKeSrJ1GxUYGZ+7q2E4fND9b rDwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=ab9jbz5NwGYvcWYzomBqApXdriLZ2AGZKnvLPb80Lgs=; b=Ln8ENLsQ+L5zf5OH/CPNRfdXlxj1QYZok/pK1eaYLsEbWcQWQ70oUiq407yDhlfC0d Qzxa7DE4qlkCamQlJ9vl/nRDgEzsXuujb+F4zRwsyXCPQgwTrULqtm5LMrPn49muxgZI 8Sp0+0CC6zc2aRKoV4qKph/73cib08PxWlwNB77JZIvhrbrUCjXHMfsY2jmBmB01YvVR 0/J3S0KBsDG2lJvGCKs4QCTHVrBzpAhLCciLWLgYTU0JVc+HLeG8ZxknI7wVY+XwKJ8i Cof0WNopFIxGErqIrvMJTquLvM6Lz58SQ8SjjqkBc+lIlmoIeTvm0hJlJ2cYpgVk0vvh rzOw== X-Gm-Message-State: AOAM531mS4yoao75zUgb8C35SAgZFT8ggEs9sNhIOPurMSbxWmio6kuw JvHN/H0JKsQiMO1ixQliCqTaRQ== X-Received: by 2002:ac8:6b49:: with SMTP id x9mr4808960qts.193.1619198586081; Fri, 23 Apr 2021 10:23:06 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id x85sm4852092qkb.44.2021.04.23.10.23.04 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Fri, 23 Apr 2021 10:23:05 -0700 (PDT) Date: Fri, 23 Apr 2021 10:22:51 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Andrew Morton cc: Hugh Dickins , Matthew Wilcox , William Kucharski , Christoph Hellwig , Jan Kara , Dave Chinner , Johannes Weiner , "Kirill A. Shutemov" , Yang Shi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2 2/2] mm/filemap: fix mapping_seek_hole_data on THP & 32-bit In-Reply-To: <20210422160410.e9014b38b843d7a6ec06a9bb@linux-foundation.org> Message-ID: References: <20210422011631.GL3596236@casper.infradead.org> <20210422160410.e9014b38b843d7a6ec06a9bb@linux-foundation.org> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Apr 2021, Andrew Morton wrote: > On Thu, 22 Apr 2021 13:48:57 -0700 (PDT) Hugh Dickins wrote: > > > Andrew, I'd have just sent a -fix.patch to remove the unnecessary u64s, > > but need to reword the commit message: so please replace yesterday's > > mm-filemap-fix-mapping_seek_hole_data-on-thp-32-bit.patch > > by this one - thanks. > > Actually, I routinely update the base patch's changelog when queueing a -fix. And thank you for that, but if there's time, I think we would still prefer the final commit message to include corrections where Matthew enlightened me (that "sign-extension" claim came from my confusion): -u64 casts added to stop unfortunate sign-extension when shifting (and -let's use shifts throughout, rather than mixed with * and /). - -Use round_up() when advancing pos, to stop assuming that pos was already -THP-aligned when advancing it by THP-size. (But I believe this use of -round_up() assumes that any THP must be THP-aligned: true while tmpfs -enforces that alignment, and is the only fs with FS_THP_SUPPORT; but might -need to be generalized in the future? If I try to generalize it right -now, I'm sure to get it wrong!) +u64 cast to stop losing bits when converting unsigned long to loff_t +(and let's use shifts throughout, rather than mixed with * and /). + +Use round_up() when advancing pos, to stop assuming that pos was +already THP-aligned when advancing it by THP-size. (This use of +round_up() assumes that any THP has THP-aligned index: true at present +and true going forward, but could be recoded to avoid the assumption.) Thanks, Hugh