From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Theodore Tso <tytso@mit.edu>,
Parag Warudkar <parag.lkml@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-ext4@vger.kernel.org, bugzilla-daemon@bugzilla.kernel.org
Subject: Re: [Bug 14354] Re: ext4 increased intolerance to unclean shutdown?
Date: Tue, 27 Oct 2009 15:45:34 +0530 [thread overview]
Message-ID: <20091027101534.GA27584@skywalker.linux.vnet.ibm.com> (raw)
In-Reply-To: <20091016091558.GA10184@mit.edu>
Can you try this patch ?
commit a8836b1d6f92273e001012c7705ae8f4c3d5fb65
Author: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Date: Tue Oct 27 15:36:38 2009 +0530
ext4: discard preallocation during truncate
We need to make sure when we drop and reacquire the inode's
i_data_sem we discard the inode preallocation. Otherwise we
could have blocks marked as free in bitmap but still belonging
to prealloc space.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 5c5bc5d..a1ef1c3 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -209,6 +209,12 @@ static int try_to_extend_transaction(handle_t *handle, struct inode *inode)
up_write(&EXT4_I(inode)->i_data_sem);
ret = ext4_journal_restart(handle, blocks_for_truncate(inode));
down_write(&EXT4_I(inode)->i_data_sem);
+ /*
+ * We have dropped i_data_sem. So somebody else could have done
+ * block allocation. So discard the prealloc space created as a
+ * part of block allocation
+ */
+ ext4_discard_preallocations(inode);
return ret;
}
next prev parent reply other threads:[~2009-10-27 10:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <f7848160910152128h96237b7ga103915082d6412b@mail.gmail.com>
2009-10-16 9:15 ` [Bug 14354] Re: ext4 increased intolerance to unclean shutdown? Theodore Tso
2009-10-16 13:06 ` Theodore Tso
2009-10-16 19:16 ` Ric Wheeler
2009-10-25 6:22 ` Pavel Machek
2009-10-26 13:49 ` Ric Wheeler
2009-10-16 22:24 ` Parag Warudkar
2009-10-26 15:42 ` Linus Torvalds
2009-10-27 10:15 ` Aneesh Kumar K.V [this message]
2009-10-29 20:10 ` Mingming
2009-10-29 21:25 ` Parag Warudkar
2009-10-29 21:38 ` Eric Sandeen
2009-10-30 8:16 ` Theodore Tso
2009-10-30 13:54 ` Eric Sandeen
2009-10-30 19:56 ` Andreas Dilger
2009-10-31 9:15 ` Theodore Tso
2009-10-31 15:24 ` Aneesh Kumar K.V
2009-10-29 21:42 ` Theodore Tso
2009-10-29 21:52 ` Parag Warudkar
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=20091027101534.GA27584@skywalker.linux.vnet.ibm.com \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=parag.lkml@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).