]> git.hungrycats.org Git - linux/commit
[PATCH] md: Small fixes for timely writing of md superblocks.
authorAndrew Morton <akpm@osdl.org>
Tue, 20 Jan 2004 11:12:44 +0000 (03:12 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 20 Jan 2004 11:12:44 +0000 (03:12 -0800)
commit24ae74801f33050d04c2c35a56605219bfcee863
tree03ed0d5cfcf6fe79bdacf8c71dbb7638ba80012b
parente770288c4a820e86d277314d1c3901da1ce90b19
[PATCH] md: Small fixes for timely writing of md superblocks.

From: NeilBrown <neilb@cse.unsw.edu.au>

Currently a raid0 superblock is only written when the array is stopped, so a
crash between creation and stop can lose your data.

This patch marks a superblock 'dirty' at creation and forces a dirty
superblock to be written when the array is started.

Previously we would prod the per-array thread at this point, but as it avoids
certain chores when the array is locked, and the array is locked at this
point, that isn't guaranteed to do the right thing.  Instead we prod the
thread whenever the array is unlocked.

Finally, only write the superblock at array stop if it is needed to mark the
array as 'clean'.  raid0 which is never dirty, doesn't need this.
drivers/md/md.c