From patchwork Wed Jul 23 03:36:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Bo X-Patchwork-Id: 4608521 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 172059F37C for ; Wed, 23 Jul 2014 03:37:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 146C9201BF for ; Wed, 23 Jul 2014 03:37:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26A3420173 for ; Wed, 23 Jul 2014 03:37:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755875AbaGWDhH (ORCPT ); Tue, 22 Jul 2014 23:37:07 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:23999 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755259AbaGWDhG (ORCPT ); Tue, 22 Jul 2014 23:37:06 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s6N3aus6030568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 23 Jul 2014 03:36:57 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6N3aujI004266 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Jul 2014 03:36:56 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s6N3asIn026826; Wed, 23 Jul 2014 03:36:55 GMT Received: from localhost.localdomain (/222.90.42.185) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 22 Jul 2014 20:36:54 -0700 Date: Wed, 23 Jul 2014 11:36:50 +0800 From: Liu Bo To: Chris Murphy Cc: Btrfs BTRFS , Eric Sandeen Subject: Re: BUGS: bogus out of space reported when mounted raid1 degraded, btrfs replace failure, then oops Message-ID: <20140723033649.GB4955@localhost.localdomain> Reply-To: bo.li.liu@oracle.com References: <3823A5F4-169B-4EAC-A548-B0E4FE782F0E@colorremedies.com> <53CF235D.1040703@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet22.oracle.com [141.146.126.238] Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Jul 22, 2014 at 09:28:52PM -0600, Chris Murphy wrote: > > On Jul 22, 2014, at 8:52 PM, Eric Sandeen wrote: > > > This one (your bug #4) was likely caused by: > > > > commit 99994cde9c59c2b8bb67d46d531b26cc73e39747 > > Author: Anand Jain > > Date: Tue Jun 3 11:36:00 2014 +0800 > > > > btrfs: dev delete should remove sysfs entry > > > > and hopefully fixed by: > > > > commit 0bfaa9c5cb479cebc24979b384374fe47500b4c9 > > Author: Eric Sandeen > > Date: Mon Jul 7 12:34:49 2014 -0500 > > > > btrfs: test for valid bdev before kobj removal in btrfs_rm_device > > OK good. Hopefully the first one is reverted or the second one is accepted before 3.16 is released, replace appears to be broken at the moment. > Looks that they are not the same one, since you didn't use a btrfs_rm_device, As we just skip adding a sysfs entry for a missing device(dev->bdev is NULL), we can do the same thing in removing a sysfs entry, could you please try this? -liubo --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 7869936..12e5355 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -614,7 +614,7 @@ int btrfs_kobj_rm_device(struct btrfs_fs_info *fs_info, if (!fs_info->device_dir_kobj) return -EINVAL; - if (one_device) { + if (one_device && one_device->bdev) { disk = one_device->bdev->bd_part; disk_kobj = &part_to_dev(disk)->kobj;