Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3791572ybi; Tue, 18 Jun 2019 06:37:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzc49vE9UURvS5UF2dbr/to65Uz0LKTrKrwSeWIJQWbIiSQMBM7X4ZNP18+MQRQ/GxS6rz2 X-Received: by 2002:a65:50c3:: with SMTP id s3mr2747541pgp.177.1560865060327; Tue, 18 Jun 2019 06:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560865060; cv=none; d=google.com; s=arc-20160816; b=jWb6ilLynT59guXm4N90Q4Xe4dsF6og0+AePC2ekg6Sk8TsJubVt/MNWIhbbFJsBig vlNwjhTWckjeI00GLgWAey5buRMl9evPHA8ALiok/+irt8RK/q3b9SpLW87SiSivoivt XNNHMJbWGlvWUHkGl/yG9njDI8KpY36j+pyhKyzDUawPR3lXigYRCtNxgVZWolBwSjm7 j5WSM9ZIple6UIhNdaWy8ObFcotAQVGXPXOcSLi/WJamasjINklB0YFkvXH8oHJ9I8zd CQkg8kgsWdyORwtbruAfryLbx71jjoKxEH0pasUJKFyZsv1EamuT3vtsYuc0jsssYtjU hl5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eK5CJpBaboC0hEciRwXZ1C92olmsKQDqEljQyovaSOk=; b=ZTX/bItFfaMlxEuWlssaNnQIYabGvXkwKxwreXXHuxLFgBjaoxdXv0IM9l4M0vkI6G 2MwE14S+6cOcjm7W3C5iAqnWN3n/svhx/1jrjVwdilpzdj/HfCZAqkr9r6rF82TMvopv 3a/qZSoMWcNm/E9h6gvSAr+JstJdQqgYPBpEG46DB4tTUeEJJyf7lkqCXOXTgzotKomF hNSnQgIC7YYkq3tqxUs0OaF5oCcSRkVaVXcVaOC1miIJ+LYFLxT4GK3Vcriba6+gSBQt vrRc5rmLNCamrDctlrxoxJqP6cUjMZGAufaaUDhk9y9emNVEytbjyuqICwkSEU0kwfl9 kPpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=YiOIvK80; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si235988pgu.189.2019.06.18.06.37.24; Tue, 18 Jun 2019 06:37:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=YiOIvK80; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729380AbfFRNfV (ORCPT + 99 others); Tue, 18 Jun 2019 09:35:21 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:34925 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729213AbfFRNfU (ORCPT ); Tue, 18 Jun 2019 09:35:20 -0400 Received: by mail-qk1-f194.google.com with SMTP id l128so8553703qke.2 for ; Tue, 18 Jun 2019 06:35:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=eK5CJpBaboC0hEciRwXZ1C92olmsKQDqEljQyovaSOk=; b=YiOIvK80pvLydz0Im11/2kCXM2Q0lUk5O+a5AZ31v1AzEl3ej4o/STSbJdcXX7ZraH +GGCVaNrn9LDGqvkcfri9GbBuDCEmFegVmn/iknd2QUnX+RSbIlFFUZUg2qtuetXPiPM fjbZZb+dHRGhp6NSOeuGscXvchIXuS/ArJydWEHllez8zvYJw29+mtkc5suxgAUZUxvH 5Juf+4m7vbsy0ubcdX7FAogWdjuyya45XbnwY7S4GjhdxiayBWhwt2lPp+mANs+neTDl O64zdCjP6r3v7lqVCFQC4kPESsjGi7VflBVxF2a17Y1ijMCHMMkjhdG118TQtm8CZ5uT VwBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=eK5CJpBaboC0hEciRwXZ1C92olmsKQDqEljQyovaSOk=; b=lJ5kD8jBZUyUhpXWsgNbfC20u+TeNk/swoXerzucFlCzyCDy8VIwdmFQ5SeLNnOJrp 28EoZI+3ah5JxyzRyhDNet/ZGm1S+kKTRymMuy/4aJ/1GuoWaVyq2qI2k9WN2jm35wed 5Yjny+RXHV4CLmAwbnhtMmHyiuTHJ4SYEQL2cxO6LbyzpQQZvJfF02A4wJjobHuJ+6kL rqoJpU8Q9k4cR8/b30EAK0maA+Qulez1alvPFSvGLNd+RmR6fYESJlx3bqV9+KoRdES3 /lEUhnGFXbuwrJdYj5rJtuerJaCHSf6Xr6SZyqAOehuaq+e74B+2Gzh5un8YMMtPf1YV RQTQ== X-Gm-Message-State: APjAAAVLRjfQo28jEQ/BtgGxqlnoLyUd7sOoICeT3G2Zmvib9v/c8Mvk /7uDANQVgB5RRGkfITMmiw3eug== X-Received: by 2002:a05:620a:44:: with SMTP id t4mr5034628qkt.189.1560864919497; Tue, 18 Jun 2019 06:35:19 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::a0ec]) by smtp.gmail.com with ESMTPSA id f25sm10849540qta.81.2019.06.18.06.35.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jun 2019 06:35:18 -0700 (PDT) Date: Tue, 18 Jun 2019 09:35:17 -0400 From: Josef Bacik To: Naohiro Aota Cc: Josef Bacik , "linux-btrfs@vger.kernel.org" , David Sterba , Chris Mason , Qu Wenruo , Nikolay Borisov , "linux-kernel@vger.kernel.org" , Hannes Reinecke , "linux-fsdevel@vger.kernel.org" , Damien Le Moal , Matias =?utf-8?B?QmrDuHJsaW5n?= , Johannes Thumshirn , Bart Van Assche Subject: Re: [PATCH 08/19] btrfs: make unmirroed BGs readonly only if we have at least one writable BG Message-ID: <20190618133516.giriyfzpnhdquuot@MacBook-Pro-91.local> References: <20190607131025.31996-1-naohiro.aota@wdc.com> <20190607131025.31996-9-naohiro.aota@wdc.com> <20190613140921.a2kmty5p6lzqztej@MacBook-Pro-91.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 18, 2019 at 07:42:46AM +0000, Naohiro Aota wrote: > On 2019/06/13 23:09, Josef Bacik wrote: > > On Fri, Jun 07, 2019 at 10:10:14PM +0900, Naohiro Aota wrote: > >> If the btrfs volume has mirrored block groups, it unconditionally makes > >> un-mirrored block groups read only. When we have mirrored block groups, but > >> don't have writable block groups, this will drop all writable block groups. > >> So, check if we have at least one writable mirrored block group before > >> setting un-mirrored block groups read only. > >> > > > > I don't understand why you want this. Thanks, > > > > Josef > > > > This is necessary to handle e.g. btrfs/124 case. > > When we mount degraded RAID1 FS and write to it, and then > re-mount with full device, the write pointers of corresponding > zones of written BG differ. The patch 07 mark such block group > as "wp_broken" and make it read only. In this situation, we only > have read only RAID1 BGs because of "wp_broken" and un-mirrored BGs > are also marked read only, because we have RAID1 BGs. > As a result, all the BGs are now read only, so that we > cannot even start the rebalance to fix the situation. Ah ok, please add this explanation to the changelog. Thanks, Josef