HAMMER VFS - Limit pending writes when flushing undos
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 20 Aug 2010 05:36:40 +0000 (22:36 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 20 Aug 2010 05:36:40 +0000 (22:36 -0700)
* Call hammer_io_limit_backlog() in the undo flush.  We already call it
  when flushing data and meta-data.

* Handles certain extreme cases where large amounts of undo data could
  overwhelm dm_target_crypt.

sys/vfs/hammer/hammer_flusher.c

index 6a56450..082cb85 100644 (file)
@@ -614,8 +614,8 @@ hammer_flusher_finalize(hammer_transaction_t trans, int final)
                hammer_io_flush(io, 0);
                hammer_io_done_interlock(io);
                hammer_rel_buffer((hammer_buffer_t)io, 0);
-               ++count;
                hammer_io_limit_backlog(hmp);
+               ++count;
        }
 
        /*
@@ -754,8 +754,8 @@ hammer_flusher_finalize(hammer_transaction_t trans, int final)
                KKASSERT(io->type != HAMMER_STRUCTURE_VOLUME);
                hammer_io_flush(io, 0);
                hammer_rel_buffer((hammer_buffer_t)io, 0);
-               ++count;
                hammer_io_limit_backlog(hmp);
+               ++count;
        }
 
        /*
@@ -847,6 +847,7 @@ hammer_flusher_flush_undos(hammer_mount_t hmp, int mode)
                hammer_io_flush(io, hammer_undo_reclaim(io));
                hammer_io_done_interlock(io);
                hammer_rel_buffer((hammer_buffer_t)io, 0);
+               hammer_io_limit_backlog(hmp);
                ++count;
        }
        hammer_flusher_clean_loose_ios(hmp);