From patchwork Wed Jan 31 02:28:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 10193237 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2E864601A0 for ; Wed, 31 Jan 2018 05:13:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E6792841D for ; Wed, 31 Jan 2018 05:13:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01C2728446; Wed, 31 Jan 2018 05:13:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 828292841D for ; Wed, 31 Jan 2018 05:13:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752198AbeAaFMu (ORCPT ); Wed, 31 Jan 2018 00:12:50 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:49354 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751899AbeAaFMt (ORCPT ); Wed, 31 Jan 2018 00:12:49 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0V5CnAx099469 for ; Wed, 31 Jan 2018 05:12:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=GVhZZOs/qAxu8I8bTQdyO59QB9kVUdMQTzOToe9y45U=; b=Le15SsMDxXDhL3J0Jq7y16eAGelEIhfNfCAxAz5nbCvRateIBohZb5RdCXXc3bdFWl8K SuhqUMzd/kjlKrTjygb6Bm457V+UVaWWDAs6tknK1OQR0i8LRE6hudtKjGdbCrq6W+8a OASHHx1ur/bVHHsuAH3eXtbi6vzQqfAsqeQR+ykICoMLc9lxiq8g4fi5gxe4PpmYzSaL zhp7X46pv6N2uO1+PxzxskmcRpU0gXBXOzfqIX2yx/Gq1aWBvXYueFMV7pwpqifbJ2BJ IVdKWPbVoot6gX+3Y49J0v+hlJO19wlyISvwx4lrg5iivzx9NQT+gt54zoXdPymmJ5zz aw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2fu5bwr81m-4 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 31 Jan 2018 05:12:48 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0V2SOVQ015411 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 31 Jan 2018 02:28:24 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0V2SOv2030341 for ; Wed, 31 Jan 2018 02:28:24 GMT Received: from tp.sg.oracle.com (/10.186.49.52) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 30 Jan 2018 18:28:24 -0800 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH v3 2/2] btrfs: fix alloc device order consistency Date: Wed, 31 Jan 2018 10:28:56 +0800 Message-Id: <20180131022856.16791-3-anand.jain@oracle.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20180131022856.16791-1-anand.jain@oracle.com> References: <20180131022856.16791-1-anand.jain@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8790 signatures=668657 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=826 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801310067 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add opened device to the tail of dev_alloc_list instead of head, so that it maintains the same order as dev_list. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 0109f370ad5b..9c3b4ff7f505 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -708,7 +708,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices, if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state) && device->devid != BTRFS_DEV_REPLACE_DEVID) { fs_devices->rw_devices++; - list_add(&device->dev_alloc_list, &fs_devices->alloc_list); + list_add_tail(&device->dev_alloc_list, &fs_devices->alloc_list); } brelse(bh);