]> git.neil.brown.name Git - LaFS.git/commitdiff
Disable cleaner earlier at unmount.
authorNeilBrown <neilb@suse.de>
Mon, 21 Jun 2010 00:23:01 +0000 (10:23 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 21 Jun 2010 00:29:33 +0000 (10:29 +1000)
We need to disable the cleaner a little earlier or it can run after we
have waited for it to finish.
So create a new flag.

Signed-off-by: NeilBrown <neilb@suse.de>
clean.c
state.h
super.c

diff --git a/clean.c b/clean.c
index 7707a2ef8ba042edae4ecf8cb71b9a52f975e66e..103774f1036ca675a7bc7b2796e2584b84d3dbb7 100644 (file)
--- a/clean.c
+++ b/clean.c
@@ -531,7 +531,7 @@ static unsigned long do_clean(struct fs *fs)
         *
         */
        if (!fs->cleaner.active &&
-           !test_bit(FinalCheckpoint, &fs->fsstate)) {
+           !test_bit(CleanerDisabled, &fs->fsstate)) {
                /* choose to clean when the fraction of all space that is clean
                 * is below the faction of free space that is not clean.
                 * i.e. if T is total space, C is clean space, F is free space,
diff --git a/state.h b/state.h
index 4fa7aed95e9331ca00f241f101052a33ab7fa09e..ff5ee267dd4da7de4f08ffe8b56f86a637cbc6eb 100644 (file)
--- a/state.h
+++ b/state.h
@@ -87,6 +87,7 @@ struct fs {
 #define        CleanerRunning  1
 #define        CleanerNeeded   2
 #define FinalCheckpoint 3
+#define CleanerDisabled 4
 
        struct work_struct done_work;   /* used for handling
                                         * refile after write completes */
diff --git a/super.c b/super.c
index be0f41c380e7ad7dcee02b8b6b002b7c9e203900..0428f8657693485d052613a1003b276676845520 100644 (file)
--- a/super.c
+++ b/super.c
@@ -689,6 +689,8 @@ lafs_put_super(struct super_block *sb)
                 * cleaner.  Maybe we should just release all tc->cleaning
                 * blocks instead.
                 */
+               set_bit(CleanerDisabled, &fs->fsstate);
+
                wait_event(fs->async_complete,
                           list_empty(&fs->pending_orphans) &&
                           fs->cleaner.active == 0);