[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ac7728a0-c184-214a-70a9-ae219db72331@cloud.ionos.com>
Date: Mon, 27 Apr 2020 10:18:30 +0200
From: Guoqing Jiang <guoqing.jiang@...ud.ionos.com>
To: Dave Chinner <david@...morbit.com>,
Matthew Wilcox <willy@...radead.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
hch@...radead.org, Mike Marshall <hubcap@...ibond.com>,
Martin Brandenburg <martin@...ibond.com>,
devel@...ts.orangefs.org
Subject: Re: [RFC PATCH 8/9] orangefs: use set/clear_fs_page_private
Hi Mattew and Dave,
On 4/27/20 4:27 AM, Dave Chinner wrote:
> On Sun, Apr 26, 2020 at 05:12:34PM -0700, Matthew Wilcox wrote:
>> On Mon, Apr 27, 2020 at 08:24:55AM +1000, Dave Chinner wrote:
>>>> @@ -460,17 +456,13 @@ static void orangefs_invalidatepage(struct page *page,
>>>>
>>>> if (offset == 0 && length == PAGE_SIZE) {
>>>> kfree((struct orangefs_write_range *)page_private(page));
>>>> - set_page_private(page, 0);
>>>> - ClearPagePrivate(page);
>>>> - put_page(page);
>>>> + clear_fs_page_private(page);
>>> Ditto:
>>> wr = clear_fs_page_private(page);
>>> kfree(wr);
>> You don't want to be as succinct as the btrfs change you suggested?
>>
>> kfree(clear_fs_page_private(page));
> That could be done, yes. I was really just trying to point out the
> use after free that was occurring here rather than write compact
> code...
Really appreciate for your review, thanks.
Best Regards,
Guoqing
Powered by blists - more mailing lists