From patchwork Wed Oct 4 15:00:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13408878 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEFFCE7C4CA for ; Wed, 4 Oct 2023 15:01:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243020AbjJDPBG (ORCPT ); Wed, 4 Oct 2023 11:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233265AbjJDPBF (ORCPT ); Wed, 4 Oct 2023 11:01:05 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37330DC for ; Wed, 4 Oct 2023 08:01:01 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3948imht030725; Wed, 4 Oct 2023 15:00: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-2023-03-30; bh=duLxO0h8lUS4rMym+w26ecDpt+BxTc6oXk4Q34FAGZY=; b=WkSwwVQ5ZhEuh+tCX1NMjNLxVj4y0n2PELTRSI2ZQXC5qQnGWssW1C2mOU1zi+N1aVi6 Y0Hcke0IwPD/zml9VsW0oRIKWeKkdOLredUTo3V+S13w3bIYx9AJRzZMj4fa3vfI5hzr WQsQp9RXvGTYKGBWlPZW+aEtHssgeAA7iu7kbOhwQKMWSMn96w8jSTte1rX4DDcqT0qt YMCDnMljAdddom0vzgRQZIadN2dvb0smydmUzSBduKWHcJPz6s2UCMY9N5tjiOW1ghHL F2Zifiq8jAnXJ0vU3pYzbcgS8R/x/H32jjRi8uR+B4jxKBx64vvzQG45IAZt2YrjSGaa XA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3teb9ufbgm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Oct 2023 15:00:49 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 394F07b6002877; Wed, 4 Oct 2023 15:00:48 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2043.outbound.protection.outlook.com [104.47.73.43]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tea47p69t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Oct 2023 15:00:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LndDOIjFygGQwFbJ9+iBUAj+ipIMklVuHergV6saf3VAHvqTHM8qWzv9+gvDfSohqt9p3sxhgnT8h3CWWM7wv4PfX3DgPTdXXmKGA5IZIHjcwH9zlxfVI4JyiFJaF0mrE+KjvAPHCUdpKELIsD0JP3sfMhPDhInW4+reiWF4oxzMjFKa24p0zwRfqXRJlBvncwnSaRDrOYFxS1LLthOLTn9PpXQjrOn7Eu1JrsXtsDGfQMS+XWOtK4A2k+bKZDGNjDg+V0+1d0J9Z6y/8YYyWg3jSs8p8Y8DMcCovMQOnYc0SLYhvpSphb6a3dYdoAbvUJszfjJMx+V+tzo44Wqovg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=duLxO0h8lUS4rMym+w26ecDpt+BxTc6oXk4Q34FAGZY=; b=nMmpsRuS/T0Ri2PBFJPg7npaznOzgMgQALEzDEN9AdfEufFQtwEhD/rWKJPDtoEYVW4O5FItQueuFTlbBp6nkNU/2BO/2b4Z+f9okWXCEydCaAr8imiMiHoCFywRf48gbmo8b/6okgU4DUylLWtjpDGHafcwd49LOQRL70TY6aPUXtBMeXGFpAgxGCph+PDUUhCLTlvOU/Ticp/7el+um9VqJGXl336n8CzQyeYrj3uy+ufFfbP0IAm9+yfD6dd2QZUkPOt0FfHGOtelEZdruaNDaGtq3KTN/KXK4C6JH/V0JzzJ/jOUXs6MpVAxjsQhTnYOZhNaJkzipDXddZD+lA== 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=duLxO0h8lUS4rMym+w26ecDpt+BxTc6oXk4Q34FAGZY=; b=ieNOkVD128cqcD1zxbnVnVEa8GBpOsJ+QL5cMiP+XLjj0ocagmqQHAbH1xiTNwjN78v6XWPLB23aHin0wVsEJ2ZdkKt15pJ84SBLaVn5P5f6ANzB60YHaW1wcFej5lEu6kkyWYTPD2eUPk7QOg8pVPFrcKg4yinuSd70v5Yswws= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by PH0PR10MB5818.namprd10.prod.outlook.com (2603:10b6:510:140::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30; Wed, 4 Oct 2023 15:00:46 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::2bbc:60da:ba6c:f685]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::2bbc:60da:ba6c:f685%2]) with mapi id 15.20.6813.017; Wed, 4 Oct 2023 15:00:46 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain , dsterba@suse.com, gpiccoli@igalia.com Subject: [PATCH 1/4] btrfs: comment for temp-fsid, fsid, and metadata_uuid Date: Wed, 4 Oct 2023 23:00:24 +0800 Message-Id: <9e564f1c251d757f2f0c5a62833999b512345eb6.1696431315.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR01CA0167.apcprd01.prod.exchangelabs.com (2603:1096:4:28::23) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|PH0PR10MB5818:EE_ X-MS-Office365-Filtering-Correlation-Id: 09a49cd8-e2bb-40f4-81ba-08dbc4eab078 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4D8nj/BMCTV63qvHdCCc59DiG8DQlFWl7srdfbyL8QpYY3xsYe+Zyqr9aoZjVM/xHpSbrQd1GGyZu2THf7+BTyoC+T75NevFXtMvKi53L/kbVR9RB1edbb2y87bWlIzuI7AMRc+mGYkpriqKLwumYP/6mW8osi6RG214Voo9cEhxKB0SDEw6rLDELGq4EQl9e+85egjPCQoLXoolDZBGd0wbOd9Ek3vMia4XNWsbkOduUSE8y2slSUP6E3fYXtXg0uz3RwtLp4jdCzDmKmWCK43M2FXOWJuTfmFoASXfNI8jRqBlzCAEdNyzbVo/BcKHbOewfQpEvCjcRUtbCRD96qE8wJrfqCUxVHt69bl7mCFoVCxy1bYwkLrcTcjb9vxpSFsYBwsI+EJVjRmvTr/5uCkXTmEpUbgDsoMhaCzDwoX5sFwgaGwuJd0EQxtZxgivmRGITCbRwTA4xUvpeIyWHSHtB/Uyz3IE86NFmyRrY84gY75BUQN85UkbZnBsQvhFnsZErs6P7YvvqrYtxzVIP2GXh1asKyUdcWRI/YLiVithzNqLlHtiq10Jd3E5Fao6 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(136003)(39860400002)(366004)(376002)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(6506007)(2616005)(6486002)(6512007)(6666004)(8676002)(4326008)(2906002)(4744005)(66556008)(26005)(66946007)(6916009)(44832011)(5660300002)(8936002)(316002)(41300700001)(66476007)(478600001)(86362001)(36756003)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1qU18dSAo31GUqqdwwQBtTLMBaU5SDLyRdSCl/72wrjKahzTWIb4sWAR1N5CH5rhJbWr87/2fLg66M1Uztetm7GAkfyESSZCZH37KJG0EX299vfiOaK5lZsC+eOXZybd11CK1RgwQY/K5KAzqVI4wpNW0ySly0eNkuQC46kcpSQUfoKqcKLS+C3ZUKY9f+K9W4ZIKIs85BwWRTEYNCAIh1FCTwV/E59aWd3mvAnfw5qbW5Hi1eheSnc8nEiVe3r36mhcRA0NVplO6WihMHCoVBJhoW7bWU98D7v/I1cXf+CPYhnpgdZ7bVZond7kJIgl8PGutTMjcL4XthUJSf4Lbw20A688+IYqbXR2UsNvkyBCQnm3IJSF35f6Ztstz2YrRu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N7JjzcMiyCWzJi17Hew4SFDp34d4Y57KHCEIQoldcyyJxVx1oLiQkwY2NvlMg85diVRFGl60CdKXeX0FlfpVr0z38Vsd6IC5G0Zdb3hdZoEZ7ij6LvclkljxqD6Roadsz56qzwHQrVhY0BU5DPHnh9bi X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: quPP6HKLL60paRZltzfGQlWH+BChBWddQzGz8cD7aLaMA2JvFR0x+z7f1h798ycjkfLPVbKraAWeE2qhyFTFmaWEpNSDmy+mONNW9SmNTr6GhGY+JhbN8986f/xYcWbjWTcWuzlZB0+vqwXuQawQmWExk7dlg4iKxYrN7FD9cieiJuMD61+O9rxEKi2nKuz7bqxQEgJiR3SAgL+8Fao7IXYA4xnyp+SdOOJ94C2/7+2mThuJ68t0raEg49WjWPlZGjKSl291bTsW+C/9nC8VM7N6A6IA1QxQGpjkFsYNcfc3MF53vhiYmpVT9XQfLd89t/Glx+9W9AKJBZ7bN0VoQoWyeZSXwYJ1YEYncUZh7pxCuACO73SXVKYWlAoNAIFZpDuPM7ukkIFDTtld6ZgBnVyH2uOJT/RFzS4PssTaAMtTvIf4mMrNxYGN2bTbZAosTZl2ossPgOj/GwKY+gBObYmTcuwDmCsY7tIfJ5XOM2m71vSAnngY+RgrNmi2EM5Dbqcp4l9wlfcPRIf/4C2qNM1Ss8vLuUkyggq/oMoOnUKrMLYxAVnOOFJaBQBrhPmg6eoUaPyRYHvcC4ZZA3tPoziY2fVgMH56SJjdSJxsVZNNFFATAqOrFZfomBLywypP1BnvjVBPTa4UDOkDAEo0MTD7ignr/nHvfsumddhCxP7aE1eMgv3pFPxJK600Wgl9DLOU1SNYPDmKCyQQROMhC57sF/L9e7CFUeuBLBftEqly+0GKowZYiR1PkxWvZoMLpAOzWVtGnOmY5rXY19o+XtgaVG03gJlfd8Yya9T364HvxJG3rRoJHivVI60jJiRb X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09a49cd8-e2bb-40f4-81ba-08dbc4eab078 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 15:00:46.6151 (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: Xel0XGHMftqn7+IEsDq+mjrZhI1l+IRyfpRzBz5lnqQneWRhcC3x0EAESArpgVIHXNpH7zKQCStkj0nKS2mBug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5818 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_07,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310040108 X-Proofpoint-ORIG-GUID: vRtcLlzyXSlBPpBswSYIp_X6z7jKwumI X-Proofpoint-GUID: vRtcLlzyXSlBPpBswSYIp_X6z7jKwumI Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Add a comment to explain the relationship between temp-fsid, fsid, and metadata_uuid. Signed-off-by: Anand Jain --- fs/btrfs/volumes.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index fef46c0dbf19..5dd4ad775e5d 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -299,6 +299,10 @@ struct btrfs_fs_devices { * - When the BTRFS_FEATURE_INCOMPAT_METADATA_UUID flag is set: * fs_devices->fsid == sb->fsid * fs_devices->metadata_uuid == sb->metadata_uuid + * + * - When in-memory fs_devices->temp_fsid is true + * fs_devices->fsid = random + * fs_devices->metadata_uuid == sb->fsid */ u8 metadata_uuid[BTRFS_FSID_SIZE]; From patchwork Wed Oct 4 15:00:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13408879 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F904E7C4CA for ; Wed, 4 Oct 2023 15:01:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243021AbjJDPBL (ORCPT ); Wed, 4 Oct 2023 11:01:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243038AbjJDPBJ (ORCPT ); Wed, 4 Oct 2023 11:01:09 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76955CE for ; Wed, 4 Oct 2023 08:01:05 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3948inCx030736; Wed, 4 Oct 2023 15:00:55 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-2023-03-30; bh=cekptlcR2GGDYaT0MclrZWe9imqnMJiCNeHTIDBiwtM=; b=BFZD+SEU27U550V69ORXJ13DOi6NuWRsmKn9OlunJj7m6DKkyrbX6O527PmcVkjvWQdY BpHH0FT4ri51J6N3A0IAmhmamlcnd8dtFdeEVEIIdFkc/BR5QzJijhJeBSM1lTBH03TY Lq12gP/pP5ZfKaN2b9PNq1D6OwTM18FvXoHhabCbaYxamiAePUgc6sb32TNw1fZIe167 eG0OFGBOEmFL1rkHm3b0aeqx5uSlDfsT6tYuYY/3rLWExGpghd4y/2H48mO+7DX/zcjs RNqxfNI6HlRkPUyunFFWCgj7UAnsIut60BvqplBH4bdbn7pu6H1iebfxu692m57NtQhz AQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3teb9ufbh0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Oct 2023 15:00:54 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 394DK6Zj008713; Wed, 4 Oct 2023 15:00:53 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2172.outbound.protection.outlook.com [104.47.56.172]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3tea487hsb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Oct 2023 15:00:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZlE7Fg7rR5uKA3Mn6Hr8ItTDku/k71vMms4+imHISajYdKe47lCQujO1x90Y2gMKsuiSxNuheOFVzyovSStsGcKBYLyfI0TKE24beXkVMdbqLAc5M9t2w352TziTFl5Dh4y5aizpTpOtlXZk+5Xi5pz63NAn2WLd/nCoBBpt0LmeuXjr5JZvnwpveRU3l7+xbh7lbZZM9JtXzA1PtfQBXH2pRSVYbg13eMMNqKuZqhNce2FeoHrPuTvjVKvpticHBV41iUyzOZSJly4Q553+83feOOqIcaK36225igQJ7EOJRYlqquZrX9dqntXPRSrQvqpNK9CIhiJbNaU0kUQdJg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cekptlcR2GGDYaT0MclrZWe9imqnMJiCNeHTIDBiwtM=; b=fwqCX7E2PaRkS/5e7ViH/LGDsXpug69B6coxTbyIC5rnZe/mbwJFxpKIjnci6xplyf8xtjchlOnki0kov49KJH3E7Zw86PsAmhKDtAaO2nBz6xBfVEFJoFS+jfAGSWTAPP1RKZsLBXEJ3YOg/QqobTU3OpcomtyMM4Fkxd1S5cKWxXBRqyfBJw6BNdhXOxUp95RQS5CFnaptHjuoMg0CHLhdaOvJ+srRoC4fyOcwoWVDXZ5W2xTmYnG7Ucgmy1k74rWlSUOsjdTdsPWHx2+ICbXvNVQWZC/XGDRvSGmBPHjns7BvuRmD2BmwJ1VjTUdEuE+rD0OzreJy+IOnBEreHg== 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=cekptlcR2GGDYaT0MclrZWe9imqnMJiCNeHTIDBiwtM=; b=e7mPu0opDq71U89b68OcPxED1KE0+L/t744SApb6CFp1zEHWw90dSz21/rd2kFPjgy5yi+NPFeWm9PBUIOGeOdPqHLa/J6UnnyY7jbyUmfbYbvdC1qfImUd1kidfwCKjtUoNhHEIiw4Ye1IrhtPozrMISnrUGGuS5Q4jxHqfp+w= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by PH0PR10MB5818.namprd10.prod.outlook.com (2603:10b6:510:140::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.30; Wed, 4 Oct 2023 15:00:51 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::2bbc:60da:ba6c:f685]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::2bbc:60da:ba6c:f685%2]) with mapi id 15.20.6813.017; Wed, 4 Oct 2023 15:00:51 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain , dsterba@suse.com, gpiccoli@igalia.com Subject: [PATCH 2/4] btrfs: disable seed feature for temp-fsid Date: Wed, 4 Oct 2023 23:00:25 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR01CA0169.apcprd01.prod.exchangelabs.com (2603:1096:4:28::25) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|PH0PR10MB5818:EE_ X-MS-Office365-Filtering-Correlation-Id: 43dacfc9-d729-4f3f-f305-08dbc4eab313 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8emT+NmK4MkRsB4J07Bc4MRFy63/rZtALyZFC8aBgOkWnUmAde3SBEOGVbFoblXhwGTCSJX5lCAPOen14hq2l5eDc+ZhnXmpXTZlg3CP8NdWVq1oiARV3JTKG2rrpneI7RszqE7+d1EPDh7kNG97BTHctAxO66Edw2MzF4s9fu171gWN3ZP28yBAX+Kf5PYvGOh2Z7bAqk/w5Rzuc+Mt2fwymeu3VN84GkMq6vaYQ6Ux7wCg16cpsPZFphyV8zMx0DTBlB2fxUHSZy/EtoHKjS7U/agCXgUHtdtDD+T7Q0sZeOVMzZfAZpOp1odHkA9IZLOLHfkAexPSPUE1Ez/aL47O+yTJF1rklY5KWQp9hFCMF9kSrgXBmU7gNQ0nvrYF5UH4HEFZlZlwcSmclwP3h8eoZxpJsYQiwzeP9BQ030LjYGmGDT1fNrp1UTmhOrvnVKEizPd5O63DAl7+H5LS5F3V0ZIBgrKlrL++aurrWTKKF/Uy2oAEHzMAcG3Cz+1yCjFTKgzJPYDGhx20Jt4lBS8ZaCWThvwaRD+WtV/QOATyjRPMTCLp8/X6Td17Ka0c X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(136003)(39860400002)(366004)(376002)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(6506007)(2616005)(6486002)(6512007)(6666004)(8676002)(4326008)(2906002)(4744005)(66556008)(26005)(66946007)(6916009)(44832011)(5660300002)(8936002)(316002)(41300700001)(66476007)(478600001)(86362001)(36756003)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kuWT159A1FXYU27MfH5ya2W8LTEPWzgOFEK+VG80nNzqTNKlxBD91aXzvuXskJ9a8cd4LyHsynZCFWSMHr31HQVi0JX8jKMydwDAQfZ8uawqlR8VSnGcjikTQRMgpf4YHJm0+1YjSjmMBUmMT99bixSwKTuqgI8k8bb7XQ6VAO6e+2DPxib+eUTq5I9iVi2AkHMPfZZOngop8rJd6n4dmK1Ii9vE7crx9uXGQn2lOaJR7eiRDwJh5R71yVew6MXY7mxdmaGA/4Ql5brdckfG0V04EiwZihcxgVyTk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VxRPoMwWLH+YvJ5tz23TSYaOcouML1apZPZFDYCWl9FFjHCOzpStbTIZB0lkjrkvndqGCYrc56bQ3RVBlQur4 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43dacfc9-d729-4f3f-f305-08dbc4eab313 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 15:00:51.0509 (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: ZkJp1vA4vtuFylvUhsvugiW8pFJJWGaF68qdvWYNhAN0yTq8yErJ729vPWMI1YgTLwL/xUdKTiJTp6bWHtNLIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5818 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_07,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310040108 X-Proofpoint-ORIG-GUID: E0vFJpFoaCUi79fj-yZ_1zhojtG3SJYu X-Proofpoint-GUID: E0vFJpFoaCUi79fj-yZ_1zhojtG3SJYu Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org A seed device is an integral component of the sprout device, which functions as a multi-device filesystem. Therefore, temp-fsid feature is not supported. Signed-off-by: Anand Jain --- fs/btrfs/volumes.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 81b735f4efc1..1fdfa9153e30 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -571,6 +571,14 @@ static struct btrfs_fs_devices *find_fsid_by_device( if (btrfs_super_num_devices(disk_super) != 1) return fsid_fs_devices; + /* + * A seed device is an integral component of the sprout device, which + * functions as a multi-device filesystem. So, temp-fsid feature is + * not supported. + */ + if (btrfs_super_flags(disk_super) & BTRFS_SUPER_FLAG_SEEDING) + return fsid_fs_devices; + /* Try to find a fs_devices by matching devt. */ list_for_each_entry(devt_fs_devices, &fs_uuids, fs_list) { struct btrfs_device *device; From patchwork Wed Oct 4 15:00:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13408880 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 048F2E7C4CB for ; Wed, 4 Oct 2023 15:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243027AbjJDPBU (ORCPT ); Wed, 4 Oct 2023 11:01:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233265AbjJDPBT (ORCPT ); Wed, 4 Oct 2023 11:01:19 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0593C1 for ; Wed, 4 Oct 2023 08:01:15 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3948j9os012175; Wed, 4 Oct 2023 15:01:03 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-2023-03-30; bh=W8EWIPamRNepUteX3EsRnmKrFEtTEQag6I/nACioxzs=; b=ylDWTOG51EEFjZTWAvMLN4IJ1+g9Bqw5ShZErN/MxXLU9giz0CntpkYYdOOnhif+ivd+ glwC+LR2xjkrHKk/ja2jji2kd5YItCRVdG100sorTp7xhjiKm/a5rJP6cCmxcfmM3VVq TTjXPphQFOEY36zXNQSiWdgaeRi9OILirvwZ95nPTQLuaacCAF4ytxK8/Ko3D6hPL11m ah270/q9hOtVp4ae7OiOOKgNwu6Y+RxeOWMvTGYdPcoH5TXSLpQJg4gYiCKjHlc/44Ri Gcsp+wrZ3E07ZpGGcr6higEwIi3tWG4clhuM6mSdPpeBDYk/v8d1d7y29nTxkU19Ayij ew== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tec7vf7r4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Oct 2023 15:01:02 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 394EkrOu033745; Wed, 4 Oct 2023 15:01:01 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3tea47vwma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Oct 2023 15:01:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Feo5vdVJaaocWNjwtuILy+T4pW5kdnqDl0EVYt75TIf8YqLmv83b7Of4zh++wKH7O6OnBw4sqKDTJ4CYKW4COUS7+XcvgcIVnTxBb74/LLhRsA9zc2SfyPQXxFsSfzLgT1qLUlxA7d4PSOb2Z0cv2sRz9ZZ/xYM4CCwZPx+jH2U8aVtDk1OVRrAQU6WbNwxrI4k2Xu2yiV+d+2YfI5brFqDlevUdVCf3LzSClp6WfXFrE87/bvBJC6GviAqzIrtIGfcgXGpOfQkkGjsis2CLp20iYYUmNFbblpJUrK9CGzj383ufY4xX8nqhwCpOTPR5stbySCm7udfu/aPSr4gLwQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W8EWIPamRNepUteX3EsRnmKrFEtTEQag6I/nACioxzs=; b=RRrBKH4HoP3g5pHhWlFAPUZc2oYOsXX/VVdB072P21i3VpL9qiIC3l4ZgtI3E7AwZKM20DImYiUM2ycahLnZYkDAYHsMm5hjK2K68t+JskcJeP2Gw/7d2Ldz7MDUrrcHI4ONsNkOiZ9HLBcyDyoDdyialsY6IWRUKtsvQkjs6w4mIayVIDP7/1sUhl9FrXUlhU9xI2p1sbPdWvWuxWSmEEPKtLFuBjeRViQxEb0oJsLqt633ucMWaRVbJJQziEmnlgR3zli8VChWdaXD7kvnU+lYdY6Tl/nIgHU3xu4RPVli2q2B8OFx1rNhXYlq3C4mQ2iEPW1a/VaYZqEEvxbVoQ== 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=W8EWIPamRNepUteX3EsRnmKrFEtTEQag6I/nACioxzs=; b=uwr/Q2oA37q0neYrJ/r2fvDbmRLLMB+rJ8y1puyflZW+hAOYWqECdSGw2f8mchjk8lpbjGVgaLl3BBI3xYYyzcoK+V1w21CTR677viEMwUkoQznMrNJw2QT5xBAMqRPB1j25MCzKsm6quOaz5GATMwSqDFL49HW49MuByDHX5rk= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DS0PR10MB6872.namprd10.prod.outlook.com (2603:10b6:8:131::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26; Wed, 4 Oct 2023 15:00:59 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::2bbc:60da:ba6c:f685]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::2bbc:60da:ba6c:f685%2]) with mapi id 15.20.6813.017; Wed, 4 Oct 2023 15:00:59 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain , dsterba@suse.com, gpiccoli@igalia.com Subject: [PATCH 3/4] btrfs: disable the device add feature for temp-fsid Date: Wed, 4 Oct 2023 23:00:26 +0800 Message-Id: <496f6f7ad93236768f7df67d8ebd98a0fff6812c.1696431315.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR04CA0201.apcprd04.prod.outlook.com (2603:1096:4:187::23) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DS0PR10MB6872:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a40c5a3-91cf-4e6b-c9d4-08dbc4eab7f9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /eaFOqb9xXCM8B3g3jHOtu5hBNLMXcmrJ8sZ0m5Z/dxPr+IZOvrdJ0+WCKzijPN/u6/BgGEM/6ps3Lwea7HObvcUZBhdYm8GtzWjUdwE11TkKpAHxBl4plNxuI/zSqyghdUkoaNuqPA1nW16mhQG+2lflAV9YoAQGeQZHFYcBXJRbuxxj4s9N1syFRkFU0ovQQvQ+wypEnLSeT+J5V7ElywIg9eqw00r3gcSX19d/Psr1CsD6tBh1vPV85WJh77XUnPaTi+s5gGN0LzVSzBwj6qNoljqgoZffXWdl0dquEH9rXNNc3Cw4aJZcoAh1b6pAGPFStK9DwVYHm6/qGDIu/Fq/p7Yy2ULtz7d0/3405IifAl5uHqfyi3i2vUoB+6RDec0uufjHovobjJTHHoha/I0sw9dqYDudI01vXmZw4gbMvGddk0/I9wy3IP6Zc8jsLadl0QluVQdI2TKupww9S26Kr6JkIe7IL0z8AG7u40jfp1GeqiDx3OGaytaFixSL9O2gbcJnhYpCJRFHist7ZXFmyGSJ7alUOmTsngkKEs9V5Va/KTfCqjCcDrlCOnz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(39860400002)(136003)(396003)(376002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(316002)(66476007)(66556008)(66946007)(6916009)(2616005)(8676002)(26005)(8936002)(41300700001)(36756003)(478600001)(83380400001)(86362001)(6506007)(6486002)(6666004)(38100700002)(6512007)(4326008)(2906002)(4744005)(5660300002)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cSLEz6sfr04q0Jxsjq2euNq4wcIqhgAo0/Zl98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qu9BkwShjFYaLJWv1zipDZHmiLbcueIkTyI2JkVXlOk/jR126V9RhKw6LPjnyqnQ2webanC0v2WeLs8Mimv6vpEMb6SRfNBLvRpRIMFoRGD/dlLwg8sHazfU0FCwfbg3FPH4ll3VexfIQThNEzSqq+N939EqSyayW7p12LseC86hblfB2sy2KnPj1JmCm1Xr8KF+DVgJQvGuj8InYVc/KUPy4un+xnJQCAsLwQ/o5+msjyPbyKyUmr6C3dKcjJ/Wh4P0tkXDzz1bTXGf6z78zt7fuP5UYiMWX+BUoc7qzDf2H6RJoUsWBQCBJMOZvPZsySOT4uajwNsP7rBqqBXmATq6Si96p6VPJyEnySkux4HU4gR0JDcadLttdFpvlaxorZcnUAddMo1lE3lk8EDT2qA1H1lhePDnBfry1UCOqVkw76hO/QJgY1sQUKWwweetUY94tTZKZLFJT2ynMiFnZC9NOMUXixMha9D5YVM545e4UIDHUrh2NyyrewlAv9e/VqQ2WkEA== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +U8v4mw8JextDzAtt6FHPIGQSlQXZUup5tkNg5zUnsN0uvV3CVkB+6GxBbxeZmX2T8YfskCUMe0/PZyJQc5tmYHRKJJNp6pq8IpaLI+KdN911+5qAgxn0xJKoCu9aiCGsMxT7Avpuf0Ln6sJyfb3QoH6lzpJGfgIL0o8g/Usu9sFlqkt+kNHCe6kl2V+ENvulmADVo41M2oi6thlSFHdUuN9Fh5ulIs53zg0PxsQYzRYnLGJ92I2MUJBylhSj/KgH800Bk8UDOJ9cFZqKoTSlvzCeBCtn6AWA+WCj+LmzJuK/wKZBVSEQIywDGH+OuxbDvXtWCaqWToWSCdq48ztFDaTm3N2ersonPvYR3Ox5P26EMDvmIXJrooagz40lyYIlarHTfAkk8YxoWzaly+BXpCpSKV85NKRZ+dQXxGeJpD0db9sBCI2pNUIqyt50wvswGHVfxI02bEXhjWColL+KLQRCCDisrM9rPg+wLYcBkcR5UbHrcvC1KeLiDpf18UGKf5fqWNvNsHb4sbxRxXQf7w7CFAS+hFgJe8m8gzQeFgB1TEvt6YfUY2Lu9FJHpgjrIrBlveIJ+L8tPh+0KMygSErPq70NFRxG0M1P5cPGpFHPzfCvYZI7y7cWZyMW1y2hVeUgUyUXizvO72E5BNZD2WRMY8FyvWVSe09FDxGiDzsTjtYpLnV9V0ZKWFekfFkDd7qLbIO2hilC3yo7BylvXvXPUVrywe3QjifojGTvfk0C/wv2NunA1efQFIkBt0JGf5N1UT4Intr9pFn0voW+BSsaHfw0NhACk2Vt31o4WikeakxfyTgeseANWawaB+a X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a40c5a3-91cf-4e6b-c9d4-08dbc4eab7f9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 15:00:59.3193 (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: hLiiQeQ6b/s2G6H3nn4tm2zN4LiPCQMqdVMrbUlhgeLrG5FRp/jLR9K0uYmRL7uLhgENuADV1XHrwgb/78cG6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_07,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310040108 X-Proofpoint-ORIG-GUID: feXBoWcHdUYSQ8JmllLCLrHQ5ZQNZbjp X-Proofpoint-GUID: feXBoWcHdUYSQ8JmllLCLrHQ5ZQNZbjp Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The device addition operation will transform the cloned temp-fsid mounted device into a multi-device filesystem. Therefore, it is marked as unsupported. Signed-off-by: Anand Jain --- fs/btrfs/ioctl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 848b7e6f6421..7d8d217cf5fd 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -2635,6 +2635,12 @@ static long btrfs_ioctl_add_dev(struct btrfs_fs_info *fs_info, void __user *arg) return -EINVAL; } + if (fs_info->fs_devices->temp_fsid) { + btrfs_err(fs_info, + "device add not supported on cloned temp-fsid mount"); + return -EINVAL; + } + if (!btrfs_exclop_start(fs_info, BTRFS_EXCLOP_DEV_ADD)) { if (!btrfs_exclop_start_try_lock(fs_info, BTRFS_EXCLOP_DEV_ADD)) return BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS; From patchwork Wed Oct 4 15:00:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13408881 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14AC2E7C4CA for ; Wed, 4 Oct 2023 15:01:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243038AbjJDPBu (ORCPT ); Wed, 4 Oct 2023 11:01:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233265AbjJDPBt (ORCPT ); Wed, 4 Oct 2023 11:01:49 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30D27AB for ; Wed, 4 Oct 2023 08:01:46 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3948ivcv011621; Wed, 4 Oct 2023 15:01:32 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-2023-03-30; bh=Sm39d6HmetxGzA5+JmCCFzhOyzXzVIQOGaLPOrrg534=; b=1vScH0yQwjy2Vq3a2aR8xPBxKoYDbNTDlZakwH7Ja6r2ulwPKVahqjf2a0/cI/JlJ5lT JsIh3ARcbCgXta2+vv0c0o1cCaXjR6rb1QF2xzdYnFp1cRXD9KMfa3plERaDGlkx+VWF E39SKI8TwSYYDR9mauJl+lhmh5DIx1RzjpHVlnaCM9wLNwDq9cSiDVFZV8syeJmwqhqn OfwDQHg3PZxk9WYPZ0sni4YSlA1UgazIcGXvMKfGNz4UTon8UrNR9WH2IkPDftmVhVlf T/UnWAkp8bubGsJkneS7OKxt+yGcKi4BU7LAqLIqqFhQXGGRmTqBb/Ftb0WbKT5lLCTw +w== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3tec7vf7s8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Oct 2023 15:01:30 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 394El9VA002983; Wed, 4 Oct 2023 15:01:08 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2169.outbound.protection.outlook.com [104.47.58.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3tea47p6tk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 04 Oct 2023 15:01:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QQp7ySEXnQjtstEdOOI97rMJufk4hnEeMlLi+bKH0kwzqkWfjFztWx3iESb+6j4uyt/RqJXix4qe6eDuLVojI56OoE0GYI1ZxaIzudj/I1dQsi0kT/qF4oGr+DScTtn+SkFa0UT+548R8090ppmRmC/yyfmAh7zHhynbTQXCnTwfjThPpRlax6gIlQ7nOzlEz7yaD0coyf03WKmr+EKlTzg/P7rNK9YZxjGgDgBWqm+RMRidwDzNYgwJXPcIUInLJI/TKrsyB5s1vExNMLKylHBC6BRoH3s9J+lxAyYBP09uX9RvmbQIxRObcqqTQ/f+MGSYr/1bxQoJeYhcUlwv0g== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Sm39d6HmetxGzA5+JmCCFzhOyzXzVIQOGaLPOrrg534=; b=kaMdJz5uZr2Z1BEw992TLh2qO3+WLTWt1MNlzUqETBQqwnKvVUMMCkfDPe4JZLBDVL/Vuxvx1llx1KzENN1azbnJHtEmUPvze+gRQZ/oMdX0lL6BPsFgW46u19Mp1/deRJOJLaNbdP7I/o4HcM1CUSDHWxdIXo1t5aG5BLSBKjES2XjnH33CZiUmTwXrcaKxVPP0ZVH8eP9jH+ZI+30m1AsQOhi91wu7Cv0bc9uxdRk7lenpZ+b5vz5aPpsl/lNC5jmTU75jP16dMuBAEtkxOu9jeZFZ+tnSzY0JSU3eo6D+dEI4vbHdjUlmFHZP8WjKscqr0OjrrEZUeDQUPKNjYw== 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=Sm39d6HmetxGzA5+JmCCFzhOyzXzVIQOGaLPOrrg534=; b=Qg3dNqo5f5V6Rb8rXz6RxzgfdGRa7nZihN5VZ4Lsj4zboepvO6ZiorLYypNU7dVbU15rwrSZWuJjnD0yTZBoaycDUtHRDoX+HrA7ptqBGZKLKJCpmGxA/y1zQ62paFD4Mp3PooeKv9bXE7OIPog38GPTGKMIFIQb0Fj+p+09B2Y= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DS0PR10MB6872.namprd10.prod.outlook.com (2603:10b6:8:131::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.26; Wed, 4 Oct 2023 15:01:03 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::2bbc:60da:ba6c:f685]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::2bbc:60da:ba6c:f685%2]) with mapi id 15.20.6813.017; Wed, 4 Oct 2023 15:01:03 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Cc: Anand Jain , dsterba@suse.com, gpiccoli@igalia.com Subject: [PATCH 4/4] btrfs: show temp_fsid feature in sysfs Date: Wed, 4 Oct 2023 23:00:27 +0800 Message-Id: <9fca0011d2ac24f7b84990db1c4af5eaa60da876.1696431315.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2P153CA0045.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c6::14) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DS0PR10MB6872:EE_ X-MS-Office365-Filtering-Correlation-Id: b66ef8b0-b2a9-4a9f-294b-08dbc4eaba82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ngLgl2mnaWjkCP5sOaDlLDoNRYR4fD0yZF43jwMP5ABYo4ej8pquBOC9m89jiqL0MhYsHGDTQOv0bj9QbGogN5YFKXss/kvNKn2RougCjZTJ6xvF3xeJm7H4yjwY/2x2kGGTSMSs9aTWgVIB1zglIp34AU9PPaNTEG8CKbZ3U6HUmpIkxSwEBTsop2E/2iOctIrHyag6GIlrU8RzV/u5EhIkwCP2UuE5OX5kPISS5WtZWCn8OWdQGenE0ELo4QoWlw9i8+XDJKE3mcyrmkqVqIoWYQDX6vp5Ojbfa4Lf2qm8xUNZwFlJklFTLqOBN0ablV2ZsVeZyZ3ESVbcFNykR2WhsToLerwTRQR7WnHY7CDyGyfxQJQczuWvFh+o22CGmsbFNfJqdEO09XMME325xiog35jkXlKvZpfy1ZpZIYZiv2YsWVYmX3RD3IXbm9umYgHvhJDGzP7jmzR8MHwgbdT7jvSTgK7UPGCurmE7El8wPo9kUe62Fxg0YrAtSXp3cBM486q60touesZQLrGLSSpY3fhc/PNGn8aE2BPqNNP4WyrZQ0CeCqiMyrnXCrdB X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(39860400002)(136003)(396003)(376002)(230922051799003)(1800799009)(64100799003)(451199024)(186009)(316002)(66476007)(66556008)(66946007)(6916009)(2616005)(8676002)(26005)(8936002)(41300700001)(36756003)(478600001)(86362001)(6506007)(6486002)(6666004)(38100700002)(6512007)(4326008)(2906002)(5660300002)(44832011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Gry5rYYW9hhDRrOrWmZL2+aSDV5yim2DUYwgTJ6aiQs1VYkqTs8wyKMMjMeCijyTiCDz86fxUUNWaT7KvozUn/jBELEpPucuZy8ZkxfbyUvYDa6en73imjLz65cdpuntsoZcQeTgggfucTh2CUUbY5qh8Dowdyqb7A95xPlXqnwPYt3JFEA5D+JtBLQiP/QkOpGv0AKQXi6g0/fYPY8Z59d2qU12EOX2MwDw6ZCyyaIWUGuG5eco/pmwAHR9FhywqIEOv5NnnGAxP87JzEBkgM/L7BK9cFF7YBS9Elt/jh4ECy4h4ETtGBvTIjDlWyJsKhUEVCa/jmbA/5cx8JZVLgNsgNRbODO4PaCk0QZ2TI2qrHJfFyZihKf1FjPczrhwTeu4ErCluGL0y5wXISIdZtkhDcX21mSePQftO2xj5ZpGVtFoZ3RZWCPrk+N7IYHq3uqYlXWyvWb70/vp8tcAxJ1kAi12/SquVy3gc5rHIof1g3uZlTTs465qegD21flrD2Mfq/ORWsUqx96yGZ/qXrXfW6fTbsdcszOqWLfEw80NaYqeqsUXUxJovHG1wtXb6MP5nnwLniDJplY3p79GJrh7QRR/2g7rv/gT9erRl+Ga83LTmwmQHh8fQY+aoJBjgaooOdZ5yMN+wKSe2OvsN0WAYhgtw7B1maGo/kttgVePwhMo9nj0HoNhnzEbOjcgI8HIjLl7AxVa3DmQdZDV1pUfwZi6LhtIgrkD86+RSEsdI5K/y9tlUu2rIDo6WUAEMykQRYXmLAUPmz2hZpNw1Qba9BLuL9QKj4VtcfdTIQ1mT/qt7xuS3N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iO5jHHUC777wzxvKoDci8kVZ1Symk76JaXiNKLfEzluRGrMscM5X1bEYeVitVGBZI+UvFPfflN6qab5cDryRdIfPNx4sxVtP0GACoUZV5NCTXGoyYpF3ABGYZX9sY+Qpbm+XCoenP2hAZ9+6sl4PL6m9W274+PALpqSezgItn8Z49XhPyuXADOctwwPB2Le6JFXO65ix5ERv5lK/Ga3Kp1bmC6ZDt4vt/SQ21kSaf18PYh5JbR9vZ3nAcIQBoiMryQi715FpM9gqOHSXUpFdzPI/j6nre/RcvVj7U2SX6rb7+WwCt/21oCrSqcAUPxyZFHMEBcFSDHY5OvuVPjlqb46YX9X6pBPBp02bqGEm4F/Dq0ZvlkmXZijsu/k9roxZk9qLQ13muIhZ3jsVAm0lE58WP5U/PdIQpBIMvT4/e6mfM+ZipmQpwVEpZsKGMHD/d5A4zYNMLSYXFzcEAVMkcz2hlE2KRIUvh+CHwDLFd3XTgvfiXl8Vazl2gWj0VaY7MfbnlSXVO1mA7RTmpRfSK5td22sK4fxkRk+ZMMVuT6+o1LYbbxuhNowwVkUdoRCM5p9yvY2KWj8GFn4Z12AE5V7Fen6mKK2X7GANHZMaRItDWAM7dT9ovQyPN X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b66ef8b0-b2a9-4a9f-294b-08dbc4eaba82 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2023 15:01:03.6573 (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: gSYSckAXQtyVFL5urhKkfWuSvnZgNFS2YVdcGjTEtS6Lsm8yEXVnn+50R2P2mhpH5erWQLP43lPrH08J+BVc3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6872 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-04_07,2023-10-02_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310040108 X-Proofpoint-ORIG-GUID: wDCmOspxa8CtiNRNiVUSSBOc0OW80Ela X-Proofpoint-GUID: wDCmOspxa8CtiNRNiVUSSBOc0OW80Ela Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org This adds sysfs objects to indicate temp_fsid feature support and its status. /sys/fs/btrfs/features/temp_fsid /sys/fs/btrfs//temp_fsid For example: Consider two cloned and mounted devices. $ blkid /dev/sdc[1-2] /dev/sdc1: UUID="509ad44b-ad2a-4a8a-bc8d-fe69db7220d5" .. /dev/sdc2: UUID="509ad44b-ad2a-4a8a-bc8d-fe69db7220d5" .. One gets actual fsid, and the other gets the temp_fsid when mounted. $ btrfs filesystem show -m Label: none uuid: 509ad44b-ad2a-4a8a-bc8d-fe69db7220d5 Total devices 1 FS bytes used 54.14MiB devid 1 size 300.00MiB used 144.00MiB path /dev/sdc1 Label: none uuid: 33bad74e-c91b-43a5-aef8-b3cab97ae63a Total devices 1 FS bytes used 54.14MiB devid 1 size 300.00MiB used 144.00MiB path /dev/sdc2 Their sysfs as below. $ cat /sys/fs/btrfs/features/temp_fsid 0 $ cat /sys/fs/btrfs/509ad44b-ad2a-4a8a-bc8d-fe69db7220d5/temp_fsid 0 $ cat /sys/fs/btrfs/33bad74e-c91b-43a5-aef8-b3cab97ae63a/temp_fsid 1 Signed-off-by: Anand Jain --- fs/btrfs/sysfs.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index e07be193323a..7f9a4790e013 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -425,6 +425,15 @@ static ssize_t acl_show(struct kobject *kobj, struct kobj_attribute *a, char *bu } BTRFS_ATTR(static_feature, acl, acl_show); +static ssize_t temp_fsid_supported_show(struct kobject *kobj, + struct kobj_attribute *a, char *buf) +{ + int ret = 0; + + return sysfs_emit(buf, "%d\n", ret); +} +BTRFS_ATTR(static_feature, temp_fsid, temp_fsid_supported_show); + /* * Features which only depend on kernel version. * @@ -438,6 +447,7 @@ static struct attribute *btrfs_supported_static_feature_attrs[] = { BTRFS_ATTR_PTR(static_feature, send_stream_version), BTRFS_ATTR_PTR(static_feature, supported_rescue_options), BTRFS_ATTR_PTR(static_feature, supported_sectorsizes), + BTRFS_ATTR_PTR(static_feature, temp_fsid), NULL }; @@ -1205,6 +1215,15 @@ static ssize_t btrfs_generation_show(struct kobject *kobj, } BTRFS_ATTR(, generation, btrfs_generation_show); +static ssize_t btrfs_temp_fsid_show(struct kobject *kobj, + struct kobj_attribute *a, char *buf) +{ + struct btrfs_fs_info *fs_info = to_fs_info(kobj); + + return sysfs_emit(buf, "%d\n", fs_info->fs_devices->temp_fsid); +} +BTRFS_ATTR(, temp_fsid, btrfs_temp_fsid_show); + static const char * const btrfs_read_policy_name[] = { "pid" }; static ssize_t btrfs_read_policy_show(struct kobject *kobj, @@ -1307,6 +1326,7 @@ static const struct attribute *btrfs_attrs[] = { BTRFS_ATTR_PTR(, read_policy), BTRFS_ATTR_PTR(, bg_reclaim_threshold), BTRFS_ATTR_PTR(, commit_stats), + BTRFS_ATTR_PTR(, temp_fsid), NULL, };