From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F274EB64D9 for ; Thu, 29 Jun 2023 05:37:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231653AbjF2Fgu (ORCPT ); Thu, 29 Jun 2023 01:36:50 -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-Google-Smtp-Source: ACHHUZ7UBm117Rb8IHSHnFBk3XTWG+HCAp94vJ2O0EbxEUWZzKT3A0GUFAk/Q9ClC/O4h5cGnJZn5g== 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 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