Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Kamal Mostafa <kamal@canonical.com>
To: linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org, kernel-team@lists.ubuntu.com,
	NeilBrown <neilb@suse.com>
Subject: Re: [PATCH 3.13.y-ckt 10/60] md/raid10: always set reshape_safe when initializing reshape_position.
Date: Fri, 04 Sep 2015 12:39:41 -0700	[thread overview]
Message-ID: <1441395581.29406.6.camel@fourier> (raw)
In-Reply-To: <1441155486-26089-11-git-send-email-kamal@canonical.com>

On Tue, 2015-09-01 at 17:57 -0700, Kamal Mostafa wrote:
> 3.13.11-ckt26 -stable review patch.  If anyone has any objections, please let me know.

I'm deferring this commit until the next 3.13-stable release (along with
"md: flush ->event_work before stopping array.") as per the guidance on
their cc: stable lines.

 -Kamal


> ------------------
> 
> From: NeilBrown <neilb@suse.com>
> 
> commit 299b0685e31c9f3dcc2d58ee3beca761a40b44b3 upstream.
> 
> 'reshape_position' tracks where in the reshape we have reached.
> 'reshape_safe' tracks where in the reshape we have safely recorded
> in the metadata.
> 
> These are compared to determine when to update the metadata.
> So it is important that reshape_safe is initialised properly.
> Currently it isn't.  When starting a reshape from the beginning
> it usually has the correct value by luck.  But when reducing the
> number of devices in a RAID10, it has the wrong value and this leads
> to the metadata not being updated correctly.
> This can lead to corruption if the reshape is not allowed to complete.
> 
> This patch is suitable for any -stable kernel which supports RAID10
> reshape, which is 3.5 and later.
> 
> Fixes: 3ea7daa5d7fd ("md/raid10: add reshape support")
> Signed-off-by: NeilBrown <neilb@suse.com>
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---
>  drivers/md/raid10.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 1b707ad..b8215a3 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -3597,6 +3597,7 @@ static struct r10conf *setup_conf(struct mddev *mddev)
>  			/* far_copies must be 1 */
>  			conf->prev.stride = conf->dev_sectors;
>  	}
> +	conf->reshape_safe = conf->reshape_progress;
>  	spin_lock_init(&conf->device_lock);
>  	INIT_LIST_HEAD(&conf->retry_list);
>  
> @@ -3804,7 +3805,6 @@ static int run(struct mddev *mddev)
>  		}
>  		conf->offset_diff = min_offset_diff;
>  
> -		conf->reshape_safe = conf->reshape_progress;
>  		clear_bit(MD_RECOVERY_SYNC, &mddev->recovery);
>  		clear_bit(MD_RECOVERY_CHECK, &mddev->recovery);
>  		set_bit(MD_RECOVERY_RESHAPE, &mddev->recovery);
> @@ -4149,6 +4149,7 @@ static int raid10_start_reshape(struct mddev *mddev)
>  		conf->reshape_progress = size;
>  	} else
>  		conf->reshape_progress = 0;
> +	conf->reshape_safe = conf->reshape_progress;
>  	spin_unlock_irq(&conf->device_lock);
>  
>  	if (mddev->delta_disks && mddev->bitmap) {
> @@ -4215,6 +4216,7 @@ abort:
>  		rdev->new_data_offset = rdev->data_offset;
>  	smp_wmb();
>  	conf->reshape_progress = MaxSector;
> +	conf->reshape_safe = MaxSector;
>  	mddev->reshape_position = MaxSector;
>  	spin_unlock_irq(&conf->device_lock);
>  	return ret;
> @@ -4566,6 +4568,7 @@ static void end_reshape(struct r10conf *conf)
>  	md_finish_reshape(conf->mddev);
>  	smp_wmb();
>  	conf->reshape_progress = MaxSector;
> +	conf->reshape_safe = MaxSector;
>  	spin_unlock_irq(&conf->device_lock);
>  
>  	/* read-ahead size must cover two whole stripes, which is



  reply	other threads:[~2015-09-04 19:39 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02  0:57 [3.13.y-ckt stable] Linux 3.13.11-ckt26 stable review Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 01/60] md: use kzalloc() when bitmap is disabled Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 02/60] ata: pmp: add quirk for Marvell 4140 SATA PMP Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 03/60] libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for HP 250GB SATA disk VB0250EAVER Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 04/60] libata: add ATA_HORKAGE_NOTRIM Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 05/60] libata: force disable trim for SuperSSpeed S238 Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 06/60] libata: increase the timeout when setting transfer mode Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 07/60] libata: Do not blacklist M510DC Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 08/60] mac80211: clear subdir_stations when removing debugfs Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 09/60] ALSA: hda - Add new GPU codec ID 0x10de007d to snd-hda Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 10/60] md/raid10: always set reshape_safe when initializing reshape_position Kamal Mostafa
2015-09-04 19:39   ` Kamal Mostafa [this message]
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 11/60] drm: Stop resetting connector state to unknown Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 12/60] usb: dwc3: Reset the transfer resource index on SET_INTERFACE Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 13/60] usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() function Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 14/60] xhci: Calculate old endpoints correctly on device reset Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 15/60] xhci: report U3 when link is in resume state Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 16/60] xhci: prevent bus_suspend if SS port resuming in phase 1 Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 17/60] xhci: do not report PLC when link is in internal resume state Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 18/60] USB: OHCI: Fix race between ED unlink and URB submission Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 19/60] usb-storage: ignore ZTE MF 823 card reader in mode 0x1225 Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 20/60] blkcg: fix gendisk reference leak in blkg_conf_prep() Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 21/60] tile: use free_bootmem_late() for initrd Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 22/60] Input: usbtouchscreen - avoid unresponsive TSC-30 touch screen Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 23/60] md/raid1: fix test for 'was read error from last working device' Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 24/60] mmc: omap_hsmmc: Fix DTO and DCRC handling Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 25/60] isdn/gigaset: reset tty->receive_room when attaching ser_gigaset Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 26/60] mmc: sdhci-pxav3: fix platform_data is not initialized Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 27/60] mmc: block: Add missing mmc_blk_put() in power_ro_lock_show() Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 28/60] mmc: sdhci-esdhc: Make 8BIT bus work Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 29/60] bonding: correctly handle bonding type change on enslave failure Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 30/60] net: Clone skb before setting peeked flag Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 31/60] bridge: mdb: fix double add notification Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 32/60] usb: gadget: mv_udc_core: fix phy_regs I/O memory leak Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 33/60] inet: frags: fix defragmented packet's IP header for af_packet Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 34/60] bonding: fix destruction of bond with devices different from arphrd_ether Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 35/60] ARM: OMAP2+: hwmod: Fix _wait_target_ready() for hwmods without sysc Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 36/60] ASoC: pcm1681: Fix setting de-emphasis sampling rate selection Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 37/60] iscsi-target: Fix use-after-free during TPG session shutdown Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 38/60] iscsi-target: Fix iscsit_start_kthreads failure OOPs Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 39/60] iscsi-target: Fix iser explicit logout TX kthread leak Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 40/60] ALSA: hda - Apply fixup for another Toshiba Satellite S50D Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 41/60] vhost: actually track log eventfd file Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 42/60] xfs: remote attributes need to be considered data Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 43/60] ALSA: usb-audio: add dB range mapping for some devices Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 44/60] drm/radeon/combios: add some validation of lvds values Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 45/60] x86/efi: Use all 64 bit of efi_memmap in setup_e820() Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 46/60] ipr: Fix locking for unit attention handling Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 47/60] ipr: Fix incorrect trace indexing Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 48/60] ipr: Fix invalid array indexing for HRRQ Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 49/60] ALSA: hda - Fix MacBook Pro 5,2 quirk Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 50/60] x86/xen: Probe target addresses in set_aliased_prot() before the hypercall Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 51/60] netfilter: ctnetlink: put back references to master ct and expect objects Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 52/60] bridge: mdb: fix delmdb state in the notification Kamal Mostafa
2015-09-02  0:57 ` [PATCH 3.13.y-ckt 53/60] ipvs: fix crash with sync protocol v0 and FTP Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 54/60] act_pedit: check binding before calling tcf_hash_release() Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 55/60] netfilter: nf_conntrack: Support expectations in different zones Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 56/60] ipvs: do not use random local source address for tunnels Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 57/60] ALSA: hda - fix cs4210_spdif_automute() Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 58/60] niu: don't count tx error twice in case of headroom realloc fails Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 59/60] net/mlx4_core: Fix wrong index in propagating port change event to VFs Kamal Mostafa
2015-09-02  0:58 ` [PATCH 3.13.y-ckt 60/60] ipvs: fix crash if scheduler is changed Kamal Mostafa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441395581.29406.6.camel@fourier \
    --to=kamal@canonical.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox