From patchwork Fri May 22 15:38:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Reinecke X-Patchwork-Id: 11565859 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DEEB61392 for ; Fri, 22 May 2020 15:39:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9D497208DB for ; Fri, 22 May 2020 15:39:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BWJAP0DX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9D497208DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590161982; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eHUAmida22DsdyLX8J7VAIMbuxZ6KXAx9m+MhmKsD4c=; b=BWJAP0DXU69rwEP97IrKjajJ0S2t/HEyQqnyDRJTXT1RdPMnUAkOcgqB0x243s+NB7E8N1 vGrHfVjtOnvm3nYNMTILhgT734H7v3ge3p9fEdvwxeZuOQkDQLw8BgtqZ6GfiTWU7PlS/8 QpwZ3jC6rZjpnLpE9mpAqvr2n/WopWs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-66-IwwkVoKlP1yJToNqJx0xEw-1; Fri, 22 May 2020 11:39:39 -0400 X-MC-Unique: IwwkVoKlP1yJToNqJx0xEw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6653E8F294C; Fri, 22 May 2020 15:39:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 522919CB9; Fri, 22 May 2020 15:39:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6F10554D09; Fri, 22 May 2020 15:39:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04MFdGia012599 for ; Fri, 22 May 2020 11:39:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2EB1AF41C6; Fri, 22 May 2020 15:39:16 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2A054F41C2 for ; Fri, 22 May 2020 15:39:14 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E63F3833B50 for ; Fri, 22 May 2020 15:39:13 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-387-v7K0x454MAqdIKeX1DOJ5g-1; Fri, 22 May 2020 11:39:11 -0400 X-MC-Unique: v7K0x454MAqdIKeX1DOJ5g-1 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 74023B208; Fri, 22 May 2020 15:39:12 +0000 (UTC) From: Hannes Reinecke To: Damien LeMoal Date: Fri, 22 May 2020 17:38:53 +0200 Message-Id: <20200522153901.133375-5-hare@suse.de> In-Reply-To: <20200522153901.133375-1-hare@suse.de> References: <20200522153901.133375-1-hare@suse.de> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com, Mike Snitzer Subject: [dm-devel] [PATCH 04/12] dm-zoned: secondary superblock must reside on the same devices than primary superblock X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com The secondary superblock must reside on the same device than the primary superblock, so there's no need to re-calculate the device. Signed-off-by: Hannes Reinecke Reviewed-by: Damien Le Moal --- drivers/md/dm-zoned-metadata.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-zoned-metadata.c b/drivers/md/dm-zoned-metadata.c index b70a988fa771..fdae4e0228e7 100644 --- a/drivers/md/dm-zoned-metadata.c +++ b/drivers/md/dm-zoned-metadata.c @@ -1141,7 +1141,7 @@ static int dmz_lookup_secondary_sb(struct dmz_metadata *zmd) /* Bad first super block: search for the second one */ zmd->sb[1].block = zmd->sb[0].block + zone_nr_blocks; zmd->sb[1].zone = xa_load(&zmd->zones, zone_id + 1); - zmd->sb[1].dev = dmz_zone_to_dev(zmd, zmd->sb[1].zone); + zmd->sb[1].dev = zmd->sb[0].dev; for (i = 1; i < zmd->nr_rnd_zones; i++) { if (dmz_read_sb(zmd, &zmd->sb[1], 1) != 0) break; @@ -1149,7 +1149,6 @@ static int dmz_lookup_secondary_sb(struct dmz_metadata *zmd) return 0; zmd->sb[1].block += zone_nr_blocks; zmd->sb[1].zone = dmz_get(zmd, zone_id + i); - zmd->sb[1].dev = dmz_zone_to_dev(zmd, zmd->sb[1].zone); } dmz_free_mblock(zmd, mblk); @@ -1272,7 +1271,7 @@ static int dmz_load_sb(struct dmz_metadata *zmd) zmd->sb[1].zone = dmz_get(zmd, zone_id); } zmd->sb[1].block = dmz_start_block(zmd, zmd->sb[1].zone); - zmd->sb[1].dev = dmz_zone_to_dev(zmd, zmd->sb[1].zone); + zmd->sb[1].dev = zmd->sb[0].dev; ret = dmz_get_sb(zmd, &zmd->sb[1], 1); } else ret = dmz_lookup_secondary_sb(zmd);