• NeilBrown's avatar
    [PATCH] md: allow md arrays to be started read-only (module parameter). · f91de92e
    NeilBrown authored
    When an md array is started, the superblock will be written, and resync may
    commense.  This is not good if you want to be completely read-only as, for
    example, when preparing to resume from a suspend-to-disk image.
    
    So introduce a module parameter "start_ro" which can be set
    to '1' at boot, at module load, or via
      /sys/module/md_mod/parameters/start_ro
    
    When this is set, new arrays get an 'auto-ro' mode, which disables all
    internal io (superblock updates, resync, recovery) and is automatically
    switched to 'rw' when the first write request arrives.
    
    The array can be set to true 'ro' mode using 'mdadm -r' before the first
    write request, or resync can be started without a write using 'mdadm -w'.
    Signed-off-by: default avatarNeil Brown <neilb@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    f91de92e
md.c 108 KB