linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 6/7] ext4: punch hole should be restarted after transaction restart
Date: Fri, 28 Oct 2011 21:00:09 +0400	[thread overview]
Message-ID: <1319821210-7374-7-git-send-email-dmonakhov@openvz.org> (raw)
In-Reply-To: <1319821210-7374-1-git-send-email-dmonakhov@openvz.org>

ext4_ext_rm_leaf() may return -EAGAIN due to transaction restart,
repeat attempt in that case.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext4/extents.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 5cce39a..a77cde2 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3795,7 +3795,7 @@ static int get_implied_cluster_alloc(struct super_block *sb,
 int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
 			struct ext4_map_blocks *map, int flags)
 {
-	struct ext4_ext_path *path = NULL;
+	struct ext4_ext_path *path;
 	struct ext4_extent newex, *ex, *ex2;
 	struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
 	ext4_fsblk_t newblock = 0;
@@ -3811,6 +3811,9 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
 		  map->m_lblk, map->m_len, inode->i_ino);
 	trace_ext4_ext_map_blocks_enter(inode, map->m_lblk, map->m_len, flags);
 
+again:
+	path = NULL;
+
 	/* check in cache */
 	if (!(flags & EXT4_GET_BLOCKS_PUNCH_OUT_EXT) &&
 		ext4_ext_in_cache(inode, map->m_lblk, &newex)) {
@@ -3904,6 +3907,8 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
 			}
 			ret = ext4_ext_handle_punched_extent(handle, inode,
 							map, path);
+			if (ret == -EAGAIN)
+				goto again;
 			return ret;
 		}
 	}
-- 
1.7.1


  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 ` [PATCH 4/7] ext4: punch_hole fix extent conversion Dmitry Monakhov
2011-10-28 17:00 ` [PATCH 5/7] ext4: Update inode's transaction id after punch_hole Dmitry Monakhov
2011-10-28 17:00 ` Dmitry Monakhov [this message]
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-7-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).