lkml.org 
[lkml]   [2019]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 26/30] fuse: Add logic to free up a memory range
On Sun, May 19, 2019 at 03:48:05PM +0800, Eric Ren wrote:
> Hi,
>
> @@ -1784,8 +1822,23 @@ static int fuse_iomap_begin(struct inode *inode,
> > loff_t pos, loff_t length,
> > if (pos >= i_size_read(inode))
> > goto iomap_hole;
> >
> > - alloc_dmap = alloc_dax_mapping(fc);
> > - if (!alloc_dmap)
> > + /* Can't do reclaim in fault path yet due to lock ordering.
> > + * Read path takes shared inode lock and that's not
> > sufficient
> > + * for inline range reclaim. Caller needs to drop lock,
> > wait
> > + * and retry.
> > + */
> > + if (flags & IOMAP_FAULT || !(flags & IOMAP_WRITE)) {
> > + alloc_dmap = alloc_dax_mapping(fc);
> > + if (!alloc_dmap)
> > + return -ENOSPC;
> > + } else {
> > + alloc_dmap = alloc_dax_mapping_reclaim(fc, inode);
> >
>
> alloc_dmap could be NULL as follows:
>
> alloc_dax_mapping_reclaim
> -->fuse_dax_reclaim_first_mapping
> -->fuse_dax_reclaim_first_mapping_locked
> --> fuse_dax_interval_tree_iter_first ==> return NULL
> and
>
> IS_ERR(NULL) is false, so we may miss that error case.

Hi Eric,

Good catch. I will fix it next version.

Thanks
Vivek

\
 
 \ /
  Last update: 2019-05-20 15:09    [W:0.124 / U:1.212 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site