Here's a patch for an idea to address an issue we have with log replay. The problem stems from the fact that not all changes to inodes result in transactions. Some changes (such as file size updates, timestamp updates) would generate too much log traffic if we logged a transaction for every event. So we update the inode and flag it as dirty (ie set i_update_core/i_update_size). If the inode gets logged in a later transaction then the update gets rolled into that transaction and the flag is cleared. If the inode gets flushed to disk before another transaction then the on-disk version of the inode is newer than what is in the log. On log replay we risk overwriting a newer inode on disk with an older version of the inode from the log. We try to prevent this with the i_flushiter counter in the inode (the on-disk inode will have a greater flushiter than the inode in the log) but this does not work for newly created inode cluster buffers. When log replay encounters a newly allocated inode cluster buffer in the log it cannot determine if the on-disk version of the cluster is older, newer or even valid. Since we cannot determine if the on-disk inode cluster has been initialised since it was logged we cannot read it to check the i_flushiter values. If we write out the log record anyway we risk overwriting newer inode data, if we don't write out the log record we risk exposing an uninitialised inode cluster. The easy solution is to log everything so that log replay doesn't need to check if the on-disk version is newer - it can just replay the log. But logging everything would cause too much log traffic so this patch is a compromise and it logs a transaction before we flush an inode to disk only if it has changes that have not yet been logged. With this scheme we don't clear the i_update_core flag when flushing an inode - we only do that when logging a transaction. The flag is used to determine if a transaction needs to be done. It needs to be this way because the log pushing code may need to flush an inode and we cannot create a transaction at that point. Anyway it's an idea and needs a little polishing so comments are welcome. Lachlan