RE: [PATCH 2/2] btrfs: Set hole_size to free space in case of contains_pending_extent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Filipe
 
> This was already fixed by Forrest recently. See:
> https://patchwork.kernel.org/patch/5776231/
> 
Thanks for notice, I overlooked the second half of his patch...
Please ignore it.

Thanks
Zhaolei

> > ---
> >  fs/btrfs/volumes.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> > index 5cd0930..0cc9422 100644
> > --- a/fs/btrfs/volumes.c
> > +++ b/fs/btrfs/volumes.c
> > @@ -1194,8 +1194,12 @@ again:
> >                          */
> >                         if (contains_pending_extent(trans, device,
> >                                                     &search_start,
> > -                                                   hole_size))
> > -                               hole_size = 0;
> > +                                                   hole_size)) {
> > +                               if (search_start > key.offset)
> > +                                       hole_size = 0;
> > +                               else
> > +                                       hole_size = key.offset - search_start;
> > +                       }
> >
> >                         if (hole_size > max_hole_size) {
> >                                 max_hole_start = search_start;
> > --
> > 1.8.5.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 
> --
> Filipe David Manana,
> 
> "Reasonable men adapt themselves to the world.
>  Unreasonable men adapt the world to themselves.
>  That's why all progress depends on unreasonable men."


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux