From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-ext4@vger.kernel.org
Cc: achender@linux.vnet.ibm.com, tytso@mit.edu,
Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 4/7] ext4: punch_hole fix extent conversion
Date: Fri, 28 Oct 2011 21:00:07 +0400 [thread overview]
Message-ID: <1319821210-7374-5-git-send-email-dmonakhov@openvz.org> (raw)
In-Reply-To: <1319821210-7374-1-git-send-email-dmonakhov@openvz.org>
Currently punched extent converted to uninitialized incorrectly,
in fact i'm not shure whenever we actually need that conversion,
but if we do that let's do it right.
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
fs/ext4/extents.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 02dfe38..0365173 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3275,8 +3275,15 @@ ext4_ext_handle_punched_extent(handle_t *handle, struct inode *inode,
ex = path[path->p_depth].p_ext;
}
- ext4_ext_mark_uninitialized(ex);
+ err = ext4_ext_get_access(handle, inode, path + path->p_depth);
+ if (err)
+ goto out;
ext4_ext_invalidate_cache(inode);
+ ext4_ext_mark_uninitialized(ex);
+ err = ext4_ext_dirty(handle, inode, path + path->p_depth);
+ if (err)
+ goto out;
+
err = ext4_ext_rm_leaf(handle, inode, path, &partial_cluster,
map->m_lblk, map->m_lblk + punched_out);
if (!err && ext4_ext_try_shrink(handle, inode))
--
1.7.1
next prev parent reply other threads:[~2011-10-28 17:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-28 17:00 [PATCH 0/7] ext4: cleanups and regression fixes for grow/shrink logic V3 Dmitry Monakhov
2011-10-28 17:00 ` [PATCH 1/7] ext4: Restore old EOFBLOCKS flag state after error Dmitry Monakhov
2011-10-28 17:00 ` [PATCH 2/7] ext4: move inode indepth shrink logic to didicated function Dmitry Monakhov
2011-10-28 17:00 ` [PATCH 3/7] ext4: Move punch hole " Dmitry Monakhov
2011-10-28 17:00 ` Dmitry Monakhov [this message]
2011-10-28 17:00 ` [PATCH 5/7] ext4: Update inode's transaction id after punch_hole Dmitry Monakhov
2011-10-28 17:00 ` [PATCH 6/7] ext4: punch hole should be restarted after transaction restart Dmitry Monakhov
2011-10-28 17:00 ` [PATCH 7/7] ext4: update EOFBLOCK flags after punch hole Dmitry Monakhov
2011-11-02 23:12 ` [PATCH 0/7] ext4: cleanups and regression fixes for grow/shrink logic V3 Allison Henderson
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=1319821210-7374-5-git-send-email-dmonakhov@openvz.org \
--to=dmonakhov@openvz.org \
--cc=achender@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).