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: Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH] ext4: move_extent improve bh vanishing success factor
Date: Sat, 18 Oct 2014 12:29:44 +0400	[thread overview]
Message-ID: <1413620984-7736-1-git-send-email-dmonakhov@openvz.org> (raw)

Xiaoguang Wang has reported sporadic EBUSY failures of ext4/302
Unfortunetly there is nothing we can do if some other task holds
BH's refenrence. So we must return EBUSY in this case. From other
point we can decrease false positive report raito. One of such
cases is filesystem under ENOSPC conditions. We should try to kick
the journal regardless to number of free blocks.

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

diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 9f2311b..c2b2b02 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -407,8 +407,10 @@ stop_journal:
 	ext4_journal_stop(handle);
 	/* Buffer was busy because probably is pinned to journal transaction,
 	 * force transaction commit may help to free it. */
-	if (*err == -EBUSY && ext4_should_retry_alloc(orig_inode->i_sb,
-						      &retries))
+	if (*err == -EBUSY &&
+	    (retries++ < 4 && EXT4_SB(orig_inode->i_sb)->s_journal &&
+	     jbd2_journal_force_commit_nested(
+		     EXT4_SB(orig_inode->i_sb)->s_journal)))
 		goto again;
 	return replaced_count;
 
-- 
1.7.1


             reply	other threads:[~2014-10-18  8:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18  8:29 Dmitry Monakhov [this message]
2014-11-05 16:53 ` [PATCH] ext4: move_extent improve bh vanishing success factor Theodore Ts'o

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=1413620984-7736-1-git-send-email-dmonakhov@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=linux-ext4@vger.kernel.org \
    /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).