Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20239827rwd; Wed, 28 Jun 2023 22:47:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5n9DmnS0vfVG1le1GEHr5omE5Ejumy/rDdKAy9iLd6vhAfR7HFsVNviuv7M9dXFARxyYOq X-Received: by 2002:aa7:8896:0:b0:673:5d1e:6654 with SMTP id z22-20020aa78896000000b006735d1e6654mr11615796pfe.33.1688017642864; Wed, 28 Jun 2023 22:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688017642; cv=none; d=google.com; s=arc-20160816; b=0YzyD4Uo6BNOY84cR435G+ElEmk3L9ZGWfMCuTLaf2YX8I46A216cbyCQU9eYOpE08 PumQqMqABgR6zlQzAC5kagigNnxbKEEBmqtXUbI1IDSU6nQNhu0W8wH2oDac2f5Jf4Uh Av+9F52d/MwkHIEpL1fSdSt8O3+ldWg/4dq3NOZi3jNnxGmtWCLZY09zw/5VNEY6Y8AF yuPi/sNOhMBQJtFwWOo/EwuLdNQjBMVbBTe1ZCzLZraxU9vfoCo/GKL1PxxyO1yhFYuq aMgh5U7l4sTv7iCdjpfZKVYD5dvvY6bfOLkZiB/u7BmvtK0LvDOwwaLs/BwRoxc7zBW7 mV7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7jJ0/BJRAKh86CGVE8eVjDakBNpW0exbUqMmw1eTFdw=; fh=ARAAWvYvHGNkeW5aBxmZSWKVx31wvNOzDTgH7vuMlr8=; b=pz0lcrQLPjRWlShFyTGwjyLupyGVkaCBMbOxK6rrBwRJt3CmyaVcD/vmz9bWPH1EA/ nfWIko1nZPD+r6H5bKftpTLzap76/KXUHA2uwUr1UmZaOXC6TKWs1FjtrCe8Gqh86cFH 3JQ6AZsEon2uj6gdQP9elvXdZlnF/BGypqi7VOXVammPF+j4DDt7P2EVucmfcyzc1IJQ aOvZgMXoW2U06liQXOVHYsenuVbBIv+IXAqnHtdup2iHZR+QgzJAMYGaF++KB7Xv89Yv GSo8tNsWpZCHw0AdG9By5mDDBZ6Y59wK0/T2mAyun24wNVJ0yBEMGoKD/bny8/+9NBz2 JGJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="RpqQAS/L"; 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 j10-20020a056a00234a00b00666e1259fa4si9769232pfj.141.2023.06.28.22.47.08; Wed, 28 Jun 2023 22:47:22 -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="RpqQAS/L"; 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 S231594AbjF2Fgr (ORCPT + 99 others); Thu, 29 Jun 2023 01:36:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbjF2Fgh (ORCPT ); Thu, 29 Jun 2023 01:36:37 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936C51BF4 for ; Wed, 28 Jun 2023 22:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688016941; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7jJ0/BJRAKh86CGVE8eVjDakBNpW0exbUqMmw1eTFdw=; b=RpqQAS/LCNugO+SYd4PzyAwlAwo2bwWlz54HEcsDYTZlH2pIgxpI+Xr3fp+LaFlnjrRlVb dlYTxnGC3vvKXC+bR5xzf3hjoBnIodWwfZyxIBKQl0jcmi0vRSOFqO6vQeBZ7Gdgi5UW5H UcvybBTIeVj15NEyk7Y/PXtWpwuOFKI= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517-KBgMuK4kPmiHMf6_pPH8AQ-1; Thu, 29 Jun 2023 01:35:40 -0400 X-MC-Unique: KBgMuK4kPmiHMf6_pPH8AQ-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-98e40d91fdfso26733066b.3 for ; Wed, 28 Jun 2023 22:35:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688016939; x=1690608939; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7jJ0/BJRAKh86CGVE8eVjDakBNpW0exbUqMmw1eTFdw=; b=jWeXS1HZu1KJbyzNBDcicidL+sNkLYfw8UgpAfFwBY2p3N7XANxBw5PE0njQJO3ogG XWPJHrDcPeGDFkrO7GRY0zp3k0nlTFdSeoQsWkilCFdU+fiTpVJ2JUS5TBHuSUCwQCt/ kPrKI/xHRglgFKqzH53HbeCxGALe/gC7lG9qMPfJ6fkbhCEq6C2qJxlyfP5bSHEIsJYp S1CUutTssd5j5PkzSdE+YFyv2iVkESni2bLNOGjObSx4TOafKPUXdlq5/HlkiIVIBG6f /H8ruX3f0I7o4+YksRZJBrjK5etGHQol/WYG3UrxyGZYUuOghk4wt4nKpbgAhJZ8EDam v4rQ== X-Gm-Message-State: AC+VfDziBIBXunUPxDvkSWjesSbfx3QqXtvymvxr0LEBJ56vfH+CBLFL WFh8TpwBBFKUcG2i6B1wCmwM7UOAlA+kRpwto+FbS5U+wafojSPno97APRfnZv91rFjC7FigQ// peeRYRJzzrT601xpDVGq8Rhkm X-Received: by 2002:a17:906:9b84:b0:989:5aad:ebce with SMTP id dd4-20020a1709069b8400b009895aadebcemr25508473ejc.13.1688016938992; Wed, 28 Jun 2023 22:35:38 -0700 (PDT) X-Received: by 2002:a17:906:9b84:b0:989:5aad:ebce with SMTP id dd4-20020a1709069b8400b009895aadebcemr25508465ejc.13.1688016938723; Wed, 28 Jun 2023 22:35:38 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id e8-20020a1709062c0800b0098822e05539sm6406904ejh.191.2023.06.28.22.35.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jun 2023 22:35:38 -0700 (PDT) Message-ID: Date: Thu, 29 Jun 2023 07:35:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] fs/vboxsf: Replace kmap() with kmap_local_{page, folio}() To: Sumitra Sharma , Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Ira Weiny , Fabio , Deepak R Varma References: <20230627135115.GA452832@sumitra.com> <20230629043031.GA455425@sumitra.com> Content-Language: en-US, nl From: Hans de Goede In-Reply-To: <20230629043031.GA455425@sumitra.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Hi Sumitra, On 6/29/23 06:30, Sumitra Sharma wrote: > On Tue, Jun 27, 2023 at 06:48:20PM +0100, Matthew Wilcox wrote: >> 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. >> > > Hi Matthew, > > When creating this patch, I read and searched about the loff_t vs size_t. > By mistake, I implemented it in the wrong way. > > Also, I did not test it and just compiled it. I apologise for doing so. > > And for the other points you have put as feedback. I will take some time to understand > it. And would like to work on the changes you suggest. If you work further on this please make sure that you actually test your changes. Submitting untested fs changes is a really bad idea. People don't like it when their data gets corrupted. Note vboxsf can be tested easily by setting up a VirtualBox guest and then using the shared folder features. Note do *not* use the VirtualBox provided guest utils they contain their own out of tree vboxsf implementation and will use that. To avoid this you could e.g. use Fedora inside the guest and install the Fedora packaged vbox guest utils which does not replace the mainline vboxsf. Regards, Hans