Re: [PATCH 03/13] imsm: FIX: when monitor is active post update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 10 Jan 2011 12:27:50 +0100 Adam Kwolek <adam.kwolek@xxxxxxxxx> wrote:

> Updates has to be posted when monitor is active for this array/container.
> Only when monitor is not active mdadm has update metadata itself.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
> ---
> 
>  super-intel.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/super-intel.c b/super-intel.c
> index 58a776e..8644c39 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -6570,9 +6570,15 @@ static int imsm_reshape_super(struct supertype *st, long long size, int level,
>  				goto exit_imsm_reshape_super;
>  			}
>  
> -			/* As well as creating update, we apply update.
> -			 */
> +			if (mdmon_running(st->container_dev)) {
> +				ret_val = 0;
> +				append_metadata_update(st, u, len);
> +				goto exit_imsm_reshape_super;
> +			}
> +			
>  
> +			/* no mdmon - apply update
> +			 */
>  			dprintf("imsm:prepare space list for update_reshape\n");
>  			for (dl = super->devlist; dl;
>  			     dl = dl->next) {


I really don't like have code in super-* calling "mdmon_running".  It feels
like a layering violation.


imsm_reshape_super should:
 -  *always* change the metadata as required
 -  if st->update_tail is non-null, then a metadata update should also
    be added with append_metadata_update

The common code will then call sync_metadata() to either flush the updates
through mdmon or write them directly.

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux