Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31942509rwd; Fri, 7 Jul 2023 06:40:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlFR5obnjE0no5opV3YAO41z2nmCY/+6il/n6HwW1YYX5l78hvCRiz/HB6rNkWR+Kq/Rxptj X-Received: by 2002:a92:d9d1:0:b0:345:c8cd:2245 with SMTP id n17-20020a92d9d1000000b00345c8cd2245mr4777684ilq.20.1688737218298; Fri, 07 Jul 2023 06:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688737218; cv=none; d=google.com; s=arc-20160816; b=uq1TaM481v8d25NYMD0+j1MWRV8httUV8ilugnpA8Ca8emIklnU5dy3yUPxXOE/niA DXQL+Dq67xw/liNmmazIvFFFM2Y6eJ0SyJQ9WAM3P0eY9CTLKexoYtToW40itHIgDhTs pmflbY/pi4sztux8wmIxM0cWEQgK7TeyoCTcRGDJr5xQsAelifCrkg14q344e+Go3Utl FBn+wPAqJzAqmFocGqBAg5T01riJ3OmcD6LUev9pvukvsVF8SSU8B7boGR5GysENGv5I e1gDe74y4q6zZDbJS/rnDTHqE1iKL3y2jRCNY67P6hq0UAmejLAlo0r/RT41Mxvsyez0 Mx7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/scmW41nRLEVCcvmVFRaHD3MznC8NV7fH9vmMT3xxpU=; fh=JFh06cseEWykJOyW7rqDQuQTmKucUOCKf0clpziiyVs=; b=Yckpk2mTztPLg74QZVyWnXq2eaaPC7hxLgDq1Cm3v+t0RolGnSOQ9bNIUyJiNwJBwU ahln2A26GlK5CtvE3oAPKCsd0lZrvfHdydsV/6PCeJYVWofFvnlEC38XuF7Dqs65MxpK viNohlI5BT5oIQlYwY9rTlcSsmHa5BVhIAJOiURex3ZiSlSbkLds5jhw87x1xcHgsDK5 WHWJe+eOGjR9+b5SU6ZGg5LjsKLJY2HFEWEVPGgKFJ80yJTNPwIrlNSN64VXgtbqsmuH KFR8+5P9a1AO+R46heU33r0nmVfZZFjfsFzdBQi8TfMmbo9NPfku4l0SRgvTZsjPeBp5 K1Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XKz+z5z+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z17-20020a634c11000000b0055b52bc1cabsi3825611pga.196.2023.07.07.06.40.05; Fri, 07 Jul 2023 06:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=XKz+z5z+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231627AbjGGNQf (ORCPT + 99 others); Fri, 7 Jul 2023 09:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229695AbjGGNQd (ORCPT ); Fri, 7 Jul 2023 09:16:33 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 396BE1FE9 for ; Fri, 7 Jul 2023 06:15:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688735750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/scmW41nRLEVCcvmVFRaHD3MznC8NV7fH9vmMT3xxpU=; b=XKz+z5z+XaIBEKxFucvEi7DBUwmuvpqt4f3Bd/5X/j5dqZc23qSfkFJX9hDeC6wk67KOlQ EaELiesjnetegZnBmi7O7GOGJpMVkggoK46SBEWk9oXXpCOD5RtFOWal5DNRh1mn7v7PIi N5oJxzHfj4YA2JHNYOPvr5RoIkxrhCY= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-70-jS5McAOKOuOe4W9Vjskz3g-1; Fri, 07 Jul 2023 09:15:49 -0400 X-MC-Unique: jS5McAOKOuOe4W9Vjskz3g-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-76716078e78so38626685a.1 for ; Fri, 07 Jul 2023 06:15:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688735749; x=1689340549; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/scmW41nRLEVCcvmVFRaHD3MznC8NV7fH9vmMT3xxpU=; b=VI9pc/PVmSSyoMVm+itA3ZxEp2mSMfYthlrgZRcnHSYCOdwltPeqx9DtVqCEZM7jCm DRo4xMOSGsrmajJGDXQ0n4njuIfIfFAxjlofhJ6OLCLKFqicAtvN2elu1tvecDU9wxg3 WLl1YKs0AEqeS1Qd4BIJFJxP88OlvTezGluX21azRVfZchSsnD7h7uGFka8NxkBqjFuF +4/18BK1+MAsXXWRDJ8drKNPHRKalw8vcCMbTn9kVRgPNMgaOfd5eE0em1QBbwxAmMg2 9vtofEC2CO+5aMxO+jgvx7qiFo8JO4w3oT0Sl2a1NiapQXph2eoAuLo4Myzc2C1Rc/jK W4Hg== X-Gm-Message-State: ABy/qLYAKp9LpA1fp0DRRZ15smzmGuzJWM9MKY7cFwXGyNPA2flNTmu7 wE+KVnWVtHdGj7tYzaRzDGhOYZJSfMRJUXhJGNuALLtHaRXocKGmcWYS6EVFn9LRyyewildWFxm 9ivUFT4LzkqliwL96hbj7ULPQ X-Received: by 2002:a05:620a:1908:b0:765:a957:f526 with SMTP id bj8-20020a05620a190800b00765a957f526mr5626647qkb.3.1688735748797; Fri, 07 Jul 2023 06:15:48 -0700 (PDT) X-Received: by 2002:a05:620a:1908:b0:765:a957:f526 with SMTP id bj8-20020a05620a190800b00765a957f526mr5626622qkb.3.1688735748545; Fri, 07 Jul 2023 06:15:48 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id c11-20020ae9e20b000000b0075cebaa1540sm1797911qkc.58.2023.07.07.06.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 06:15:48 -0700 (PDT) Date: Fri, 7 Jul 2023 09:15:44 -0400 From: Peter Xu To: Axel Rasmussen Cc: Alexander Viro , Andrew Morton , Brian Geffon , Christian Brauner , David Hildenbrand , Gaosheng Cui , Huang Ying , Hugh Dickins , James Houghton , "Jan Alexander Steffens (heftig)" , Jiaqi Yan , Jonathan Corbet , Kefeng Wang , "Liam R. Howlett" , Miaohe Lin , Mike Kravetz , "Mike Rapoport (IBM)" , Muchun Song , Nadav Amit , Naoya Horiguchi , Ryan Roberts , Shuah Khan , Suleiman Souhlal , Suren Baghdasaryan , "T.J. Alumbaugh" , Yu Zhao , ZhangPeng , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH v3 3/8] mm: userfaultfd: extract file size check out into a helper Message-ID: References: <20230706225037.1164380-1-axelrasmussen@google.com> <20230706225037.1164380-4-axelrasmussen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230706225037.1164380-4-axelrasmussen@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 06, 2023 at 03:50:31PM -0700, Axel Rasmussen wrote: > This code is already duplicated twice, and UFFDIO_POISON will do the > same check a third time. So, it's worth extracting into a helper to save > repetitive lines of code. > > Signed-off-by: Axel Rasmussen Reviewed-by: Peter Xu -- Peter Xu