From: Lukas Czerner <lczerner@redhat.com>
To: Jiaying Zhang <jiayingz@google.com>
Cc: Lukas Czerner <lczerner@redhat.com>, Theodore Tso <tytso@mit.edu>,
ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] Free allocated and pre-allocated blocks when check_eofblocks_fl fails
Date: Wed, 22 Jun 2011 10:28:23 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.1106221027090.4118@dhcp-27-109.brq.redhat.com> (raw)
In-Reply-To: <BANLkTin00aSpUXVAjB6DWajB6Sf079y11MMh_X7WcO8JJz9TBQ@mail.gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1294 bytes --]
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@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > >
> >
> > Thanks!
> > -Lukas
>
prev parent reply other threads:[~2011-06-22 8:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-21 3:28 [PATCH] Free allocated and pre-allocated blocks when check_eofblocks_fl fails Jiaying Zhang
2011-06-21 15:24 ` Lukas Czerner
2011-06-21 19:40 ` Jiaying Zhang
2011-06-22 8:28 ` Lukas Czerner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.00.1106221027090.4118@dhcp-27-109.brq.redhat.com \
--to=lczerner@redhat.com \
--cc=jiayingz@google.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox