From patchwork Tue Aug 24 05:05:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 12453963 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EA02C4338F for ; Tue, 24 Aug 2021 05:05:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 320B6610E9 for ; Tue, 24 Aug 2021 05:05:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231296AbhHXFGh (ORCPT ); Tue, 24 Aug 2021 01:06:37 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:2194 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230232AbhHXFGe (ORCPT ); Tue, 24 Aug 2021 01:06:34 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17O0xBXE012043; Tue, 24 Aug 2021 05:05:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=28ARWY1xI/Q2sM+D31TyyswewjaVeomvGMErPL0otgI=; b=oURwg0je+9ptwrs4/VPcJ30mZsWO3OyHVFeHpLj4kXRQTrcNKXCPjrqKYwcz+Uo0pdVo roWIiItAQkVLxznb4auH9yfy1gKnuwi5Otn15QKrWCTxAbBIq6My9XXrfCvjAfdEDRzD zh1swpdYsQxpv1bitBXsYX1dEqZd459xHAUgDdlGynb2YtPDm2CxNWN3+zou4yCTUEgm 5tiraJwH6SHhfHPOv0lMrPAcPMPB+UYzi9IMjMfx9rvFOJ8umi1CippgF2zFMwFPb5JM bQd1xALBEPLn9GS2LN8jwY10UnIeSNg0PGz4OjntgzIyPpj9Zgw6DkKrL4ww1WdxWHmu IQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=28ARWY1xI/Q2sM+D31TyyswewjaVeomvGMErPL0otgI=; b=dg84Z2EIQkVqhUEtWRvPf7yBwhySSSpNWKTHh7EFgdRWb0M08xanbK/ecEFhbtUWHgDQ hJv1HIVHAsp1LIEhd3836tnTVALLNz+UKXeEJ/CHlZSC5LIUE0uSyFx5vjzbdPBP32xu cBoNd261W4YLv6mXXZDBBCVsGlVTYoUW1UGV+TgbPWv88hd4zQ5NVI8Xqc3k4SVfEKUg Jd3FPu1pj/ixQWA0WKe4M52Ct+EFlkzOzIJ/AXmQUftaSNtUatIs7b+MIGcQCop/P5kD Q9BiD1cso2AFJ4CUrh7ltU50TrFNc33CLTbFg0t1XDRYEbyEaOTBf4+Mgz4OtlzYmvea Bw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3akw7nbabb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Aug 2021 05:05:44 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 17O55OmE062250; Tue, 24 Aug 2021 05:05:43 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by userp3020.oracle.com with ESMTP id 3akb8u1jay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Aug 2021 05:05:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6Vol4DS+c0pDhCHW57kghYlzsaFpvanVbtIEmnz4jf9fugsPCxSboDZvLgbMOEiNsjmoX3jj73ZuxU/c3cioXiA+xNu4+Ww/YSORQUoGxiF3tzW2n+RYwT3gTsRY/3HWXhILpHF1HVMQRNRAI9xNs+v8KeOp72bua//VMNGh6nA3BzNaXWu5l5Z0ScXtCVzRbOIHm58THqgKcImKEaK2ljCjtYrd6oWesZNdJEojJuC1LAHSRYNQMhGu0gFhdQfoACusgJTUuedNcLJU9lQEzYVCVusr/aUazSlUDVAC7kVQLMaETNkWxAjX/pQJAMJrwnWcIBpMwP+fUvsVt5sJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=28ARWY1xI/Q2sM+D31TyyswewjaVeomvGMErPL0otgI=; b=LaVs8E26jLdAQQkk8DM9A7TOtcrXaZRZq91WiMYQUK7Z14DI0J88CzMGQ90CpY0urqWtkmNVCbYznSQgeSCbV2mjsqNisAppNLzT5kDaj+zu8RVsXArtxeD5MgQHyeaZJRsT78t6iTSQ7wTVlUKj+OufQgWGDlucXoFCXpHL+bvHQpFUMqUuyi2EEdGCAU5D/eqZRF03x2bSDhclXElWCtvKcacgP6uJZe6v5uwTyQlJ61cX98FlBFkg2IIqYxZAICISzB4nRrUEMGxcjb65rf3Lx6ync4ZRmRKyvl/alVTAvGTVU0bByWM/GNA0BhjEGNEpfuCBr+dfVfAGHvmntg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=28ARWY1xI/Q2sM+D31TyyswewjaVeomvGMErPL0otgI=; b=pHHEXHcb8W+kPCafFHQq5PXc5275q37XoPv21b+uz4QKtQ6z3FPC7Bh0tpazS9f9mmQCCJOz+30MForEtbg3PUYSaSAb3jo4yfqCgBrQkz/6Mbz9bfa7RNFJEdsl2ZUH2ErpiytoDnWhlrPbrXyjKanHYy5UzRTJVTIPTjEtBGg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) by BL0PR10MB3428.namprd10.prod.outlook.com (2603:10b6:208:7c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 05:05:40 +0000 Received: from MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::b813:4805:31e:d36a]) by MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::b813:4805:31e:d36a%5]) with mapi id 15.20.4436.024; Tue, 24 Aug 2021 05:05:40 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.com, l@damenly.su Subject: [PATCH V5 1/4] btrfs: convert latest_bdev type to struct btrfs_device and rename Date: Tue, 24 Aug 2021 13:05:19 +0800 Message-Id: <34dc747f52cf2fef1f851c163cc619889d1fd852.1629780501.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) To MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (39.109.186.25) by SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.6 via Frontend Transport; Tue, 24 Aug 2021 05:05:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 958e67ce-b7a6-44ee-521f-08d966bcd178 X-MS-TrafficTypeDiagnostic: BL0PR10MB3428: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:644; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SkIrTvwrhoRVhI+c1itP5PrPt0ARLd9jqqRLJnrbbhOkWFj66X3/uHwDDEYxPlzqW0nus6vpMhHfVS7ewrcswERKXy8NlR8fVpFSMoQyHGpoLboIdBN+xyIPzfoqRUvfVOom3hBf38emThZgXqfLXlDxwgX74/eO14CqL6mCwGrRf9Rb9vLNzIWfhnWNqciX3O7CUj4yob8bqa1hfQJo99mt4uaJVVczvRRFKpWdj6D61o383ZW3nah++M1Nerdttz+ZWL12Fw7ZlXx1yk959H5+MkwOhkBG+fW8AKndpJkMU3KSG8lwaZBiDaH5jtLp+OakpC6Gojtsab9jVTQVAZEk7e4HWN9j3Ahx7PMqkn6hfNeHDb699DXGfEpbvk6iRBdrayIFBE536o280uybJwKraUzqyW2gwS7r10bXu8HbyR7PUXbXX9xoAWpDaQpv5XJ+urj+7gaVsKMgVEK8mzRvn8dbpZkuzyuhUZ9p2d7wm8WttVldvMOBSoo0HnZkJ4/6bDOlgrO6sM2B6Jrp7ck91UxGh87LajM1UUpsvvnh3ELV9cbTeBj7ibVesGV2Pyetp9PmH3AVkhPP0IFFbxq2006QFYoNLjRAOVrZ5UGaOJliBevplcI9lUdwP1IKjbIZ3xPZKrXqUlV1GWcj4LlZo39Dy/+Nx2sGRnQww1AYUXlDhBnxo2EkC8nTzjkFKCoVWd+vC39emdTQoZk0gA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR10MB4128.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(376002)(39860400002)(346002)(396003)(136003)(8936002)(6506007)(6512007)(956004)(86362001)(8676002)(2616005)(66476007)(38100700002)(66946007)(38350700002)(83380400001)(5660300002)(66556008)(478600001)(52116002)(6486002)(316002)(186003)(4326008)(26005)(6916009)(36756003)(2906002)(6666004)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uje6c87Jy39NNfD/bgWJ9h2IorGUNX4TJyea/SF783a9kGJdfzCrt8VOjWvhP5T4vtVGRGY/TAR/zi0yDDTafvPsubr0Ep8bW9diq569dtKlLdcJe52gQDzXWVkQJFMycybPhGlmKuOqCr82ZvQmfh5VygL2oVRFbB71q09orQ7jcQ9bmg2wq1JKsopbp3wOODEJ3AaXtlclvPLyyxNNFuZ3BHNLf9OfO5QHEsZC1Xj45gYaKmFWYExv/p99vRb+ay2Lb4rKVGXSrq2coSoiLMJkuit9wJryLbLF4AXh+dWbDpw+2fjqHdx5B3KEzhaYhmMBxTxBS0XbTxT9kHDGPbprvW8MaQXHlvoOHhsN3laJuvydCp8fl9n/oX2/AZBsoDIuqYi43W3QuG37Yb2IMMNMaafjCFeTTwIvCjJDYOp4V7bWhiJX4zhSHp4BhzvMZ44/Y1fJc90iBx6J6SWeq25XDHKuxfrzk3XP+1pCBmFh3lioiMAC19eKHfay/LZJiQjWDZKDhc5xbndlR0BPbXLK/vmefQKkTBi5rTXsTWGxnYe2gNellvrEznnEHXWahXPKT5P1AJaVwenodWXPTGOAtIgH4rm+ylfQheaePbmQ63luxPHqC4Xd5DdUUdZLDgbreiKH30JbXRPlZ+7ZJbRwCVJlwA+aFQTmsG9NJHM0cc9qlNVbqgksUO1GMj7XmAJp9KZNjMfq535icv/E8gM+QqB67JsjpwIAnDyesy96nTVTjoWvgYKmty4gmZufOBczT2oIUBYc+0uPnAdnLCdAF58uzSx6PGIq1/ea9buVuIj2J1ZvsTqF1+0dgVW+ENsq6JsrGMsTl9oPmHsairjym0rdHIi/T9Md0muG8qC4efEs8LarbDVVQW8lMoM43sUTyuN2DEd88EPuAJ7QyxTDeadsyPZCHvqK+rbu4Z4IePEvpaZjdIuL8MyAWC8+D4SCT7uMcmD7nqDO/VN1wRcajzK5OzD3QoBghzrSrHe0XW/i5p21mouS0YmSwVSCaK5V5Camtqo52JYOKIG6+yB2fby37u1UJvoFsx0gbwlvM3UKXsh6/D058m6h5buewDNreD6Lr4V56ZUH5v8Y1KHuSv1QFv2jpU3ITCx3M1UYTjcVrwznpxzAD3vvheLAIOmeaVXKcThCpHJz7mRX1KMe+3aYNzZGmMhQrEX0b4Os91FyWhOpEiPLtBYGFEJe4LnEU5l8tzZoVYugPfkeTFYeMY2jPUJIcZFoTJt+GNfpkfOS3kQDrxJ/Pw4mc7Bj+ie+kA2nWi4eCToWjcVZ31HrUSqJKoKg9Qhzmu42dt/Sc8OFtfYkDGHfvb7eo/77 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 958e67ce-b7a6-44ee-521f-08d966bcd178 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4128.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 05:05:40.5357 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vQfa2tuDsi0Etc3HXgHTTtdW5VqBk7n2a9LZ0or7eKc8N2dxHnna+IOJKjGVN16Vj8mRd+lfq1sFpGsDY9taVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR10MB3428 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10085 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108240031 X-Proofpoint-GUID: -dWAikEsWG_jvxAGRu_WasmaPN_ZQZ8Y X-Proofpoint-ORIG-GUID: -dWAikEsWG_jvxAGRu_WasmaPN_ZQZ8Y Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org In preparation to fix a bug in btrfs_show_devname(). Convert fs_devices::latest_bdev type from struct block_device to struct btrfs_device and, rename the member to fs_devices::latest_dev. So that btrfs_show_devname() can use fs_devices::latest_dev::name. Signed-off-by: Anand Jain --- fs/btrfs/disk-io.c | 6 +++--- fs/btrfs/extent_io.c | 2 +- fs/btrfs/inode.c | 2 +- fs/btrfs/super.c | 2 +- fs/btrfs/volumes.c | 10 +++++----- fs/btrfs/volumes.h | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 1052437cec64..c0d2c093b874 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -3228,12 +3228,12 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device mapping_set_gfp_mask(fs_info->btree_inode->i_mapping, GFP_NOFS); btrfs_init_btree_inode(fs_info); - invalidate_bdev(fs_devices->latest_bdev); + invalidate_bdev(fs_devices->latest_dev->bdev); /* * Read super block and check the signature bytes only */ - disk_super = btrfs_read_dev_super(fs_devices->latest_bdev); + disk_super = btrfs_read_dev_super(fs_devices->latest_dev->bdev); if (IS_ERR(disk_super)) { err = PTR_ERR(disk_super); goto fail_alloc; @@ -3466,7 +3466,7 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device * below in btrfs_init_dev_replace(). */ btrfs_free_extra_devids(fs_devices); - if (!fs_devices->latest_bdev) { + if (!fs_devices->latest_dev->bdev) { btrfs_err(fs_info, "failed to read devices"); goto fail_tree_roots; } diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index aaddd7225348..edf0162c9020 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3327,7 +3327,7 @@ static int alloc_new_bio(struct btrfs_inode *inode, if (wbc) { struct block_device *bdev; - bdev = fs_info->fs_devices->latest_bdev; + bdev = fs_info->fs_devices->latest_dev->bdev; bio_set_dev(bio, bdev); wbc_init_bio(wbc, bio); } diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 2aa9646bce56..ceedcd54e6d2 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7961,7 +7961,7 @@ static int btrfs_dio_iomap_begin(struct inode *inode, loff_t start, iomap->type = IOMAP_MAPPED; } iomap->offset = start; - iomap->bdev = fs_info->fs_devices->latest_bdev; + iomap->bdev = fs_info->fs_devices->latest_dev->bdev; iomap->length = len; if (write && btrfs_use_zone_append(BTRFS_I(inode), em->block_start)) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 1f9dd1a4faa3..64ecbdb50c1a 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1706,7 +1706,7 @@ static struct dentry *btrfs_mount_root(struct file_system_type *fs_type, goto error_close_devices; } - bdev = fs_devices->latest_bdev; + bdev = fs_devices->latest_dev->bdev; s = sget(fs_type, btrfs_test_super, btrfs_set_super, flags | SB_NOSEC, fs_info); if (IS_ERR(s)) { diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 55f0a82ff5d7..ae317b0c39a3 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1091,7 +1091,7 @@ void btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices) list_for_each_entry(seed_dev, &fs_devices->seed_list, seed_list) __btrfs_free_extra_devids(seed_dev, &latest_dev); - fs_devices->latest_bdev = latest_dev->bdev; + fs_devices->latest_dev = latest_dev; mutex_unlock(&uuid_mutex); } @@ -1206,7 +1206,7 @@ static int open_fs_devices(struct btrfs_fs_devices *fs_devices, return -EINVAL; fs_devices->opened = 1; - fs_devices->latest_bdev = latest_dev->bdev; + fs_devices->latest_dev = latest_dev; fs_devices->total_rw_bytes = 0; fs_devices->chunk_alloc_policy = BTRFS_CHUNK_ALLOC_REGULAR; fs_devices->read_policy = BTRFS_READ_POLICY_PID; @@ -1968,7 +1968,7 @@ static struct btrfs_device * btrfs_find_next_active_device( } /* - * Helper function to check if the given device is part of s_bdev / latest_bdev + * Helper function to check if the given device is part of s_bdev / latest_dev * and replace it with the provided or the next active device, in the context * where this function called, there should be always be another device (or * this_dev) which is active. @@ -1987,8 +1987,8 @@ void __cold btrfs_assign_next_active_device(struct btrfs_device *device, (fs_info->sb->s_bdev == device->bdev)) fs_info->sb->s_bdev = next_device->bdev; - if (fs_info->fs_devices->latest_bdev == device->bdev) - fs_info->fs_devices->latest_bdev = next_device->bdev; + if (fs_info->fs_devices->latest_dev->bdev == device->bdev) + fs_info->fs_devices->latest_dev = next_device; } /* diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 4c941b4dd269..150b4cd8f81f 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -246,7 +246,7 @@ struct btrfs_fs_devices { /* Highest generation number of seen devices */ u64 latest_generation; - struct block_device *latest_bdev; + struct btrfs_device *latest_dev; /* all of the devices in the FS, protected by a mutex * so we can safely walk it to write out the supers without From patchwork Tue Aug 24 05:05:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 12453959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD6E4C4320A for ; Tue, 24 Aug 2021 05:05:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BB9FD61356 for ; Tue, 24 Aug 2021 05:05:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230293AbhHXFGf (ORCPT ); Tue, 24 Aug 2021 01:06:35 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:64380 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbhHXFGd (ORCPT ); Tue, 24 Aug 2021 01:06:33 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17O0xE7l014868; Tue, 24 Aug 2021 05:05:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=khMr4HDcj7gNg1bH7/m6wArQjK/aAXk3Sd8dykb+lSI=; b=nNW0d2UzV9Di37+KWbqmKl3V4WwMxK1BKjsbzsKv0lniSuC2NMrvJOtY1FYf1jVkTrhT 9t1l1LUf5HGTHLA4GoLXp4cEw8LdhgjlvYcOxsQbcMXNz7y3eoBBtweY0Fl13c+Gc8Xx omspFwSXymKHlQ8ZFc7SBe72/VcLimmaJ4H+qoLqsAXK1wUVe7Py84kr2lInh7ItAKUs vhEHJkA09LG0Ca+GyEqCKOSvId0UzX85UKxifAtpte92rgA4An1evZhRZxW0VoeN0LMv cio+bNyZV/vyzhUsHOTlci9qo8GlMQv6lkNyDKFa6BM+YPrPcBoSnG5zpvWjPvAPxFoy Tw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=khMr4HDcj7gNg1bH7/m6wArQjK/aAXk3Sd8dykb+lSI=; b=q8RNuKAXWLYYXoMy5kato6xUEmgPoBYCR/58DvAEGiBDItd5txW3fcUD9R0P3yJkXz5c ATC7lN/7DIeNF59CQl3HUk4n7fosVEDIQPZscTVv9cAK80mDC2cNh3HI0AGYVP8LSfNH +G057hOFUxyAqgPxYKlNUiw41epbUnhceKpueDfQnJZbGYe/o8h0uwFdphM4jiivw+tF 5jaDYMd3PPjGK5uqPjDZ7aknSy1EkLixGFGzFSLvpSlU9DN9p/JEhWkrXS8BCVwqhgEB wcDeLzM+f88NLJD1QMCs1kQenunJVYbjKmjhNsh89G29Wo1HBVliulG5k9prEBY0UxqH Hw== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3akuswkby1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Aug 2021 05:05:45 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 17O55OmG062250; Tue, 24 Aug 2021 05:05:44 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by userp3020.oracle.com with ESMTP id 3akb8u1jay-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Aug 2021 05:05:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BB0GzNYzPQtU8YyzHnZdZ28FCtL55/r+WR9xE2c0xMrmph7KTRNyWKXk/OfTJI9ym34zqeDi6IOr9VSPJZPy+8EGeNoWQ9Uvss8ZaAd6nmnjka2XRz2N+LLSXN9qcFdQxSpUIQPZ2umETQDvlilBadoc4wKexhzdGtjfcN+5paw9KqA4B/VYae7nSUoUfjybBgHp9afr9TYKmYBG+OR/aUxjyfUuusf1WpaIl4ySBvkPzSGKkMHxbBOeZ+rbX9nmidYgUVhI9tGFyfcJVvu8mO5bKf1HT+991f/xarCnVwmM6a52fTkrOiMzvbuVwJl+BKikAB2vMfqd1vvYZ8QIyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=khMr4HDcj7gNg1bH7/m6wArQjK/aAXk3Sd8dykb+lSI=; b=eJww5YAHbO7mgqLH3Cs07PUvbkqnsolwKVsNKF6kWXAJ3p7t9xTOACW54KnlzGiwC5Behnu2Y83sODBMvGY/l9qf3NjtC+NPiWz4ECldSNynzR0m7WX36b+ecKGzDhazUVbga4XC5X8+dicjiyheA/axBcsZAqzR0BBMiUmgxNC8pE6q5kX0KyLHHZwmYxAIBiarrTeQ9q2pQaefPAus55ZbJVgzmnoUcCIn3e9uUy6GL4E+n5I40l5yMdatB8fBuLBuPxFhbezpKktwzKDTKrdXvcmYytfMHHHhypDkmjZOhmWDHfnyXVE8AyO0tzHhyC18163M1HdkzVa7Qqrypg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=khMr4HDcj7gNg1bH7/m6wArQjK/aAXk3Sd8dykb+lSI=; b=Cp79+9RSZ6vUD1d1t2oiB6Z5/u/bE5B737K2vpywJ1L+ly2953VdMbdjXG+e6JFdhzcdaLPXJ9i+4XvQTqmNkP5UHpfHXJ6d1znpSl5VAq2joWJtv4iJQ0KOAA9disWEYiGYM7R8T2HHbda0YGCGaEdyR2pMfwUNSSfGGwQB5s0= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) by BL0PR10MB3428.namprd10.prod.outlook.com (2603:10b6:208:7c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 05:05:42 +0000 Received: from MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::b813:4805:31e:d36a]) by MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::b813:4805:31e:d36a%5]) with mapi id 15.20.4436.024; Tue, 24 Aug 2021 05:05:42 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.com, l@damenly.su Subject: [PATCH RFC V5 2/4] btrfs: use latest_dev in btrfs_show_devname Date: Tue, 24 Aug 2021 13:05:20 +0800 Message-Id: <5d254bebd4afefa42e8c56ae1002354c04c7112c.1629780501.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) To MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (39.109.186.25) by SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.6 via Frontend Transport; Tue, 24 Aug 2021 05:05:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1565d8c1-579f-4fe2-0c4b-08d966bcd27b X-MS-TrafficTypeDiagnostic: BL0PR10MB3428: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iV1whpTZOFZvnHkascboLdib8YxeTmTN+1xw/Nfa+ZrAjlrcDIcR68o8XcX7o4kxwAFh5oS5rPEBbB/kxzmJ1J8BVonKazuAjOPmzcd2hCsBMzCoXEGx4FLHFJQpEEZTLuAo+X3RbMUmI4Ry2jPnjez29dnCooHuNKLzPQpJ4PruAWBr6KOwiAjTG3dMvy/yUYR9+j6jLmxHAiFwt2bmjVQCjt81vxVilsjvBid51/xTxtFqu67NZBR7Qv+SzllWGJ1JdfGl2KK5o5UF20EVl3JjafaVu5+oJD+DkV/4mRPTOMN9kti1w48YlTBOe8AqAXlAWlmuuxTtLeCKSucnNBOv83XxeehnQ5hXlV+ZhdRIM7csSB5o2mhUIncG2X/JRJ/64iUjU1IyuyXPBqCyqeNio+FR4x5rB12LeBKFQCHbWM9Z/iWDZ41stNKai7KEYBXP2o7F9pC2laZZfeKFqMT21j+4xAtPGLCqFaTN9Ri9dT9V8JwD/3+Pxr5+luOcd0+65R+kcaPVWcrsAJwTczB2mZT9+xsP4InvCcCwFSVtu/ccYaIShjWNJdRKiJM6fSr0Y3kSliEqK5F40LW4fIzSV+D8q1bU2Tq4CVP+QIBpJfkT+ugijO9uIvfjIt/HN9CrxqNw4aP0aWJXq6uPi0fWQg5+oYBLnJS0QVaUj6/QDOuUQj9MfUZEF4Jccrn9T6PpAa+Xv9Y2ZFEKL0WEsA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR10MB4128.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(376002)(39860400002)(346002)(396003)(136003)(8936002)(6506007)(6512007)(956004)(86362001)(8676002)(2616005)(66476007)(38100700002)(66946007)(38350700002)(83380400001)(5660300002)(66556008)(478600001)(52116002)(6486002)(316002)(186003)(4326008)(26005)(6916009)(36756003)(2906002)(6666004)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4gc2/FDdeQIcyz8y3Kqh5KmTJW60sZIIY3UaRymxdq+ayo2Y2D5lys/nQpV2LADhSqu7jpgFWrcfQ6egcbBWf8cX2aV84/NPWfCseGEHysxYoYPujv+H7eC9tS9bi/iqvp3Bw77tYaXJ6pGyn8GFtekiwYljYBR/YwiHfugVBFOuhRCKv2P7AlW5v1DQ5qs3M8md/tCYeT4NIIK5vjWC2PIiHsdkdtO4UxX5FlLAYsBtk1F5jFdreuLJ2gXJkeB4J13++ti1j1Zi9FPOVd1uCaFfQY2fL7ksxvxvqvmCveiYLZ9JnKJggiB+HP/Sg84NqtVQsbNN3DaqQOqRSYFY+cRMk2JftwcUbPxpvQhwXsFnfekS1RoTnZf9TWGLPo7Tbe5EQM37HqiOwyTNApQDEMVkuqTSd/v3vAxDWGMdXk9UAxUjrCFln+e+QK1k0KSt5S0gN2Rp1TfD2oRIK8rqtfpWg947fMO8cinnyt3JidbnMMDdktpbpe7D1GIS1Fo3+cIPfBsryvlAHbUtqgX7XmmFh9YkVkYnARMTH3Ql48wGyFmk9nAaEzTvTAxTuP3tg+DbNpcesmjpL4tpFqd3Ku8gMOuGHRohEbGpY2NV4vmD48oZQkHFJSYouKSymjwRpoKQDLdRl/GP8WhEJmjr0HlahERL2lsIQqCSkZbpc4nZQKNfKD78iRZaP4d/CtFf5rmwNV3AJh+BhLm54HWrO23Ij5tvDfcfu8K+1FtWanYykY6qweh31ro2sVAygfovBTvXmYkXIBHJVOIz14c8WydQEHhCAiaKfXfdQ3G0PQ51jKglySR6t+fhIUpKuD9y0v+zPLK7d0ssFN6PBw2xneP8D/WPQ99wLOIcJ938PI2tKP2vXBWh/1Rhkrf3tax8R3Fobx2RpqhtYvSDz8uxC3/CBTzrC3Q5l1QehHm+DE2jJ0jztHHb1w7xHWj+gEWAmgylEGY5vWDfg6uO8RiYayzIIKK35sKJRgnohkyFKuAkVj+U6r5NOlklnp3cxJBBcIvFDXEZkeKtiHrRuCsCRdYnSwqxJAHBQ42tw8KaOACShIgg2GjV1gEqrrzA75RJtNmL+mlzMbtfhqcK8qeVevVe5d1iMUoL1VyQ8jomHVt4PTzgk6JRb1PasChBXdsSA2dMlLvqLrbEeJz/lfF+ZNcFlp+DE8gE8AGnTfDk4hLPSvUH0UoP2mao5kIC+2xxWiJSq280k+0CKYAy1hcdMFVkrz1ENlDFYA8qkBhmNajkdF18YtKvkOfC46b/QzZvu1k8oJqde8JaQJBdxKoDuGUZRF9qTpi5qFyP0epQkSCJ5F53ga2CEwhcIQVjUDfU X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1565d8c1-579f-4fe2-0c4b-08d966bcd27b X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4128.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 05:05:42.1735 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FGyBYDVBqUp5QKl9X0ZLfz/bcOAkHFKexOcKaSzQ4fWJ3kL6xTcJEjkLdQrD24B8DBuujr7TxrLQS4n97U/HDA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR10MB3428 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10085 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108240031 X-Proofpoint-ORIG-GUID: UNlKEKH9aZsKLBFHaSaZjkpr5_BMybKZ X-Proofpoint-GUID: UNlKEKH9aZsKLBFHaSaZjkpr5_BMybKZ Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org btrfs/238 reports warning as below. [1] ------------[ cut here ]------------ WARNING: CPU: 3 PID: 481 at fs/btrfs/super.c:2509 btrfs_show_devname+0x104/0x1e8 [btrfs] CPU: 2 PID: 1 Comm: systemd Tainted: G W O 5.14.0-rc1-custom #72 Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 Call trace: btrfs_show_devname+0x108/0x1b4 [btrfs] show_mountinfo+0x234/0x2c4 m_show+0x28/0x34 seq_read_iter+0x12c/0x3c4 vfs_read+0x29c/0x2c8 ksys_read+0x80/0xec __arm64_sys_read+0x28/0x34 invoke_syscall+0x50/0xf8 do_el0_svc+0x88/0x138 el0_svc+0x2c/0x8c el0t_64_sync_handler+0x84/0xe4 el0t_64_sync+0x198/0x19c ---[ end trace 3efd7e5950b8af05 ]--- Reason: While btrfs_prepare_sprout() moves the fs_devices::devices into fs_devices::seed_list, the btrfs_show_devname() searched for the devices and found none, leading to the warning as in [1] (above). Fix: latest_dev is updated according to the changes to the device list. That means we could use the latest_dev->name to show the device name in /proc/self/mounts. So this patch makes that change. Reported-by: Su Yue Signed-off-by: Anand Jain --- RFC because, With this patch, /proc/self/mounts might not show the lowest devid device as we did before. Instead we show the device that has the greatest generation and, we used it to build the tree. IMO it is ok because /proc/self/mounts should show a device the belongs to the fsid not, necessarily the lowest devid device as devid is internal to btrfs. IMO this won't affect the ABI? fs/btrfs/super.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 64ecbdb50c1a..61682a143bf3 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2464,30 +2464,12 @@ static int btrfs_unfreeze(struct super_block *sb) static int btrfs_show_devname(struct seq_file *m, struct dentry *root) { struct btrfs_fs_info *fs_info = btrfs_sb(root->d_sb); - struct btrfs_device *dev, *first_dev = NULL; - /* - * Lightweight locking of the devices. We should not need - * device_list_mutex here as we only read the device data and the list - * is protected by RCU. Even if a device is deleted during the list - * traversals, we'll get valid data, the freeing callback will wait at - * least until the rcu_read_unlock. - */ rcu_read_lock(); - list_for_each_entry_rcu(dev, &fs_info->fs_devices->devices, dev_list) { - if (test_bit(BTRFS_DEV_STATE_MISSING, &dev->dev_state)) - continue; - if (!dev->name) - continue; - if (!first_dev || dev->devid < first_dev->devid) - first_dev = dev; - } - - if (first_dev) - seq_escape(m, rcu_str_deref(first_dev->name), " \t\n\\"); - else - WARN_ON(1); + seq_escape(m, rcu_str_deref(fs_info->fs_devices->latest_dev->name), + " \t\n\\"); rcu_read_unlock(); + return 0; } From patchwork Tue Aug 24 05:05:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 12453961 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3562AC432BE for ; Tue, 24 Aug 2021 05:05:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 162D761212 for ; Tue, 24 Aug 2021 05:05:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230497AbhHXFGg (ORCPT ); Tue, 24 Aug 2021 01:06:36 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:1804 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230038AbhHXFGe (ORCPT ); Tue, 24 Aug 2021 01:06:34 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17O0x6Wn014800; Tue, 24 Aug 2021 05:05:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=Vgowj+hHT/nuLjd8cRnKFHuTZZlYmmKnABlNfvjXU7w=; b=vnyh2lLivK+A5+GWpSsRJ2fBEy2h8M0fD1QRZ76pgbcqXM/loVGj1xY1YhuRvw8Po961 DTE7K3UHIB0QCAh1VPjvYcJnsD0XS0tSbmXs0V2IzgZn1g7bl85GFM+904exMbY9Jvok THJn/zLPun36K28JAX9+ZrTaWEk5/Z6frZf7U2SDnNzhCK7+U45EhFPkhK0gqUGwZr4f NGP1zPsy4Isu31d8tuX0otrt4GRvBlnKnMYoce4gh3hbpoHmT5Q0CNp8n/Y3R1PeRCxG 7hD4uK77qzZk6EutPD8ErzhK3zPo8EqP8j6tKUGLV6YGuLq8G7Ljvhuf4S+fmV/1i3Fe gw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=Vgowj+hHT/nuLjd8cRnKFHuTZZlYmmKnABlNfvjXU7w=; b=g1RBA9K+C8ql1Un6dLLFqY5NTS1RlREWvPFQmBc1lITP7FgzPcovzFV68cMVKqcidiOo RT4JdROr4KrDoRFUj60LGe/Mly/Zzl+/7ZiXqQB1kzTmZAOwI6U6MNsUGbOZC/h0eqKu pIhvbK6t9Z8pRumxHpqMCwqSbWCJxSLUWq6zWg2Q79ZKMdzorcdiP/Ezvkp5T9vyvENw vnG3ZE2nnIQQGwedXMyzl+p9y2MPvdJcVOWCpyZ+3RQWRsXO3dyHkslrrT/G6NDapB1R /tyhAV55yXKp/r+r2Rlt7NdoeKqcfm58OsuFT6A9lFcRp4Gd0dvqEBBXIDFlaowqnTtv lA== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3akuswkby3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Aug 2021 05:05:46 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 17O55KCI121891; Tue, 24 Aug 2021 05:05:45 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2169.outbound.protection.outlook.com [104.47.55.169]) by aserp3030.oracle.com with ESMTP id 3ajqhdwwp6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Aug 2021 05:05:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aQRQ02I8UTOXRrLR8JuXFIxZbvv/Z+Ae/vuZo/Cbba+KXXdJSSwYyCWjvJooafGxOPZBJqB1EoXuMIuGUL4cNdIg51Q8AAZbh7r68e7xJKV95fI5bKkoYuRBG6ic2M2JSRE4ZFnCcORavqgx1J/OxHdDFVh3aoHKvDXjhOcNlEqb71fV3cfTEcRwLkLwoY8FBV7oUgS+F1ytxH2Wzo9hVKbJvM0ODn+eNW7DgewMnTP8GdQJJDCzlX0gDefBVJ93Vt0X7jJHYyO2U8cqSF3xFcrywWX3CKJ1kFwWEYWPQ+r5Kppzt8mhmypBM0chC2+G3z8bZK2ehYhQIEGTCdIrMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vgowj+hHT/nuLjd8cRnKFHuTZZlYmmKnABlNfvjXU7w=; b=gnYVGpNycf7HYw6mEm7AkPKe1VzcZUIPEUrUQ2PibMaL9sdR6reRO2GW+A1Af+lNZk31hBOWfWKEuSMzV9Mg/5C81m8RL07OQjannbSSCqInucjrUo80HPQLq4gQgRkTI1XR62uO60hTHWfI+73Y5UYgFchMSWQjR2WQVbMxYS9qcTYd2IdB7HZFYRrw64jo8X1XyVTLPvRv5XJZO8gtIasSVRW+cZDdfapq/Y+s5LTf1dXNuH20QwbVXXKWbXbSnV/63yuqNUpRNPVMROvY3SSyG4amcGFVppOJ7/BPprlkcOHlJWpCdx04B8RXgzdyod4KkxVRVLhyyp8RIHzPHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vgowj+hHT/nuLjd8cRnKFHuTZZlYmmKnABlNfvjXU7w=; b=jfGriVYN05G4ZP/7fAGOYea8yBZOQmMHxk6uU1m14o6sGhvVKNHCp+Jh7fvxSx1zmD31DdReIX44SiuLYp1KTFPFekcgIMI2Y+XZt2RArM6MfqWfOYKg1WaxrvFG3rsV1L9BM9lRWQDERldp9SCR4EwsrSAIaaNtW+1F8RMEahY= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) by BL0PR10MB3428.namprd10.prod.outlook.com (2603:10b6:208:7c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 05:05:43 +0000 Received: from MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::b813:4805:31e:d36a]) by MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::b813:4805:31e:d36a%5]) with mapi id 15.20.4436.024; Tue, 24 Aug 2021 05:05:43 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.com, l@damenly.su Subject: [PATCH V5 3/4] btrfs: update latest_dev when we sprout Date: Tue, 24 Aug 2021 13:05:21 +0800 Message-Id: <7472e04cec179abc351e1ca86cd257c848ef1175.1629780501.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) To MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (39.109.186.25) by SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.6 via Frontend Transport; Tue, 24 Aug 2021 05:05:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4cf62e0a-c6de-4f46-4ae1-08d966bcd373 X-MS-TrafficTypeDiagnostic: BL0PR10MB3428: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2043; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JLRtSpFxGemXrd+Off4JQhV1bbwOKkwIpoPSq1YpnePGKS/lMGGe++8bXRPmfiRlKWnDMEwdHGoFgOql+UbJyHpfRfXe5Ia9H34+vYVqsi7zftZSf9dCizmRGAMTvtofUOQgRN6KHe9oefisJNxb2vgkMA3s307VaIZ9t/Wp9QX6lj5BrDLbdRrGl40taFyKC+SAK/PYBqJ6RoWGI7kKvycdu6cqUGOEeUnxbfgLDQufFQXFyHUhpUKcMCbFnj7QBBg7DDWZc1rafmscuiMtKA1JWLEVriDvERJ1d0va1ugq0TTJORIbk2rTZdBQJJvWNMV0bI1UZ7RA3T0GA0H+/uUfrCXxR5/leJAoY7lYHh/FMB4hJbXPP24ObqCUYBtBS+qN1D2+YWWzXuc6bpv9mM2N8KCEXDu/StpfYLnEApz77XihqBXdIMwwT8YuQywkY2hf9zbOM9vAc+ikRTGHOHNTI/s0k53fkYBZuce32LyqJytOPDg6S/9WcUPiQb0Onct36WZ2VzLBq+teESFPHHVBW+FcnCNjNQ4ba0zPeSLzqejlbfrOQmUW5+qeZVEQhSNFLYRxdjOnz7K7xBhguWC/LBR/2LnDgY9Dk5tY3B/lDMTqkPyTMom/cFguiZTm6mtZaN4lPrzef2BSPz8qpLhTbMWVTkQXpaSr407E6+vcKFKTYt1ZtFEPUB1XNvZbAJZ6oWF8wB/tt3DQriNoEg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR10MB4128.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(376002)(39860400002)(346002)(396003)(136003)(8936002)(6506007)(6512007)(956004)(86362001)(8676002)(2616005)(66476007)(38100700002)(66946007)(38350700002)(83380400001)(5660300002)(66556008)(478600001)(52116002)(6486002)(316002)(186003)(4326008)(26005)(6916009)(36756003)(2906002)(6666004)(44832011)(15650500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4qsVO+96JgLDHM1x8M99LV8BZcmIsbzEAMgz+OqKgV3IX8w+Pfsk8s/UOqmzdiznKz5EVZGUUkU/94g1SnMTeqtUqmDBQPEeqisow4ka6+kEpwjJNbIUuw/mpmuajNurs9A7z0+o3chKQsEZlP8LIL+bpJDXwnyQnSHBvWvBoGsBx3VdD9EVWctcGZf27UQnTyBJNrTbc7mdR5WZ6YJUsZT43P9kunS4wafmoIuGWESnOhCTQ5z75BIjjEnAacZKlFKoV9mbCfsnTNExtDYXBVsES1CuHAEjRl9ot7nDoVwtlDu3PH1/riLtD9brCojwANqRAPKxEJRJ9jIju7Q4LB2uEDQQT8rsqm9+ERHnuyhOW8QUvDIHfUJXSpo0oKMvQHUasLPdiKiOUq0hLxiuND2Oqln4wHvh+bAnKe2pxUQTWz/MI+UU11X7jOfBzDC572x0da2Zf9470klLia7c2/XeLxaLCfLWoXZLPdZY9q5AN2EqakZY4q7jwmaNjLmQIv94QyUT6v73QRYyjl3LsgrsNLSHBsSW9vXl71UfM3ISlcBCKtDgsPhXpZmXGdpBBpi6jJiaToKcpGjOK2VHVD7fDGmIryA05a+vdYHxzZBUkDXu3CYjykN2lyf/GfSQD2B9pwvcwbbtg2WAIvN4h0z3hHT85728aKPD6RZ75Z5kvV2oehDX34+ZiOhJ8zb3nw/LepnUlHHghPcZ/JFPqMhrGKd++TDiyUmd+st/e9fPt1FEjWXByVPKd13G1yoAdLYRpMa/i1wHkbirNVzNW+FFpaj1gRAw1CPBz+Jhb//pCRR8mL6UP9hHIU+mlFbfPpgoF/jtL+P0+dlsT++FDlIo3L3mK3RJIOgOgQ+ZWXtwyrAuQLc/tBxkWTivDejzkhbO3DJoX+Tt8v0Mjq5gEg0fJiGWheUtqwtQBVe0oSKDh2JBnr1wl1XONX1qUpOv871VRfuP7LU23+plbxuvB2HpYbZDGJbpdZdyj1mHx3yvLruiUa0rXF2FK1RJPl9dLGD7djaMpu35PnnzrGBqvlCccmU58I2XXUtUjvVT3JIfrkr116GuR5AFgvz/e8P3Ox/WfHFFUH/H4y5C8+QA1mRkV9hVmuB2vkYZgtiZTGHMZtPNUMteWasE0zrfBdIYSwqT4+fWZAOwiGzn+tjyANyf+/TLQV/83HFxTf44ktajf/IMTKw4P1hnBZ/uN6XRAwgSehGvzROm9Re3CrgfGX6i4dtrO6SIsvt0LtAgMeFVsfJsHV7s8bNB4YR+nBW1/51uNXuwgoe2SBh9fuN8V24Tlk0wWRO2obvTK9vTEWBfKCR/uG3tG7izPMOF3pBa X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4cf62e0a-c6de-4f46-4ae1-08d966bcd373 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4128.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 05:05:43.8144 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ClyM5hkHSdq854JTfW2SimlLPONxlRb2FPOc+832jTQ4l6lJA8zhrJqxAn9Ew8CQBU0LBjsItwH0J3gngQvtjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR10MB3428 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10085 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108240031 X-Proofpoint-ORIG-GUID: 3g-XPDjFtc0dWqAbhK4jZc3N8tzNShSj X-Proofpoint-GUID: 3g-XPDjFtc0dWqAbhK4jZc3N8tzNShSj Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org When we add a device to the seed filesystem (sprouting) it is a new filesystem (and fsid) on the device added. Update the latest_device so that /proc/self/mounts shows the correct device. For example: $ btrfstune -S1 /dev/vg/scratch1 $ mount /dev/vg/scratch1 /btrfs mount: /btrfs: WARNING: device write-protected, mounted read-only. $ cat /proc/self/mounts | grep btrfs /dev/mapper/vg-scratch1 /btrfs btrfs ro,relatime,space_cache,subvolid=5,subvol=/ 0 0 $ btrfs dev add -f /dev/vg/scratch0 /btrfs Before: $ cat /proc/self/mounts | grep btrfs /dev/mapper/vg-scratch1 /btrfs btrfs ro,relatime,space_cache,subvolid=5,subvol=/ 0 0 After: $ cat /proc/self/mounts | grep btrfs /dev/mapper/vg-scratch0 /btrfs btrfs ro,relatime,space_cache,subvolid=5,subvol=/ 0 0 Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index ae317b0c39a3..8470c5b5f35e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2600,6 +2600,8 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path btrfs_abort_transaction(trans, ret); goto error_trans; } + btrfs_assign_next_active_device(fs_info->fs_devices->latest_dev, + device); } device->fs_devices = fs_devices; From patchwork Tue Aug 24 05:05:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 12453965 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94B09C432BE for ; Tue, 24 Aug 2021 05:05:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A083600CD for ; Tue, 24 Aug 2021 05:05:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231600AbhHXFGi (ORCPT ); Tue, 24 Aug 2021 01:06:38 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:5010 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbhHXFGh (ORCPT ); Tue, 24 Aug 2021 01:06:37 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17O0x7da014806; Tue, 24 Aug 2021 05:05:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=qIa6aD6Jsyg9+rkINDAWL0ATP4JqXH6C9z1yEs+odd0=; b=Z945kdAVaEk64jYoRUYiqfqHpChvPMs+/pgzI96jQHvM5Du4TUuXDToSHpn7APxQQVBk bYIG6blekE1zFHz3CQRh6kaRNleH4JgCAY8MqqSNDGfeP6DM8BO3iJVo32oUjiUDLBU9 3wOx7vnLwc+8AdlnwHdC6FAIdJn+QgvkfSFFxfvtQqDLM95neiN6v6LAMbepWEgYXq8a 8an3WpiewdSw0ULXFi3al6nojKKgG3+DThSZHUKl5oynrQFn+lGDLQomK4EEX/HEN+W9 Ln4IuBqLXrKBKiIyt+1JszgXFABIj7WAtTJOJ68132xlwNem/QSWBHS9vOmzjXYVGywd GA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=qIa6aD6Jsyg9+rkINDAWL0ATP4JqXH6C9z1yEs+odd0=; b=etyN4NOxG0+oQ8hVtW/fHGUqT5HYQmihyAI82dunMdrIbB6iaIMrvij9WSbtEu1R1ZBO mA/BVdNkmSG1QrVp7GcUDDu6QE+V915I5zXwTsaWwGFhWOMIU+RvusJevOrAz7pZ3Urp WZPb61VX1JkF6jQEziHA2/zSOzaA4rBYWC47rBTmxAYmOe6gmXJDRKZNZh+ptJnfpaq4 oTu4vvwr/xMlSt93isdkt28pyZ2m/rmNXUIhgI4ecFyTpnLKkrIDPHd5Ml4u0C6T1Eee qZEh6MbV5AgF9CfXdDVkXrtnSXoxFCB/rkJdj86a/SpAUehYT8U/sroyftu4PNSt2P2c mw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3akuswkby4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Aug 2021 05:05:48 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 17O55WpX047144; Tue, 24 Aug 2021 05:05:48 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2175.outbound.protection.outlook.com [104.47.55.175] (may be forged)) by userp3030.oracle.com with ESMTP id 3ajpkwjyg7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Aug 2021 05:05:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P5c3PJKwrEO+i51zAsXXxUuXIfPIMZ3YFPzKEfUWcBRMCV+Rx2N/3PeYHa75MPBK/t19ptJE2N2iuGoXLmTkKl+p6At0L8R71V8CmmSarLZftnapt2/UfYJdwITYbYNCOEaT8mYnfTHwCo7v2MZBVntA8ZGWl6RA3A1yVPnzLEIL2bDW09l16aWI4FS3/yNMQgkWiuNc5R0wCdizUgNSkLIdJwrDpVLdEZMCSheQyqSh4bcJXybxyn5hTZw/4/+fLOt7cxQnkuUZU1tnN9Hu9UnG2gW2jSl8bEAvoSMnS04gOE/s7bzlVjW6Vblm5eZ0iag+Fu6HSdVEiyTgh9i1qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qIa6aD6Jsyg9+rkINDAWL0ATP4JqXH6C9z1yEs+odd0=; b=GgWK9RR/2gEfdeRw7qoGng/JxhEQ9IGEVuG+5PkRrfkJdEcMAiqVl05s5Es+2SMHY7wkT0fArsEKAgG5iIvEYV6ONjtqb5HL6qJbC9sYEruA5DJbkH0fzv1MseUlK3pJuEOLH91A3vB0tOYxFBKcJ5YKGE9zE35e1pkpJKerLiGurgWqx9wZuQQMwB71eZtKLSyNK198e4XxuKl03eDdc33QmN7CK1rzAL0v7ZLuwrBRltkzBkKrNYi6SXERRxbJkvStccED25w+Jh3uf3RvWdttVMmfCiNi0vdPLyhBy5hoMnU5QCZop/VJuXuN0LgJ5FfqoaV4J3iax/6KE4ESyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qIa6aD6Jsyg9+rkINDAWL0ATP4JqXH6C9z1yEs+odd0=; b=RvhhOlwE8dOsdpY9Yj90DcNeWz5Kru9bdee4G9TekkPRudi6HWzpK8T9Vn+ozfnZZrk2wACCbApTsK24G73mj6whOEl+VsUfINy/GgmFwVya/FkQBbDqA0ZFpMCnlHO8hxcf9PkwN+n3R2zyHcyQnURz6WSH+un79oNMPEhKWxU= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) by BL0PR10MB3428.namprd10.prod.outlook.com (2603:10b6:208:7c::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.24; Tue, 24 Aug 2021 05:05:46 +0000 Received: from MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::b813:4805:31e:d36a]) by MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::b813:4805:31e:d36a%5]) with mapi id 15.20.4436.024; Tue, 24 Aug 2021 05:05:45 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: dsterba@suse.com, l@damenly.su Subject: [PATCH V5 4/4] btrfs: fix comment about the btrfs_show_devname Date: Tue, 24 Aug 2021 13:05:22 +0800 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) To MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (39.109.186.25) by SG2PR03CA0127.apcprd03.prod.outlook.com (2603:1096:4:91::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.6 via Frontend Transport; Tue, 24 Aug 2021 05:05:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 00300c2d-392f-4251-f152-08d966bcd46f X-MS-TrafficTypeDiagnostic: BL0PR10MB3428: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:514; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TwDaNLOYNpgJ8y268qsXmoDwtKYt1rcmjMAgosN+XM4+WgtoFuxEYYGOslssk+5SJZbQ+9C716EGB0cNpww7lRqjWxTKG/+bzM2GiZsbEHmSahmmBk+ljJiHqUbhaYkgvltcMnhGGLi3p7kYL+aMdGCFQYy5kpmvaw0SLU5XXHhFlLfaP7CLb/2A3FaxyJ0Aq/gywIDLzMMYygT5RouwKyNjvLDBtFTMxJiD2GBKE9M0CidoOlK5goapqKMXzUYHBiXZ+C8wzKaRFd5lYdi0bGyowrytQus7+fklHoNalSq5cspvnJA2ogyITsOXwovpGbnzYlFGiyBt7P11xHuxnA6D4+bBr/uldsXMKODpO/dwXUt+xm9phzQJybYR6SBfTfq6tncivdBqkvCG5zBH95Nd+kxZiWVTvOcA+sGblKZt9upayJSwRd87vDqZs9fHbahcDjlpM4L4rBExi5ont+91qXAGD+7dTKuhR1GBYzyu4OZSBU8uW1FQpDrq+/JGYEGLX49TC5HBGz8/UkB4FCCSTXLyZcktyLO9DjrySIqZvIPpidDPBtUsM/gzY+x7DOTpCvgcYhXRz5bCG3bAqK+6IKpzHQ87QcUOst7mMnF8GnN1Q74vxV6niK6qGJ+GQrp/Z1kOmevw1jUyUTT+mJobu2pDSeXFn2taQ03pyMf7cvao+hTHBrQXltIg3l8m X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR10MB4128.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(376002)(39860400002)(346002)(396003)(136003)(8936002)(6506007)(6512007)(956004)(86362001)(8676002)(2616005)(66476007)(38100700002)(66946007)(38350700002)(83380400001)(5660300002)(66556008)(478600001)(52116002)(6486002)(316002)(186003)(4326008)(26005)(6916009)(36756003)(2906002)(6666004)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K8EMxvYVEo91SuwiGQEmtysrefjmL0dO/5PC9gF7OzhnM4LQsHFTDAOihTWBUXLgNpHRxyoeLWOyIO9ASjbZDXWVbCaK2JEehEP/C9U5goY2o4sBxh6hOhzTBu4w6XJYrH1ST0YukkKUjg3X3Z2mrz/LrDLBAIbZU+zVoJNB8diSowI6stjQUz7CEU6ewekfptdpphDVNwCk3KFU/2rXMUoG/VXyvu+QgpTpwZ1RgCLEE4WRsSl8pXl9BVeVu0pr+aIG7zbQXBAXIXn1ODLEEHXF4usip4DF2pZfIdySZLKe5MT1lxw4RXt7lMJ9raWNRIzVn3ULnpbl68LyHVLlvONAhEqLWNUa2t7XRq4D2FhQN46/tC0IPOi8V8WRQkb5qX2QqsI4xBCYaAomLXRE9dbV33cUfTTY4O0me/kY6eii7v366CwA5uku/hw2QydqF0lZ6D2QFPbS7F8glvlM1b3U1ztMD5aoZvoWT1UCiACCa3OvNGlo7ejtRJ6hv8bTMMA/+9Bx6N5szPabQdecIZClQQ/FQz+VfQvoeVycH2ObzfzYKsvZvAjZjpoQC+cqVuHOei3ZFffsziE7q/gXTV5MkLzQ/CMOjHbnEJhdnYXqa9hcbfiQmtdDcTN9l7FKybj/0m/+fQ2QfGkrXKx8t5KMbK1VwXVTgVX/ef68HbHQwdw0aToplVixOJY98EOD3XjryxvKRLItz+wB8hvVdlNAz0Mp5Aw/sVuNKPNWasFFfv5Y2uTBmj5QrTKUGuVj76T4AVkbw5+sI1B06x/u0FDTmwnzBosqk2Uo3U0vDSU0RUqO+iOzDzOU6o6rTyN8TGhfolCkxaefbV7g5SDt2yVWnjtZjOvJ5qA1YuTkm5o0u2GiEgAprp52Fe2KP4gC0Q1w4SdPMR+hvAA2P7XHi7qYdjHCJGXZLF5QyDeKea0HOJ1GnsEml9RMq48TAcuGKotsYFrVYMLKXTBzlcFb95UDaoHXzQeFI33TbcslLOOQQ0WCC4yIwzkfaUDZfy6ZqFgRsqpd7ZbuXKDwTFWN2vGORbWZXGxR48RTCHwfYy/3DMbFxgyTYgSATf4GGlj6OHs9G3K6zg5gpshW9qMcJ0UPwi3QCiCOKxc4UL6E8uWsByyIYMi39kp0k2e/sN33v9rAhuKDSj52iPDbueJw0ccjXdSM2jxLV/H8QPBe1bgM0GtWA/OyVOItWQohf0BgRDnm9aB4EJpGWVEN0mq+NUSC3cVW7vdSZTwQqTFO4jzE1GUV9pCxFn97KorGmFkxGH0uz9FPFOL5/JoYQY1WJO3vwgMHEevIG28l3Kr6hTRhFqZ6hyN+kqaLb6oVbl/l X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00300c2d-392f-4251-f152-08d966bcd46f X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4128.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 05:05:45.7230 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JHoqNvsNaFA/hOkr3Uqw4vwxvoH4gDcrRpp5+E/NkA5MrJ1HJ/9n7pioTmgrkzXD7DgXY3QKzHxFH3BH0eOgUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR10MB3428 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10085 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108240031 X-Proofpoint-ORIG-GUID: 9tjuk2YZbsEWRu9io5LPhej8B4eYyUnb X-Proofpoint-GUID: 9tjuk2YZbsEWRu9io5LPhej8B4eYyUnb Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org There were few lock dep warnings because btrfs_show_devname() was using device_list_mutex as recorded in the commits ccd05285e7f (btrfs: fix a possible umount deadlock) 779bf3fefa8 (btrfs: fix lock dep warning, move scratch dev out of device_list_mutex and uuid_mutex) And finally, commit 88c14590cdd6 (btrfs: use RCU in btrfs_show_devname for device list traversal) removed the device_list_mutex from btrfs_show_devname for performance reasons. This patch fixes a stale comment about the function btrfs_show_devname. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 8470c5b5f35e..1d1204547e72 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -2278,10 +2278,7 @@ void btrfs_destroy_dev_replace_tgtdev(struct btrfs_device *tgtdev) /* * The update_dev_time() with in btrfs_scratch_superblocks() - * may lead to a call to btrfs_show_devname() which will try - * to hold device_list_mutex. And here this device - * is already out of device list, so we don't have to hold - * the device_list_mutex lock. + * may lead to a call to btrfs_show_devname(). */ btrfs_scratch_superblocks(tgtdev->fs_info, tgtdev->bdev, tgtdev->name->str);