• Andrew Morton's avatar
    [PATCH] md: Small fixes for timely writing of md superblocks. · 24ae7480
    Andrew Morton authored
    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.
    24ae7480
md.c 82.2 KB