Re: [PATCH] Free allocated and pre-allocated blocks when check_eofblocks_fl fails

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

 



On Tue, 21 Jun 2011, Jiaying Zhang wrote:

> > >
> > > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> > > index 5199bac..8cf6ec9 100644
> > > --- a/fs/ext4/extents.c
> > > +++ b/fs/ext4/extents.c
> > > @@ -3596,10 +3596,8 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
> > >       }
> > >
> > >       err = check_eofblocks_fl(handle, inode, map->m_lblk, path, ar.len);
> > > -     if (err)
> > > -             goto out2;
> > > -
> > > -     err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
> > > +     if (!err)
> > > +             err = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
> > >       if (err) {
> >
> > why not to use:
> >        else {
> >
> It is not the same. If there is an error from ext4_ext_insert_extent(),
> we also want to free allocated blocks.

Oh, of course I have missed the assignment, sorry.

Thanks!
-Lukas

> 
> Jiaying
> >
> > >               /* free data blocks we just allocated */
> > >               /* not a good idea to call discard here directly,
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> > > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > >
> >
> > Thanks!
> > -Lukas
> 

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux