Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp18061856rwd; Tue, 27 Jun 2023 11:03:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7UcylDTmYnNGiVJMWCg4qu+QWwmH2apmaztUTEfZYqQZQrASTzB0FnFgkQU/EVhSFXGQip X-Received: by 2002:a05:6a21:3a91:b0:119:69eb:886a with SMTP id zv17-20020a056a213a9100b0011969eb886amr24643294pzb.23.1687888981559; Tue, 27 Jun 2023 11:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687888981; cv=none; d=google.com; s=arc-20160816; b=irE4KNPH2bieWqOQN5omq+Uyis5fDRCY2iT09EkpnNEOo5cRPWo41w5p7fiNSS4f8I 6LeSOLTiyHg1+C1OmOCxgpth/v+/ngJerCkxH4ceDFUxDpQEnV4ol7LsiCOw8v6DwOtJ SIgeP7uC3ufbSZk2VGn9q4VEwSQWIwqt9Iu0ALoNZxvyHM+HVgyWvwNNabELWoFbOBwd tabC62PrZlWMXLwrrr3NpipMMFmKle6Ok+SVEb0I0jGx+J6d8Bctl3ChrwbZfp1YC+Zh xdOiB4prcXSf3uQfvLYthlMQteptMw2Dy9SsgaZtLhCpUd0dpvQysqBS/ACvDP94zblr 7udg== 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=FkjBSg6uoUaP1660acxrdbQw+ZjRrdzj3qfDG7Xdht8=; fh=WWc1HXglz1tDMQHHS0gOmuW+EF0SSvZEvOJa5Z1Qhxg=; b=lbZzg5wMFxfnTIunJELZaKVlwa4eJnikV0dXG7awPDOK/AmOQus+TMe88BBgCFpZm8 QVx+AGdGONoxAMtuDH+wrMSfCE7i1qymWih2odYYtiIgmFG5U9frjrd2L/f56s7RfzON tLNptedoTwst9qRrdmIomlR/LQyFWXvJ2N11Giq++azFrWLDf6QXjRmkl+UhylXkmeA1 pDv1cktH2UoTHYhtqwXP0hSVP8oXuvFonA2lqjKc+wedv2qRIAYEVAEN4NsNi4cNpQUj 9HGkdBtSJcXSMx+rk558fw5f2LVqqo//iq7tNg1hKZMIu+I/27kZTY9g5IVbZTGk7cOx I96A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jJAvpHId; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w29-20020a63161d000000b00557a26e5fefsi6269446pgl.684.2023.06.27.11.02.48; Tue, 27 Jun 2023 11:03:01 -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=@infradead.org header.s=casper.20170209 header.b=jJAvpHId; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231448AbjF0Rs2 (ORCPT + 99 others); Tue, 27 Jun 2023 13:48:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231642AbjF0Rs1 (ORCPT ); Tue, 27 Jun 2023 13:48:27 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FB472D45; Tue, 27 Jun 2023 10:48:22 -0700 (PDT) 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=FkjBSg6uoUaP1660acxrdbQw+ZjRrdzj3qfDG7Xdht8=; b=jJAvpHIdX1oIKrhsbdgIcxAnGx 64Bxk1WkH7XsMFWOI50daUyx6jeuxLAJ+dEF8WUlPWWfOijShufVqVEvUOgkxt5T+eZQB84x1JW8i oHqDgxJVQlfAnRulXAd6GfjutKthoIyX5S7RfUkyl/ve2ocPcJ0r1jwEZ0IIUicgIvxJB1RLWg2rD QcYAZV/BOLqmVicpBlizKiBLHwZFctUEPwWnHFFPVRhGHF3fo8Hy36b6ptVAOelzHc2vut6j3ncXI vjXHUMBwsvqT7i2zdzzXtC9myd6v+baY4KLA3DlTHj9VLoAeJUYXvekbsvHXnekwhjePvdd6Iu23M K1H0r/jA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qECnc-002whb-47; Tue, 27 Jun 2023 17:48:20 +0000 Date: Tue, 27 Jun 2023 18:48:20 +0100 From: Matthew Wilcox To: Sumitra Sharma Cc: Hans de Goede , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny , Fabio , Deepak R Varma Subject: Re: [PATCH] fs/vboxsf: Replace kmap() with kmap_local_{page, folio}() Message-ID: References: <20230627135115.GA452832@sumitra.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230627135115.GA452832@sumitra.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Tue, Jun 27, 2023 at 06:51:15AM -0700, Sumitra Sharma wrote: > +++ b/fs/vboxsf/file.c > @@ -234,7 +234,7 @@ static int vboxsf_read_folio(struct file *file, struct folio *folio) > u8 *buf; > int err; > > - buf = kmap(page); > + buf = kmap_local_folio(folio, off); Did you test this? 'off' is the offset in the _file_. Whereas kmap_local_folio() takes the offset within the _folio_. They have different types (loff_t vs size_t) to warn you that they're different things.