lkml.org 
[lkml]   [2020]   [Apr]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 8/9] orangefs: use set/clear_fs_page_private
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...

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com

\
 
 \ /
  Last update: 2020-04-27 04:28    [W:0.152 / U:11.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site