From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751595AbcAEI2a (ORCPT ); Tue, 5 Jan 2016 03:28:30 -0500 Received: from mail-lb0-f177.google.com ([209.85.217.177]:33462 "EHLO mail-lb0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbcAEI20 (ORCPT ); Tue, 5 Jan 2016 03:28:26 -0500 To: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org From: Andrei Borzenkov Subject: Reading the same block via partition and non-partitioned device gives different content X-Enigmail-Draft-Status: N1110 Message-ID: <568B7EA7.9010901@gmail.com> Date: Tue, 5 Jan 2016 11:28:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Please Cc me on reply; thank you] QEMU KVM virtual machine with openSUSE Tumbleweed (kernel 4.3.3-3-default); MD RAID1 with 1.2 metadata on /dev/vdb1 and /dev/vdc1. If I do mdadm /dev/mdX --fail /dev/vdb1 mdadm /dev/mdX --add /dev/vdd1 and wait for synchronization to finish and then look directly on on-disk suportblock, I see different content whether I read from /dev/vdd or from /dev/vdd1. /dev/vdd1 claims new disk is still spare (i.e. it is apparently immediately after adding it). The *same* superblock when read from /dev/vdd (of course with appropriate offset) correctly marks /dev/vdd1 as RAID member. The same content also seen when looking from host. I hit this when debugging problem with grub2 that scans devices for Linux MD (it is using the same code both at boot and run time). It skipped replacement disk because it believed disk was spare. Is it expected behavior? Note that if we now replace /dev/vdc1 with something else we have "wrong" superblock on both partitions so grub fails to find array completely. Fortunately this is transient state, but it also means it is impossible to reconfigure grub until reboot. Alternatively shutting down and restarting array cleats it as well. Any trick we can use to force content to be the same in this state? -andrei