[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cedbd75d-4a0f-74fb-3a6e-547862cc431e@redhat.com>
Date: Tue, 27 Jun 2023 20:04:58 +0200
From: Hans de Goede <hdegoede@...hat.com>
To: Matthew Wilcox <willy@...radead.org>,
Sumitra Sharma <sumitraartsy@...il.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Ira Weiny <ira.weiny@...el.com>,
Fabio <fmdefrancesco@...il.com>, Deepak R Varma <drv@...lo.com>
Subject: Re: [PATCH] fs/vboxsf: Replace kmap() with kmap_local_{page, folio}()
Hi Matthew,
On 6/27/23 19:48, 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.
Ah yes you are completely right, off is the offset in the file
and buf should point to the *start* of a mapping of the page.
Regards,
Hans
Powered by blists - more mailing lists