public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@MIT.EDU>
To: linux-ext4@vger.kernel.org
Cc: Mingming Cao <cmm@us.ibm.com>,
	Takashi Sato <t-sato@yk.jp.nec.com>,
	Akira Fujita <a-fujita@rs.jp.nec.com>
Subject: ext4-online-defrag-free-space-fragmentation.patch uses do_fsync()
Date: Wed, 23 Jan 2008 08:55:17 -0500	[thread overview]
Message-ID: <E1JHg4T-0007lQ-8f@closure.thunk.org> (raw)


I was trying to build ext4 as a module, and ran into problems because
the online defrag patch is calling do_fsync() which is *not* an exported
symbol, and so can not be called from a module.

Looking at what the routine is doing, there's no reason to call
do_fsync(), and in fact depending on the journaling mode in use, it may
not force a journal commit, which seems to be the goal of the code.

Hence, I plan to merge the following fix into the the
defrag-free-space-fragmentation patch, unless there are any objections
from Takashi-San or Akira-San.

Regards,

						- Ted

diff --git a/fs/ext4/defrag.c b/fs/ext4/defrag.c
index 4ef3dc0..19d2cfd 100644
--- a/fs/ext4/defrag.c
+++ b/fs/ext4/defrag.c
@@ -632,8 +632,9 @@ static int ext4_ext_defrag_victim(struct file *target_filp,
 		}
 
 		/* Sync journal blocks before reservation */
-		if (do_fsync(target_filp, 0)) {
-			printk(KERN_ERR "defrag: failed do_fsync\n");
+		ret = ext4_force_commit(sb);
+		if (ret) {
+			printk(KERN_ERR "defrag: failed do_fsync (%d)\n", ret);
 			goto ERR;
 		}
 	}

             reply	other threads:[~2008-01-23 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23 13:55 Theodore Ts'o [this message]
2008-01-23 14:10 ` ext4-online-defrag-free-space-fragmentation.patch uses do_fsync() Dave Kleikamp
2008-01-23 14:16   ` Theodore Tso
2008-01-24  3:00 ` Takashi Sato

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=E1JHg4T-0007lQ-8f@closure.thunk.org \
    --to=tytso@mit.edu \
    --cc=a-fujita@rs.jp.nec.com \
    --cc=cmm@us.ibm.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=t-sato@yk.jp.nec.com \
    /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