From patchwork Thu Feb 15 06:34:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557463 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B178BE65; Thu, 15 Feb 2024 06:34:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978879; cv=fail; b=mN8h7nFu/7iUQsEeWyDTul2Hu+Uo9fss+Zn4qjYGQoLn8G6Q9birflJ6T/IUeF8YICV+GBly6TkgX2ESliyirclLeAWmju43r09aXzIGhnZ1VmMV0xQ2LD3IMDv5p/GkdzP2yrC6A6XIUnbbZ/xkP9SSFtgHpYxan/kTyKLoiAk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978879; c=relaxed/simple; bh=m4WCl6RgsHAfXWJteGShTMzz9iKxSeUYbDbHs5EE6pk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=MqyL4JB/aPaKdzFa6i9EvNqQaPenyOqaztlj50pZgBu262y38II80bCRwtYg0lMLMlH8ojE5UCNjPqreJBNxmPWRB5h+emtygBUstjEo9Jg8qnnvsZ5E2n0NM12KKxASOQkX0X0TaODieviIMbaVJx0L2xD9F0RnUabxJEzMbYA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=dpGfO6Om; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=kdwnL5Ur; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="dpGfO6Om"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="kdwnL5Ur" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41EMhtfp007009; Thu, 15 Feb 2024 06:34:37 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-11-20; bh=zrDg6cGZCuVRowL0bHFt+KCE7rhkGGXgXgF52Q+JPEo=; b=dpGfO6Omfk8JFWf5zgJb9KN2ksiTq6k3jyw4uYmFfx82mWz/wdn7DCPbl24XQLLq4nY7 awlOQLzuIEZ9n8iXXRivb6GBYKA5tigmlcd+z9G6H00leVyO592nhfA/WzrDs3OsFPNH zvLlCom+rPGBp99ZVV4tY72X4Jw9yuV6qLjJ83o0HyfNVBWEIOtjkhDXKalPVFZu6GBi pd8ofsRPjiqbVg6MkCduDP3J/IyzJ2tAJTxmotRe35tee5FwJswRA5Qi+kYH0zhMNPpa TManEjNdeUfeiyeD4RXcKWb7FyPYV4hFTIyslljQrGOtDUjRB+JeXAEFDGIsQAgtouue Hg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92db1657-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:34:36 +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 41F5piD4015009; Thu, 15 Feb 2024 06:34:35 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka28ek-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:34:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mWdfFfimEdGmC6U+aIhv8cnfqfOsUFjCfblwU9xKG37FHd+mqBdgNG/fwD8HuDhq9JVtS7G+SP2wlfpeDlqNMGso5ddNG/z2p1a1SJe9IjXYsVo2ih+WxrL+xMuE4FVg43dRwiXPVgdJcKPI5+do/1+UxU+vSV1vFfJsB7e704f8wu9gYs/HXGDx7RAn1l2iCS6xKsXAuBy9UP7D9TRgklT89o84wtDXMFycsaulPuPKyjn9HJXR84lFFAsgnxV9lb+cIzB56UiEiIIPlALGL1ZfFc3UMpFGbVAcZKFg5CSIHAH7xjQ4fDeEWqyRw1aP0EPhitJTlTCXNROD74Zbrw== 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=zrDg6cGZCuVRowL0bHFt+KCE7rhkGGXgXgF52Q+JPEo=; b=Bvx/LG08aTQmiAfCuMsVLzr4U0+zRj7xkclkZfQV2gZhtSySWVmba7BBzWi7mXYB0Cxbgm93bOneAwyN85lfZ30pvFJuqx5YaoROlxuDPYh4f3pM+OBe9Xh9P3gE/6LxLeHfBBCKTGYsJzQ0sO5cZlNP/e2rflgHkN1ytRjOilmtvt+CdKxfoayHvXA7NJHNGBjZlwWWh17C+Iif/FCd2hWZGe5piGyajAzI+cvSEGecmF7smwFyOu66Fpe7DeyX07mofFDB2WnicLHwc8y3kDFOI9v2CTpKmT7J50EK8mejqsrxV5O99vgd4f7vBJJj8rq+Sl9Odv9RXuDEeYzbIw== 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=zrDg6cGZCuVRowL0bHFt+KCE7rhkGGXgXgF52Q+JPEo=; b=kdwnL5Ur4QZmUzaBByodnARj2Kdq+gq5T7yf40TRT/veQk9gw1b68DiowBwgOjM80FUxMnuyflfjzZcJ9oZ+8aTryhwbEt/XMZ1XBY29vD+VQ2LgDfpxtWWHqUcRYH0DD7+bGYyDFIRdS3+VtU5P7XRdnPjGPusVcNVtxg722TM= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:34:34 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:34:34 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 01/12] add t_reflink_read_race to .gitignore file Date: Thu, 15 Feb 2024 14:34:04 +0800 Message-Id: <578579505765ce6bb5ee8b1cc0e1703221fd9acc.1707969354.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0053.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:ac::8) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: a796be1e-cd60-4ce1-1584-08dc2df02c0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n052bbQxUIGi4AleZQtvD/jMHAYu2hhk6QpCKz/sbKxx5KZFSPsTwl0cKnell12+AT65Ujj2KND0JsaElU/yaNTOwwV5l0PTgPqCCXrszVqFNHzd8eKNr7SxUUwfmVmQiqTZIX3irpkq0mJ+dOeB/PnSPofydg2SdOGi5yLkhjiBGm6yXh3aOME5N+kHDtKg1mYrd9H31tm33J3OThvgJ7eUi2dHlZeFgu0liqbUX8KdKxOG5mGdfqXxECM0Mh5iJqRluzaQnUTvca6HFfyWM/hYH7RiHA95AU5U48wFWz4IFTYtcyi+yINIYGSIj1FqbTIDO5P5NDOJBbUSJFTgTTkzM91BbaX/Ic2TZrBb3kCUXJ7kB6zccwJLyeiciQMQ8SzUvMOby2S8sjcIUXY9y9hDKU6lSYjK5Idd42+xES9uh+OeUDR8UGATnhoNFZsdbcgZ6ry2xQWrkqK00IJCyOnrjhybrLyGm0NrVy/3ObXqPsDdRXKCjKiL/KoFXNsa7WsM+zvXo0t1HtVWdn9v2J9cith4ZXCNB6sCdI/Kw3UNyZjYrdJTPGhGnfLENZ5l X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(4744005)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CA/rHCkiHrftUOlSsRDUiOaWBzbmmWM625PoSPiaXZwqXAwdOJJxPqsHlUHArx/6r+slipuqwV6A7npYqNQWldwu9AwgAlEmi0dwivy133M+7+v90GHTSk65xw1/VXiFeOlbvFwAuWqAP0U6Y+freayHkdjvgAXIwBG36cze4X8PNza2Tm44Yp7nzecPnGrvpyIP3nSXVA7rY/h9fyeXA/UIPR6jcEw19PExIklflc1TU/nqYgZxN+VDGa5fSDB8sW20+fYOOn8MzVEv+PnMH4PdH+B72StK4ePFpOJCEUpXf6xNtQCf55coGrpke2gYOi3F5mS6tbYxvV664dRrG3EGX+EBrrQmJAGV52+/pEpnz6ojq/q8buVa8Gl59MXbtTp7IgAAcSQZEFhFLf7mqZhvBlyxXQl4lodF7ODJmkOrhGhkEZIlhw/Xk2Cjv9om/T8jjnJsUb77F8AcAe/qzKTGCpiU4V/TzSRryrmaiQqjbmouzYvfXqoX1JOUieJOIWmp0iOPAcvgyOu7294R3Ehfk/EbP77zwF26Z3mJgDwxAd+FdoDdT21SasS8NkiMasBt1kU6csDQLrda94VKUbiZIYsXkai3yZEiAOTBIbTwn0nbWaiqJusIuJ1aNn6Koo+wrUpe3b0hOP9KPTKz682r+tEw0H4a0q2DS38W/W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okpoRL0+/XKMFR8pONQppd5EDthCUk+9GAASTFysx1O07frIbhjboU5yR4pSlDNXURUyS/ANxnelhZ1Gn799uSPckBUi4msOGj7HVGorarpEUgI7j1sBkCM3NOvLXa2kpW1Y0xL20Es9Vpx99MGFs+BYstvJ18VqbMGjxxCM/rUbRm4qHkQMA5yPQhFDvog23AYeWTj2ilRTZ/94osW+3MCZnvfsdumXwadOUcIRhUtQC7MM8f92Wd2JHdepmd7AUNZ9tuC0E3JLlZwcYoj51KA7zapG1efS6wegjHxejo4i9qhzkDv7OIWAPzsjc1S3T4quPAJNgZFjOjKTImGWoUgpYT6HuQtcBYmZTAgb2RoTi2fsR8XM8vM4khaGRLODUSrF5yGF2TtU3a6SV3vBXfjiz2LTxartuAd1V6+ye44PwObYNR+yady3y8COQy0jTezwWAxPIX8Ui/Hpj/jeFqWQisGvDtihYYUUcuPpSRc0u7KudTWCAJ3LWzZOsjFl0Y7SbkjQPjBgecjIa02PbnY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a796be1e-cd60-4ce1-1584-08dc2df02c0a X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:34:34.1095 (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: EFlLmqnLZCCi0jiaevNUNI56s8M/cd1OWnbd/AuWoitqWJd1yYs6W6OYDFM9oGN1wpLIF1abzt73PNpH6N51Eg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: HWvT-xnxXTfY_rKVyTh7mMUc2mU_LIWm X-Proofpoint-ORIG-GUID: HWvT-xnxXTfY_rKVyTh7mMUc2mU_LIWm Signed-off-by: Anand Jain --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5cc3a5e4ae57..d930b9cc8404 100644 --- a/.gitignore +++ b/.gitignore @@ -204,6 +204,7 @@ tags /src/vfs/mount-idmapped /src/log-writes/replay-log /src/perf/*.pyc +/src/t_reflink_read_race # Symlinked files /tests/generic/035.out From patchwork Thu Feb 15 06:34:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557464 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5A68D29E; Thu, 15 Feb 2024 06:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978887; cv=fail; b=NLWUL0Z2oStYBclslYWdwN+inGQGmdeEMvm3lqmfFI/uJMlx7vDuiz2NV5wwmTkqIonQnQxudbyn1AesxSi7XV75okms4bsI6Din0rO1jZFwYU9hr80j7g0bRKX/yQ4hd/hngUst907m4HYVyUhoLt47En6mLryUhU9eo5sJOaY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978887; c=relaxed/simple; bh=8qH7eqC+DlCXH2A3jvJl0Pwc9BWJKUukvNjlwUtfcHA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ABojN+wu4MzfZjo3bR18EgvM80WwY5kCEDIoUIJJBT9p4ycUPem7IE+oGWHSaVEZWQNCQJY3RIMM8T3E9CNilp4oSl7mccCLI4X6+I9yw8+Y5Y5Yf3z9juZtE/qoCvR49FMdma97FwsTFnR91EKKyqTXBRqHcqvGrfuSx9g/RnQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=JwodZoEg; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=iX/REay9; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="JwodZoEg"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="iX/REay9" 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 41EMiB13014085; Thu, 15 Feb 2024 06:34: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-2023-11-20; bh=OuJn2UjbCB+KMos5oiMI31/TgYsxyv1SVRVELjOzD6c=; b=JwodZoEgZb8gKGUYyI0sIJ16oqcttAbjVka03/0h+oDr4d07z4DMa4bBrjyOYSWdxciR yKYX238F68GVzAXow7zkxdlThgfyleWvDO+lr9KBZ3Rvg7wQE/q8zvU+/gBa++z7tlOs uz9hcdCwE4GB+Ej/N5hJs4ymwoSutKSphwLLF1BlV+pXQTE3P1cTx6TYbBka35W95tHX 1EWWx4ZoChR314pC5ce+Cygje2RILX9L7MzwvoGpij8ytEEi9W+BSgmaF7r+hZkFBBOp zoO6ipUok3TkTb9Ge1yVRKH6c7R1U1h3lKdOcYH304Mz4hmt6XAZKQL9v1XctYGl81KC Ow== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w91f01d80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:34:44 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F53gEv024760; Thu, 15 Feb 2024 06:34:43 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w5ykgbce5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:34:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O+Vc5HqFnMw+zeEbU4I15Xok/HOgqJ7Uysy2nMyPi0wLZmyZw2iS5mfcB3EmhrzVQGa1YoOapNHQi9uvtclkNnRlBX3Rb6tRZwZZMfGGZ5qCTzkv9Fvyj9e/b7+pihHrsf3xCjWPiIBZTf0XuKLoAWTKgX/8VVE9TAEOR06fRE4+0pFQujwhZ8oV1Jk+tjNVFlZwwmAh9yblUM5FSXiXL8YSwB7WENrEZFc8OHHvNKb3xYyKW4CL8WmrsXkAcQzvmX/YEljzsJhCKnSDzGIAJizRejGuUKehryvqIWSKfNBltZb19As2DrmNjTJdUJlfo/pB4jrzZspdjyuZA3wf0A== 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=OuJn2UjbCB+KMos5oiMI31/TgYsxyv1SVRVELjOzD6c=; b=ClUN8QLb47wKipl+9dPDtO/dUm875vqZeN+LgQ5rcFovwGaA0ecKFESt3F0ZiGK9pG2jERGsB/vlWEALGNuDPlZ6H9P03WH4NhTRAtwDKYOhMfanSwKUmiO9z/RykclHiZDArU+cHK+BagMLi11C4jdDO13EPQ9aT+EkakPg1Md0QnnVb1dDZjXWPE2IOk962dya55YkgP6vkRI9j8bpV2y7/63DvwUY00uSb9pNDW/dq9xCGSMegrKBRtl/W/ThTw1glB53QooEAvn7EIwVR2qHzXhv6qUqD188QCKUdJ8CGOIallVkVt/FQPS1w7HKATJiBVYxyjkA9nSjk4YeUg== 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=OuJn2UjbCB+KMos5oiMI31/TgYsxyv1SVRVELjOzD6c=; b=iX/REay9VE3X+jgufkOqbuz4hWEKaEsnLyjeIYrHEKMV7PZyvpfT8G35TdYYGKzhbjhtv4A2UX1K8Ij9K3el1rI8c0H/kVufe6bLmRAJW6LLHmpi75bMjs62jggM/SqbxbaQIc7xYHkJFuyVboowf8ppMc9TFqrekfCN37LVJ6Q= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:34:41 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:34:41 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 02/12] assign SCRATCH_DEV_POOL to an array Date: Thu, 15 Feb 2024 14:34:05 +0800 Message-Id: <366147ad0c29a6e4d4e0faa60231e66b81c7d678.1707969354.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: PN2PR01CA0165.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:26::20) To SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: ee02952d-6434-4582-a786-08dc2df03058 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6xNwzhQ5k93kUVB3JtYckaAjcr5v6OZZYBoQ+P7JzcPMc6vWv4DtgNUTQgDHQbWZvclAAs63PlKv/NhL23Owmu5FBDTbh4iZpSXhgnuIKEWOxgamHN5tQKwrUH4uIMgGHCoSNoCiQ7++f7O47njawGSeMvnpUmR82IlI40cvYLTuQO4GHcy1UaRDPN7CTv6pl8npC1H/00CHaKi/J/+vgef9HO5hv2GTb4pYpRXUVdRa3hI4qbuKXCIUxLwejFkMQrz183KKPuMA90l5Zv9e6Q87Iyx3ost/2DNbg7OX9s7fLN02l/1ReBeK45ew3wmapFYoh/D3Upbmztg/dZZm3Oz2M2yag23UtXyA96AlghMRzDxT9gv0c+eq0VM7Q2J6lgGpb2O4tZU5OD7cIWCC0gdHnK3dHeC0ToNBwX8/bpA3T1BQO7F49bZgZZBL72Njf05f8rk1iMiPw6oatkhauRyK/28Mxd0UVbQIPbf/knpzn1IvE+eIBg6CzdYe2SrYzdL6zxWq2Bolf2OZ7X4NFh0A3MUeHk5luoDnmZ7Xl71xx13BEXqq4VWLrpLASNna X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(83380400001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HT//jCf+QWF+SvRXmqdpBeB27HarHnTtlvc+8rpOUtRhBpDO61sZcnD58kJGgnfsHxHqO5BlMIwWMBOMH4PXkd3FT/5twWDDntmxwMT6yIm9ctEkKcCn2Ee8dvnRWnwHknr+O16NFNKdt5UpRgiFKDGne7MwDcyjcCrki1hzAr6Kv6m4hgVvmbx4x9EqGV1GIHbF/end6mdwIE4ivQtNFT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Ff3+MEj/i1Qr1hSwSZc/mFU1zHaHdLIHg5sTfr/tAB/buDfux2V3K2CW1cDC9QyK3DuE+pPWyBtA22HRUvIQep72ZRe6BA7Vslc5gLy4S47TpzvH+uvoTdKP5mkeOyscT8qnedYUSn5NxeCwgEtkoUOzNDMjiVgazTvGSEe4x1M/g6y5ENMTv+7eUREGZ+TQwpGOSiS5Qis0ssiAzUJOyQoXJ4LSn8aytDBRlcSwvnK7odFgQxuFh9aQRiO0aAXCDIQkajoF3V1qsMEtQaGd71Q9X0AZsInmrC62/39iaXPeOwoBpKa6NqGg3wcoUU X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: QaGHacR+Wvb/60mXysMC0EMXPuZd3j8JPsuFkCUE66e7Di5ZS4I9I8hpl/WhMDClZxTOWjYALXG6X0qL7ChqBCsm/ZZuLTVlL4t2Ez4GnKFb83ZZq1QFY+9CcL6eOX9bOXvFlXWZ/qNADarmj9g6/gM9JS9jFSzbernY5FiEIyRoPuZgVIKSgeOoE1sUW8oft6GoxzF/SPwdAd+4QQHDwaCKbCisLivtTfO8lgMLVKTC21TV8kP8HmeUCLdgL+q1ySIah8BYi8KCqnmk6P2oIcvpnfldPxlu3bySXYBGxCJsqkcxrFxgnzhLj3a9d35ZupOexmNo3m2RU/27dA8Lw/IoUrkUUrKWg1F/DT57t1xZEVRQyBrFB8gWgnad6VaTeqmJyRzS35c2CJe8lr3dgybLukotY0hMNXXYciBhFHPiLIAAkfYpoNGf+Zd+lddZPR4ucjIGTuiYLR9nWvNCTkyFjDNOfMC0BA5bAm16J29EFuFydh78NipWuRqJCnPv0xhtq74MHAVZqVNyt/vkZO/J1PlMZKOEboskqwR0kuvWzgMnQMswxuBi4D7a3Sv3hOoqKS62JSxOVFVak+di/QCe/2LbCq7/75JuPpvhWBU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee02952d-6434-4582-a786-08dc2df03058 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5694.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:34:40.9521 (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: QG0RPSnazXxEt1uabNXdxI36EOnVmnvUotY9Z6bs0xmHVjXgJ4AMoj9aLncLpsRF/FsnV5EG42WropZfu3Atjw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-ORIG-GUID: 10_e1B28NBL1Yex49BmSZ7vziX4Gf_Iu X-Proofpoint-GUID: 10_e1B28NBL1Yex49BmSZ7vziX4Gf_Iu Many test cases uses local variable to manage the names of each devices in SCRATCH_DEV_POOL. Let _scratch_dev_pool_get set an array for it. Usage: _scratch_dev_pool_get # device names are in the array SCRATCH_DEV_NAME. ${SCRATCH_DEV_NAME[0]} ${SCRATCH_DEV_NAME[1]} ... _scratch_dev_pool_put Signed-off-by: Anand Jain --- common/rc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index 524ffa02aa6a..5e4afb2cd484 100644 --- a/common/rc +++ b/common/rc @@ -830,6 +830,8 @@ _spare_dev_put() # required number of scratch devices by a-test-case excluding # the replace-target and spare device. So this function will # set SCRATCH_DEV_POOL to the specified number of devices. +# Also, this functions assigns array SCRATCH_DEV_NAME to the +# array SCRATCH_DEV_POOL. # # Usage: # _scratch_dev_pool_get() @@ -860,19 +862,28 @@ _scratch_dev_pool_get() export SCRATCH_DEV_POOL_SAVED SCRATCH_DEV_POOL=${devs[@]:0:$test_ndevs} export SCRATCH_DEV_POOL + SCRATCH_DEV_NAME=( $SCRATCH_DEV_POOL ) + export SCRATCH_DEV_NAME } _scratch_dev_pool_put() { + local ret1 + local ret2 + typeset -p SCRATCH_DEV_POOL_SAVED >/dev/null 2>&1 - if [ $? -ne 0 ]; then + ret1=$? + typeset -p SCRATCH_DEV_NAME >/dev/null 2>&1 + ret2=$? + if [[ $ret1 -ne 0 || $ret2 -ne 0 ]]; then _fail "Bug: unset val, must call _scratch_dev_pool_get before _scratch_dev_pool_put" fi - if [ -z "$SCRATCH_DEV_POOL_SAVED" ]; then + if [[ -z "$SCRATCH_DEV_POOL_SAVED" || -z SCRATCH_DEV_NAME ]]; then _fail "Bug: str empty, must call _scratch_dev_pool_get before _scratch_dev_pool_put" fi + export SCRATCH_DEV_NAME="" export SCRATCH_DEV_POOL=$SCRATCH_DEV_POOL_SAVED export SCRATCH_DEV_POOL_SAVED="" } From patchwork Thu Feb 15 06:34:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557465 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0744BE65; Thu, 15 Feb 2024 06:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978892; cv=fail; b=QsHhJ5W6C6tsT3388Mx8sf4H+vAMyMkMmigoU7rCM6OMceaKyornYRWT33AnVSmWuFKxTmvT3RzYo1KiXb6tY3Ymp+ObNlgn/gng0+wRLPhUEPOMLiGVH7QDcku//Jf55MvgTVJfFGgXVJ9/pnC0n215h2MIWD3MaHMuVuHn6EI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978892; c=relaxed/simple; bh=n2WU6bpMCnMwiF/2zKtxA+lLCG5I3H7w4IEPLUu2ODY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ZmUrcXzyboOHMaUWpDFNYeHARklCvs3Sy4M4v5eTGVJAqni2ikLtz7JfVvsAWX6eM9HihVYD7gwisWhqRiMD1l+gYrTGqHeUlEcdbOH0A/FJpKuy+K/k0shyp4Cpkfb5Pe3SR3Jt6UDyw6yt3rBGTlFTNmfknSfItLUVZ3N8ciw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=S8RrJjbW; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=NfWZ1n73; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="S8RrJjbW"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="NfWZ1n73" 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 41EMiCQB014100; Thu, 15 Feb 2024 06:34:50 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-11-20; bh=LuUThStwsZiRBn9CmI2h+ngodEt3HD1l9nRO9ZSKtCw=; b=S8RrJjbWz8aKlofipNUUma/F3tmJKOxjC17NnClLxVzl+ZfudZYsZPh11tc6S6c8CVKQ upb7Pvib9p0NgVnBWAiAWEgALlrqpDnFuWvvpMpgWOZaMlDmACEbnlSkT/uRPGXLIxbJ xt0jFlGNwk5NObP+8ZF0sM7PUFm5JG0cfH9ITACjE7YBF4lGvi2koCVJ/CilzUlwXCy/ aqFE0JWytQM6XZ547CUFvVsEqjDnEoZSj2wRhHDye5dCvFSWn7NiVSM47yDbZ9eQOcbN b/Lw5JJrP58qYCqzawh8mcqrp5xYfsFcaJb8Q+kEFjLwZek0fT8V89QJh9rK6giNePj0 zg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w91f01d84-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:34:50 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F4g2MQ031484; Thu, 15 Feb 2024 06:34:48 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka1u98-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:34:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SQpyouEHaB6y6ZGyx42W2irVHivXDj90+GLAZ2HaLeVWa7+LuYOStyDefdpnnt6fmtF+/1PojYQWCNE2AGRppuYopivXn6P4jHdO/W2zo53L4gmJPFD5aeNkTO/9A/cxdMEzhP46iMazDt0BAcZOk90s4Z2sSDHx8LoMSUWw6NAEuAKoAxT/GcnKGCsqu/EVrDyxqow+Kvc9i9hAZFEmJA+dvdW/YP//dviL4K58GGwDRIZTVbhI/nS2nQo/QLDTEyr44xsKE4j8Fx4of6c3XeA2HSGFU6yhoY3+r3+SG1gDYGlYOty+XiX3qgj/lvKNW4qIywWjfpgg4xfR2JG3xQ== 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=LuUThStwsZiRBn9CmI2h+ngodEt3HD1l9nRO9ZSKtCw=; b=ixe9ynqH3CGv+mcZnHOd0pze55YTNfnQtx/iYv0cOgAoe3mQ9SIOKJWCMoNavA8PIk1Be6OOOTpX4NMAn0b2xrlym+azdBb4XsP17aQqDCrWSMeSLilQ1xeWbvLAFpSdBVKYPDWtJcqmKMcHx/kRQNEr1XxjxDek1QZ2bHL8k0SbLry0FMWxQDHZNUfceez/LU/HgzxUTept+NllHpQOltlS6aW3HUqoaXhoHpzPCHoLQCvKVdftyY5ng9fs6H0Cy05QMGbd18t0mq4VNHK36DnYkguX2d8OUyD3NDMGg8UcwLoft5NkzFaonbWNy4La8oe6xpIrZF0svJdfM2Q5BQ== 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=LuUThStwsZiRBn9CmI2h+ngodEt3HD1l9nRO9ZSKtCw=; b=NfWZ1n734sTWIXLky34nPekkBoNKzdAmfpUMb9CGYqokOH0phlKcmJkuRs1G5LLh50R0doGKrrUV2sOwSR78sQd9YJcmYxsh8xFM6g3Ftv0qE/09J6bTEYxW6jovNHPKqggdTFp9blQnGDuqY539oFSQywN0/DhJ5vQOxBqrcsc= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:34:47 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:34:47 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 03/12] btrfs: introduce tempfsid test group Date: Thu, 15 Feb 2024 14:34:06 +0800 Message-Id: <8b09597200b5ef28be39ed3658d84e9b22febea7.1707969354.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0114.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:11d::12) To SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 0555db51-b321-4291-7141-08dc2df03415 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cdhROswgboGZBahZ9R8BME/Vlx0sGCsA1KZMaPTUuof5i+vH9zCYkEr7C+nxY1B/zz0AlQU568ImLXCgP8du683kqo730j98FJZY9yvwRRd/xiG3AR3ups44STZ2heXw15tdsksGb6uGZ1aYO28Qfk4v1stmdnTWHwFOL7rRE3P9DUE99lguAXnVE8Ugtha7FlttRL5pfAfc58RTiTHNu6GFJyE3QA8sNDuMdYMoPycj1HeYA9G2Ty55+1013aMDMJnNux7z7MtUKRLIRpGBMGKjxNwfOXUpPC8gVOFqMZnd47HdNeTDO/2e6zSYKfMdf5IqHPByEcYA3+bmXlswylSLirHKy5zEYXwH+2iF3px3WHIOSkfCOlbQdMRo5OHJYDjFoF/x1aiKnR0TUXv8D3rDow3xYL2X3JrXTtwecRDZ0vU2fAefO3KFROaR9mXbImtvqpN2qqPxlW6saZ0m+N+wTQA0vvKzlCj6YpPLt4VxKTtlxt3qLMFPu/zxYI8ziZLwkdyRTud6O29x7q9r6D55WdoZX2WCaR807cfQ8BQhK5e9lswhmklYm0yAqkBk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(4744005)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(83380400001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-M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ND3BL+2yDfTCGjms3V1zdSoXY9+P9b/YwUYXrry2T7qM29Xy9aeVp0zgqyD2yu0TW+7QzAkSPgvKEXkwW+x3CoKKprMDglTLWkK2TL2nm2yHGiZwvlSpjaAikP8kOl0NLSgv861BQx6II/oxoDZnzU3M+Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0555db51-b321-4291-7141-08dc2df03415 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5694.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:34:46.9825 (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: DvDgNExvuNdC4srrJtrwhk22DH/RgG6hN4x67QBdKQDVNkIs4tNKihkWRqrxhFB0Lohdta9GVhy7jVBW9JWAhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-ORIG-GUID: MncAQuH3NAp4AiZWeuEKG-zwodMgE-1o X-Proofpoint-GUID: MncAQuH3NAp4AiZWeuEKG-zwodMgE-1o Introducing a new test group named tempfsid. Tempfsid is a feature of the Btrfs filesystem. When encountering another device with the same fsid as one already mounted, the system will mount the new device with a temporary, randomly generated in-memory fsid. Signed-off-by: Anand Jain Reviewed-by: Filipe Manana --- doc/group-names.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/group-names.txt b/doc/group-names.txt index 2ac95ac83a79..50262e02f681 100644 --- a/doc/group-names.txt +++ b/doc/group-names.txt @@ -131,6 +131,7 @@ swap swap files swapext XFS_IOC_SWAPEXT ioctl symlink symbolic links tape dump and restore with a tape +tempfsid temporary fsid thin thin provisioning trim FITRIM ioctl udf UDF functionality tests From patchwork Thu Feb 15 06:34:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557466 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B88DCC127; Thu, 15 Feb 2024 06:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978898; cv=fail; b=MbOgdF2mIVAcHVq1yhvPoBJStvNNAUdkK4vZdI+bGaon+frupJfewr9OyBQq7dNka4P2DeM2hF+hxp4VMPTbkCJ+SOVSLMfZz/7zdlLv5pIVRCpt9ELUKWVs/FEVmXK2rTlbKQzEJU48/4NlsNydGiHNMA8ZsXhKGg/7nuwuyPU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978898; c=relaxed/simple; bh=tgiBEixFkmhQjPeoFESScogK05Uf1fn2ipHNISNk8y4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hfuzuL2V4PtnRayRncythwzvKsmbSnE1dueE08f6D3NtUmdC07XsAAFDek7HAH+r5jDoXdSwMjk+qwH9HqLoljtSgCkO7vFChEdCcfbwo9kU5lwHktiWY3MjmR7Ssr+MTpcj+8BmmAjiZjSLDRk8tlyovl+sMQO2EFkYhwuedYg= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=VAgjh6Gw; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Y2wwa+Ck; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="VAgjh6Gw"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Y2wwa+Ck" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41EMiJfO027871; Thu, 15 Feb 2024 06:34:56 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-11-20; bh=o8bRJLHig/pRItwNX+OvgR9hgZAc8F5xrruXUgZ+me8=; b=VAgjh6Gw/ggKpSuHHD9wxmKX5A5Dvi6KXvwoVKzF3jiWYxq8CTpAdravfm+LRyQqGmlM AuH47fs59pAqZyrjgQs7hlUcD+jFOiF7wg2A6csRHjTstWV6gax/VyMCUafYPuvvhd8q tNCcPJSh9qEGKWinq15itmo5R6iJmjEgt/IzaZrbasYnSSE5z30Ri0IyWXPldSO5fuSE JvNxGHUOdNn7eNj8hSVJbBWRw25fSRZiD1C+M0gsmruB/4FqcpL6DSt+Drq5q11v7PLU GGs9p+lQ5ai+AzwqGSP7F7PwOHQow9t39tZZvkLTRNH4n9G34AVhZ9lEQ1otEEEN2gU8 yA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92s714bu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:34:55 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F5G6oQ024690; Thu, 15 Feb 2024 06:34:54 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w5ykgbcjd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:34:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3cjjJxhIWXtUDAMVOfZizdnIJ4qXr3vrHbpfosvdhy0+pLYoZvBbdKPlAi5b2Y9GiepAQsv29dAcrPLqVXoFdUQSLYr3nSVfMgfpD1osHtvEiW3ir3MMvdKA/9lganCv9VtOlE9DKAQ6V1QwjPJVo3KiDZF5V7JZHbzcUxguoNwEtXoex+Ru5pKhE2x7Y4u8/D43tBZ1RVeLdGDbH3zho9KyjU+rt0y3R/nnsLFbfHtYVvTyXg537vw4CF0wLkvs1FyF+wovMSQVmjl/WDqABzdEN0NPISi19CGLC9wmyL4QV1EiK/2mlsVOen7uong0rU+Z05qqu68sxGzjlxO3g== 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=o8bRJLHig/pRItwNX+OvgR9hgZAc8F5xrruXUgZ+me8=; b=GrKaxk1L0uxkmARQ2W+Wjsb3terq4znVin7NUQnbhbD5jw9h77M8DUl9mm7rEiwjxTMzHBdEHy+pcOrvSL8oZTF0Zi+bd7pltABDsJ2UWN0Su91ADHr7GBVCVxGK4UkxXv44/T+LwvYEGNoWQmQFEiwwrWOX/vbWuyha00JNQiz91cBGDu4kMC++l1EL6exefP7t5aLt2EOtLtecq4MK49MrjDhrC3tywWHssuRGsHVrV2hloDgskfWn8qafJRH0TZj1hGBXUxn8SIVoRiRc7b3Srxw2kfeUvCVixOAUbKlG07Y10K7O3vIQWc/yz9Ocs89OvuK3cfOmI0Bpl/Xh9w== 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=o8bRJLHig/pRItwNX+OvgR9hgZAc8F5xrruXUgZ+me8=; b=Y2wwa+Ckofo+icaFunjrJvKzeKfrJgOzriGgr+PWRvVcowjJofBRIpEJNxr3t/TTUwFEXyxYTYBp147C8GY99PxXiLcvF/Q8gv8Yj9iK2xPDtmVn81WF/gIX9Tm/OVhPyO/e7qsvFNk5ngJ4k26iWTEVqrGS/KEhckxEv2QlmH4= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:34:53 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:34:53 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 04/12] btrfs: create a helper function, check_fsid(), to verify the tempfsid Date: Thu, 15 Feb 2024 14:34:07 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0111.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:11d::17) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a017a7c-ad9d-4ba2-e265-08dc2df0376b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 52nYSsw72sqOo9PruvzPxqj8E1kaJmG4z45cRFKSOuAYQdueSkwDhb+CCJVpmoZY9EtagwqNB7fKVLRaOuCUemGHI6H1gil9UupeIGfYcl8mi1g6K7NzNoKg3PGxLpQumOT7bqbKkBSy2l918Wr/3FmClbaPhOzCpIc+ka1l5kOGYbqqWQ+mzcLT8U2Xm1JsYJ7phJVmuB3FshMt1c/jOjdtswQ2pZ6iGUc/6uBOSB9bs1cgBPALrRbxq97PGeEFCKZEmFyKxH74Zq0qEkgSYD/NCOClQ6qo6ray/xIF0Ekpu9TGmNDOGCQ5cNi+GqZESKf+IwaKpN049g3BVnPGwQDu6z8L4/jJsOPpKjK8VJegUpcaQurhQsM+IzxFF60vIVpxVCQS7byDkjTJsv4+5lu5CiLPKkd0d6knmqps3HI7Mytg+3SHSyouZTlbfYOQkG6vwMw4bt/7cvplxnDYq+PbiU6abzYkSzENPBPDEqU0gidUgGwGHiIwTfSRPEV1LXpAC1kaTX7jYFZeupHNwvqUaqOyyHw/H6c41tJ8fh0yirlsbH3ep7MNazcZh7BA X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(15650500001)(44832011)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(83380400001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yiT53YW8dhpKfbzmhD3PMfmeZcx5B7CdprVooLlb8EEHooi96TxMdxwWRJoj7mtAFWGxz2lHnCZ3vrHjvFo3v9BbS3iOdlBwpbOz9Ah0upjfwdxAvITOdGeY/ZuZzJ9SnNCdIRGqx/hE6FP3CgR45UOLzQgRY8/jpWVACt0FGeQI/k/kK2OeY1wtSz5nHsGoFcaGb+uPZ4b4BtzBhgjmvm/oB5/Nfw4m5dKwyfVqjgZ6VUzybWIE+78369rVHppVWD246LzpzjIZfZcL2mdAChheu67LrEfTBK65lYLV387bnF8n8ATh9/jnA6f8mb/EkoI5DV3IghRynd22/zcfXZmz74zBwF0c0+aoy8taEo/GsoTKOZFN3s4Z56dXo3cQBRAuNIXIgiyC7apbOeTA14dozOP+VBewiyGsEMvnKqQJnVCC1kw8uxYFQauHPyA+7Crj9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QoZukSMLofl7orFpQYWDkLm7qoLOSVneadO8YSk4HeYTjPmXdmiE4gRznQ0+4 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: DKNX5RDxssQJgsBARCJKpEF92ju2Jy5icsMB7eOfiwRYvZcL066mAyafm0IQPfOliy2JcfUohCfoy75HYtS4XkP9y1rO3SIJR5DLgsktiLtB33hIr4/4c5INoX1EjTAjHwu5CXlucf8ZdZBtMzM+3tC11fuoN9FGXfOeOjkSfg8FCLm0JyulCm/GuSW6T2wyPsa1zrGAxflVhdJu+ndr4KbBJN5aZg7NhG3vr0ALQdhmVRBXZbO8m5doCIbNhqHc03Misj6/K2fTkGslbn6PrpcQMg4Cj6fiP8ufhQ78gbTu5B9aBMjy8iOuag1K84IYGy78y9dueS6n/hZoMoNmTYrkJrdJU0Eis3AB+88qtTMy2L9zyNKYh2v2Zg3W+Jxi4dXCGJBKNxnvsoAHhUwZ1n3UszWoRdHuaIGmVRssqNVH7ijaR28JMrrlWgvZUa9dTPjMgVSjDSA6VDwoO6h2vXUu1pSkmwR4Zu443vhEnqSsPAYHx5hBvJbHXj0P+nNESdIet+PWqY7FyNqNknaw2OEYBXxlIk5GGTnTOtoRIZHQkuSr7Azhix6RY9PrX5vzwLhT5tiO9o/ZRi+aJskNYVltTuiwe5Dh/WT+EnVque0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a017a7c-ad9d-4ba2-e265-08dc2df0376b X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:34:52.9718 (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: HQbu2dIJw9MzT/HrkzztuxfRXg5iqdtfdYSXkSiN8Pf8Q1haLabnSJZ6I45/b5BBNMss3dm/7rNvWMwLC1kbTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: w5WfKkPj0a4zEmdlSyMA5bDr6c9kzjBB X-Proofpoint-ORIG-GUID: w5WfKkPj0a4zEmdlSyMA5bDr6c9kzjBB check_fsid() provides a method to verify if the given device is mounted with the tempfsid in the kernel. Function sb() is an internal only function. Signed-off-by: Anand Jain --- common/btrfs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/common/btrfs b/common/btrfs index e1b29c613767..5cba9b16b4de 100644 --- a/common/btrfs +++ b/common/btrfs @@ -792,3 +792,37 @@ _has_btrfs_sysfs_feature_attr() test -e /sys/fs/btrfs/features/$feature_attr } + +# Dump key members of the on-disk super-block from the given disk; helps debug +sb() +{ + local dev1=$1 + local parameters="device|devid|^metadata_uuid|^fsid|^incom|^generation|\ + ^flags| \|$| \)$|compat_flags|compat_ro_flags|dev_item.uuid" + + $BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | egrep "$parameters" +} + +check_fsid() +{ + local dev1=$1 + local fsid + + # on disk fsid + fsid=$(sb $dev1 | grep ^fsid | awk -d" " '{print $2}') + echo -e "On disk fsid:\t\t$fsid" | sed -e "s/$fsid/FSID/g" + + echo -e -n "Metadata uuid:\t\t" + cat /sys/fs/btrfs/$fsid/metadata_uuid | sed -e "s/$fsid/FSID/g" + + # This returns the temp_fsid if set + tempfsid=$(_btrfs_get_fsid $dev1) + if [[ $tempfsid == $fsid ]]; then + echo -e "Temp fsid:\t\tFSID" + else + echo -e "Temp fsid:\t\tTEMPFSID" + fi + + echo -e -n "Tempfsid status:\t" + cat /sys/fs/btrfs/$tempfsid/temp_fsid +} From patchwork Thu Feb 15 06:34:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557467 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02ECBBA2E; Thu, 15 Feb 2024 06:35:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978904; cv=fail; b=UeJQ0qaH1mkUF/t2m8aqPbWiRx3YrNDVewWW6kGrmfVYxYpUN83co4LMjAHg3/0fgZn2qrBWKBQHGwk/1SInWxeeHItWsWNHX76zM6OaY4I+bxKgkBcMQHLIifRDyXRbTz0iYXJ6YyikeVfIh6xoaGvFhc3hD0nvbAOkvzR38TQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978904; c=relaxed/simple; bh=yyIacDM5ayoSBT0XqHyL2p84REZmqxhNFussYZFa0l4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hjH3mtRsVCUtZ/RXjeeBuTdrh6Qh9GHZnJ5zXJWmd6ukfv6iZU/Q5+7z8FW5qMrNSvUu9yT6nmuCK8PSISAb/urNVNj+ixn/4m8A2TE8tqKwZfzkqSJjuJD6qw/STIEGcpX4VVuSCPkQ9i3tXzq/QQozf5nXoNQxYAasqiDCrVo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=NSd+e4uB; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=rM1J2LqW; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="NSd+e4uB"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="rM1J2LqW" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41EMhnJN004429; Thu, 15 Feb 2024 06:35:01 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-11-20; bh=mzPilJ9Dky27J1GhpEJaqB4pgPSktB63NaNtjk5yDGU=; b=NSd+e4uBHf1UXIxKJqnDUvxkM/ZmCXnFa7jkpbcqWkHzXa91SIpRJ3e7cJ0SFA3yYmZC sobi2ZS0EGudc1sB2IiO6P6QCp5BGtZOAwbsxrccefB3aLKCQ7WASjomKn3PiM9cbxb6 DByNOijjYqj0iLKuUsdI9MKfWoETqmXPDJgTl+rxx+/1vXT0il0raFiepVxKFazy/Mog fRmlKuTojH5F2NzHh4sf+C3MPJLWGGzd3WcCKS0qyxjo+P8YS6WfnPkvBHf+YApI5k1A pMK4WWYUB7rW5WeVk9EZeeRM1k1Ki18+xP+FIOV9R+YoRhu4n9Yhr1cocUumHLiO5cCC 3A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w930112pa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:01 +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 41F6Mcw9015185; Thu, 15 Feb 2024 06:35:00 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka28rx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j+HmzdB3+ZxEtJUGtYIQ3VI46NGAr0Ys99U5Tq4DQPKbW81oxx2EzDocvs8WIU4HadDvzT/n724TwSB5k+q+BFVhf0jbp0IyKk1dnHUgQ5dhj7HhDCb8zp8pljDRzJhxvnLKKm2x7hTt7AFCRWfZMcayY1td3YWd/6Oi8KWil5lIt+tg0jh/SUEnqd4g4jQg1RJkZHFg1pDXADXQsdBOC0I36vwVz5UfRYM9WDP6IW51GhBRKqhpoYZqOZfh2ZsvBAm1Cd8QpK6bQk85nNnD5x4ST6pJTemLjIBS3QqUiXpPOhf/OlgHgL37EjS3gAodOPgflqojeh8Dg7ncPruEag== 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=mzPilJ9Dky27J1GhpEJaqB4pgPSktB63NaNtjk5yDGU=; b=l7QxD1yGgp9qCpTUNvJKwLmeLQjo7LwhaigulfqUz38zBH3IfbqKIB9U9ESVjChQ1j+35vCmlZCJbmkjx3SFVxo4U0+NxZVu3UC3w1Qe8wFy62DILWBznuLbHXWCqvc2Hw16sKDto0BOvfMud8OHOUy4Q10B3wp2JadTWqplGHKbi+mc+OZwLwZz0Nlwae6Wr5XTUguFi1XPUbDzLpZQuRMwwzrtBF73GKUSgN1w8x1/Pr1fDrSkJXvNgsHNMcV+co+5JYpAPN1dil885CHnWDgnaZixW6m6LTEfdVcxStlfNqCcCO1/tD1LvDUQmD2kNyoilqPgDR/Im2JIXlaSyQ== 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=mzPilJ9Dky27J1GhpEJaqB4pgPSktB63NaNtjk5yDGU=; b=rM1J2LqWZJxjGecj4sB8BoF23OIr9RbfOhrkHd/6tx55/M/bWBO80ZyjI6f0OAN+2QFjFasSluwS/LDP42t9q92uWnxxe/wyjCTBmL//iRRQMPFR26pOUpeO2Fa4/tGABJGX8JdBQot0tOvaGvjYXBsYlZxumrMoBjDAwK07R2E= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:34:59 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:34:58 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 05/12] btrfs: verify that subvolume mounts are unaffected by tempfsid Date: Thu, 15 Feb 2024 14:34:08 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0012.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:80::11) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 965c2369-c3a1-433c-d8a4-08dc2df03b14 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tfN9HbOLJP43fkcvK1JaOEVQjEa6ikZIplBt9zmnHLeCZYOPW6mDl1qL8bE2Lfkp0p34bXoW9yE47Y2OidH2dkphfVuXF+E30q/QtQTPbzn35SMlmEWcBHrmVP3lPgMSBQmEfuMM5YFRZhXdoVsjemHrq3gXLKft/Q07yYuPKWYFLJrwJ7potSYdyXXiy4ZFR3Id8W6AR2enJNw8hc8vFGD+1Vuv2jD/LP8ObbO4GYyR2GishTya8DfzTGAG+33QVHvWqEBH7BYoe7Sr21bwRkCLHg4MeaeeizI3pErzBZsfmwe4fUNBDzez8KX4b8yo6NUY2Q6ELLX9WQGrtDUlxvyrHfu5lhCF6Z+HZ2hZwvyN7Rj2GQS6EUiGL7mwdQdPFZG0A9wqZmB6oSISusfcVCMHYdSkTUN6XRok5SwryNmKDuKd+4X2KFprbQuIMdvc19ge7NaRa0YhxuYVcMiZs7CdAkgwDY4Ct9kzJQI8E5c6pSATmloLNuC6rk5kn/UYNYdT0gdWxIeMfJbl0HfX8aqnjTOij4kca/qsK3vWwGenQXy7d+E72z0BHuU/X6hv X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(15650500001)(44832011)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(83380400001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: paEQETcql9Vl7Jh7CBA8Q5zK7EoJVMS9KzKTttx5ncFqYsrGuvs37Vl5a7ltsoRiKxjlQZY8Ucro13nZoU2DqnjNuNBdvXq+qPOMVYFnvs6rXjB85Agevm/yYRkHAY1HzWWxM/dN3dvZaXOk0Pi4txTmFV7P7qWc7pLMAY1TNwfKWq7YtWWXMmOtcuHg7xkSW4VOOzPVfHKiOsCsZ1cg0yBZZkttQ+afURwd+HU6fbixhD/rKadTzLg0gdvqBVMwmLBcpGLRFvPw+m+E2k2r4oViFFrHmEWZBSAeplS89sl90z3ayRw6Kf0CQJbKpkAZ0m2NC2yo1ZAexCIYpj0acsCTxLUgxP/x3qWR++x8D+g9qPspgMTYnXPzIBCsShm+VssRiPRCPIdMFQaE5mINKfa26zDcTpc02QaTqc+HxPPZBWtOHBUjI4dolJiWGbm+glJlBsNHjnm+YS/IA4ig1D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lI6NpfWNWqQi74pLHyX/rZLmAbiXfMsZwPkVRl0xyexKH/gwQT8 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ra72m9XtztCnyKIRfOsM4f4jBz77QAOVgAT+vLCU63yVy3UESSWQjgvO3na+/yuoB+2HpMfPDhZdR4cOIoZZHNtLrdOPilVxLJwC1jdX+PUbFHffkBqjg7nD4wLuH40HXR36Oq5QWepoB04fRoKZ6vSUecQbNzWbJetkNPvb5xMHMvhf474oU3yAj5jfV9XPGGyNRHi2cst6fenaOOPbmpsLRF/c7kYd3gEQXKOm/fvQ5FJ2v4v4kGtjSPVNpREiqdsP6O2Q04nd93gptlMEqKtUPaGem+rBLpiv2kiFVA3enCKabHGUN18kOqpMi0eNuvZnNRQXn9apLScTwXdtCz+xXnkZDT+KTUHF33fBgneQNRK5c9SSAnZnXrcf5LGdG6XQD99A4bHXDffPHwvFvjtqC/FQeYbQOEjkkdgwXXC9cf5O0GDNocGQBXOneemUv0jTpfCWS0lQTGpEPYAnqXz9+2RoOtrLPR4T04KVy7xqn+XxDmeC0AzTAlBXWF2qg1VGpg6O4kriDQGjan51/deryo/2nEg4FMztOwymQxLOWxzBlbnSfG4lrxjsEfVSKXLTn9H3XVE6oMIZlPIQg3hZ3DtUlOrqcwhRQnb2G8Q= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 965c2369-c3a1-433c-d8a4-08dc2df03b14 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:34:58.9384 (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: HP1Ht+ZVjkPFlgfktj1eV7UnBNQDf2Sbf04FbicnQZzyVRgJMDLvwmk6bPdGvYobLAoSAhzQFg52SU///7FPWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: Nk54DhjWeDZWDBIy2s1zIwdedYtOqVvU X-Proofpoint-ORIG-GUID: Nk54DhjWeDZWDBIy2s1zIwdedYtOqVvU The tempfsid logic must determine whether the incoming mount request is for a device already mounted or a new device mount. Verify that it recognizes the device already mounted well by creating reflink across the subvolume mount points. Signed-off-by: Anand Jain --- tests/btrfs/311 | 91 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/311.out | 24 ++++++++++++ 2 files changed, 115 insertions(+) create mode 100755 tests/btrfs/311 create mode 100644 tests/btrfs/311.out diff --git a/tests/btrfs/311 b/tests/btrfs/311 new file mode 100755 index 000000000000..71c26055fa1e --- /dev/null +++ b/tests/btrfs/311 @@ -0,0 +1,91 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 311 +# +# Mount the device twice check if the reflink works, this helps to +# ensure device is mounted as the same device. +# +. ./common/preamble +_begin_fstest auto quick tempfsid + +# Override the default cleanup function. +_cleanup() +{ + cd / + umount $mnt1 > /dev/null 2>&1 + rm -r -f $tmp.* + rm -r -f $mnt1 +} + +. ./common/filter.btrfs +. ./common/reflink + +# Modify as appropriate. +_supported_fs btrfs +_require_cp_reflink +_require_btrfs_sysfs_fsid +_require_btrfs_fs_feature temp_fsid +_require_btrfs_command inspect-internal dump-super +_require_scratch + +mnt1=$TEST_DIR/$seq/mnt1 +mkdir -p $mnt1 + +same_dev_mount() +{ + echo ---- $FUNCNAME ---- + + _scratch_mkfs >> $seqres.full 2>&1 + + _scratch_mount + $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/foo | \ + _filter_xfs_io + + echo Mount the device again to a different mount point + _mount $SCRATCH_DEV $mnt1 + + _cp_reflink $SCRATCH_MNT/foo $mnt1/bar || \ + _fail "reflink failed, check if mounted as the same device" + echo Checksum of reflinked files + md5sum $SCRATCH_MNT/foo | _filter_scratch + md5sum $mnt1/bar | _filter_test_dir + + check_fsid $SCRATCH_DEV +} + +same_dev_subvol_mount() +{ + echo ---- $FUNCNAME ---- + _scratch_mkfs >> $seqres.full 2>&1 + + _scratch_mount + $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/subvol + + $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/subvol/foo | \ + _filter_xfs_io + + echo Mounting a subvol + _mount -o subvol=subvol $SCRATCH_DEV $mnt1 + + _cp_reflink $SCRATCH_MNT/subvol/foo $mnt1/bar || \ + _fail "reflink failed, not the same device?" + echo Checksum of reflinked files + md5sum $SCRATCH_MNT/subvol/foo | _filter_scratch + md5sum $mnt1/bar | _filter_test_dir + + check_fsid $SCRATCH_DEV +} + +same_dev_mount + +_scratch_unmount +_cleanup +mkdir -p $mnt1 + +same_dev_subvol_mount + +# success, all done +status=0 +exit diff --git a/tests/btrfs/311.out b/tests/btrfs/311.out new file mode 100644 index 000000000000..8787f24ab867 --- /dev/null +++ b/tests/btrfs/311.out @@ -0,0 +1,24 @@ +QA output created by 311 +---- same_dev_mount ---- +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Mount the device again to a different mount point +Checksum of reflinked files +42d69d1a6d333a7ebdf64792a555e392 SCRATCH_MNT/foo +42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/311/mnt1/bar +On disk fsid: FSID +Metadata uuid: FSID +Temp fsid: FSID +Tempfsid status: 0 +---- same_dev_subvol_mount ---- +Create subvolume '/mnt/scratch/subvol' +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Mounting a subvol +Checksum of reflinked files +42d69d1a6d333a7ebdf64792a555e392 SCRATCH_MNT/subvol/foo +42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/311/mnt1/bar +On disk fsid: FSID +Metadata uuid: FSID +Temp fsid: FSID +Tempfsid status: 0 From patchwork Thu Feb 15 06:34:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557468 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE117BE65; Thu, 15 Feb 2024 06:35:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978911; cv=fail; b=VRbZTGJ5wxym0C8Qt0JzsSQR8Qhqe25QYh9FzHPQ2MKCAn9LI6LCkL0eli2PYaGZMsK/J0F2yqbBC7oZL/MKAN+3ugbWSWGTJcOm2GtfB3XfXxcbbO0jHzkzooKY3AeNZ8EJ34fXe/sMQf36xjSEyM6IDEwp1h0CCD65MNZb6GQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978911; c=relaxed/simple; bh=izmJIukyRbTHlRF/cDMBiWgjVrZe2hAPGsT+r7NIUR4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=a8t953bahKnrSZ5EJflgFFsBYRH/syoxUi12gyLgBK89tVrZSmVgDx2OCQnKux0Vh/FD7/Lm4wSbjDUJ1SJvv9rLBHnxoQa36HnZWnMuqIhp22xsx40HRYvuQHWOoHubwMjNuIldzraV9mJyU6SrTBHR3+PX0Uu8iKo3t9lfOho= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=N2bdVQVg; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Ivg531Eh; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="N2bdVQVg"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Ivg531Eh" 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 41EMiCXi014112; Thu, 15 Feb 2024 06:35:08 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-11-20; bh=XR7tig1IJkJVzvKC4XTIsrcvZS9MuWCqErU4LvqibyE=; b=N2bdVQVgmqutVPMQPMlstShQ9xqlAkdRB98aoAN/GfjJTtjg66LlL89jHRc6Kyue2hVW F5SOzmqI7louUtkXLijeWpzrwDQyIUzOuxZvDvUEXlzo7c85qTJjGnax3EIZwBbJudux oWqfE2afCqxEZD2isWKB3B2cVxY7k7rPMeiJQGeMy9HdOi4XmrlccX1xTJjTjeiAVRL+ 7x+XhiOb6va2WlWN/oo1nCjFWEsLE/nUIcrRlq3EwMpSAc4JBbOwsKcE48hqlX2X1xaR biklyCvUAHf4iydjdg/MJoOLGgu+IMaWCDoeMO1DUW0peqEaP+nEWdqxhnczuqc1qCRu 4Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w91f01d8q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:08 +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 41F6TNT4000640; Thu, 15 Feb 2024 06:35:07 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka2v5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iek2yPkBfvmNEqCfL7Rqg7DENOu7BPW1f1Nv1wvYZQCSK3GumvC8BXp6NR5ZN21Kipvdp7xyJnh7rqVpVrB/gSa/WEQNA5Wwr5ymNWDNsDi8g1qnyC7Kc5NNluF7LhyqxCGSiTkG3z4gchUmq6gy5gbHQ9i+T0UZUpWiD9jLLnoxb/wQqwUOATLna1hYg7sVidjTNi2UfpIZbV7CmeNZVCZFTuI5/ZY7UsDvqVKeC98ZWPo4cpwIoRBsrwlIu8E7P7b6PNGOZAIvkIAMhBZ6cba0GJPgjKvtoK432sAawYQ9bu3l9gNiVzm4Pd5NpO19Mv70GbCqzAqjTLpeoeFwIA== 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=XR7tig1IJkJVzvKC4XTIsrcvZS9MuWCqErU4LvqibyE=; b=ibpPdjxiNGM5ZSElrJ+KXjz5WcKiz2gucxwqH/WWfTzsM+OsD91tEup2iCGNhQMWGYwk7vgATgNBVgnu/KRQ7dinbv9ki1Dxy2NzUAqTm47qRTw3PyX4eVEqpIzciUNoV/ZnXTcfSE5nTpwTMLu1XNlyY0yqwy2Qpi6EZWCaXWXoHpf7HMJY7VoZ8exHrijR2ryqRxQkTqZ6ap2IWFG3SVlKPA3cr3Fzb5FRK0OKhioBbHbMQ2PcDDcx02gSmj7ZDtk2q/G3u+/g+5SG2NKZxRBSfsH2ZlFte2WDCzGd0bjI0CMeaH6eGDCSm4xeXB/MeQkDBdeAbEZ3So3AXtGSfQ== 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=XR7tig1IJkJVzvKC4XTIsrcvZS9MuWCqErU4LvqibyE=; b=Ivg531Ehi+/WqPpxtx7UckHHji7WK7wPKtI8H6XdUiqySjxjutkEQ3GcLQH682vAlTVOxV2MbYnVogre342AlcZX/JOBnsSDWQkfUJg/9af3AhbYS6AdurUEhL+3smqCay4YHbF8qAJUS1V+GryUqEvKZPS6exQJeXxjg8aYgs8= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:35:05 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:35:05 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 06/12] create a helper to clone devices Date: Thu, 15 Feb 2024 14:34:09 +0800 Message-Id: <8a9a66bdd309ea6ea81c3586674922517c3460be.1707969354.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0006.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:80::10) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 2779faff-f5cd-4091-5bc6-08dc2df03ee2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ed1tg7uikCt+4GsPP15i27eLyILdQtQhMDraekZztjvxdxdOXi7ivshJyj5NJEVUrZEG/71u3+kv5rktPEjF6J4iItHiTFe45oYTlz/8G4GjVmh0pB80jTb+aM5iwkYyk/im9/geloBQ6PE4AMq+L4wO3pTB2UCdvJxnVB3ns6PSEw9KOIqRDD4GuYWLC/3v9qQ4tI3NNHvgpKSQPbtAzUwotfDJF0OCXOv/1pEm/fDlvX3P00UTfNgZD5tVgKutRpmsosi19dz69F11SH6tM9GSsdJI0kbbaFMvGd8W/BtQYD5OAwnTo8F3Cij1xKS8DEvGrx69SuxY1hd0DhJHNSKn0Ys/4b76enRFp/7b26W6Y1FG5dP2WnY3uLn28gOhLczADlYM4UKCQmCqrioApZ7weKFaCCbEn+kaONRZIQg/cLv8GkVGgNdipdP86Z743Rk144BlZ5mqTsQPaq8Vo2ZBeNrg9B2cdw8dRd0oaEVEygtHwrXqg4QgbeK8wjucEWUVNWU/YsTsOblkBXePoDb4R9sTdSpQsf1NTitqZF5bE5TtE26UrkZ3++rz8deE X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Jta3zftKSHvMYyeqxi+LqAo7jeoZB6TLecjk9YM4vY9URXZbaLH4J9o6NjhUBHifTJzvhauTJsb2+8UfgzigCcBT1F+DD1ZEbDRoqM09nfFpSPiNFG0A7qcX3S1LtbG8BuIONctT9+msalefd3QjTU5nfmtY9DgiImGPQaNuSRAQHnzOFRuAwaPsAYfzqmZ0qlvmTf/ydm8L/mGyGTQ70QH0MJ6iSCMMaNa1CCgoxvMdKqKktZjH7jJRuMfaj0PvHoKBhXpcq8aCxZiE6s8iCkk2m1G3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1cbA0SRf3KKHkQ4cmSM7lt8Fol34GQlk5g/4zZbtFwLF8TAaZfdXWRDG92HJ2KfJ/GkKvCeNk8lMTcuxorn6M9ef1jkG8y/mNmeVzEVW9LyyjbjrXXxBWZOvQDQM0kifKi/K8zDd4U7oAVPWGJTrpCYe95WGHF2XwfHSTBVzLC/5kvzfiocq6XdrfyMc29bGuNLPyf3u/g2QD6jQN7+6E0Tp5dRMTUC0sg4TLOOF+OeSY1/gF227neAmQvhhcvEz X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 2oqQYCqdDHZMHon1QOoSUuCiITd/vnkbOljjm8FNT5ugxzWxJG/6MMWu1ITokkgHa0PURi1mnEzu6TjZnOao+GN2nCMe+TwsgQJgQMR9SPzG8vFcWKpZ22yudbmw6eoMzxHnbuGn2AJoHir4LAeqeFfUwsBQ51J4WRZ+CQJUijCS1Z7cpreiKKbMeJl8KCB9iA7UJBRwB64siudBTN+WrDeyVh89V70kss4vTWF9oyeaSRsQajOYWAd063op5cKP8DukRF1B6TjCjMVVDiKi5GxE0jwyEoArPYlGxtxgi8bD4hQU0eV+13+MqAsf2z1+ksb9nKI6kFo3KwrFvkbrdu0bW4B1XvJfQv2T8UlEwZt4gHP8iTk+eXXO0JGEUlbI5tsI0mDdcIAeZOrejzk5ERQ7kIrbbUCsYv3KhWZyXI0ksrGTnx7ZKPBW5vsPgx1nJhikHb1aSzN6/fw7WwdljarVgCv7oOR/Ph3m4GhDI5xVcvMDWlm4WVExEigdWvGyLmN+cIIoppc/0Y8PaH+0eqHqpMxOQnQtk+YYn2cybw4mR/bRoD56skiHW/lhOXE++ifR0n6sOSkMWNICD7HpTh+nlkGFqAOg27nyEIlIZR8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2779faff-f5cd-4091-5bc6-08dc2df03ee2 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:35:05.4734 (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: EaX5JGKvom0xfqhvfdVcJ4EwsT4w76vSodMH612fBGizItr4BBkoiwSwBWwLY4dT/jbeaveyt/1CrTSEenGkew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-ORIG-GUID: RCQhWcb6d0Jc20B9cfjfhGTBiG8QP2xa X-Proofpoint-GUID: RCQhWcb6d0Jc20B9cfjfhGTBiG8QP2xa The function create_cloned_devices() takes two devices, creates a filesystem using mkfs, and clones the content from one device to another using device dump. Signed-off-by: Anand Jain --- common/btrfs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/common/btrfs b/common/btrfs index 5cba9b16b4de..61d5812d49d9 100644 --- a/common/btrfs +++ b/common/btrfs @@ -826,3 +826,25 @@ check_fsid() echo -e -n "Tempfsid status:\t" cat /sys/fs/btrfs/$tempfsid/temp_fsid } + +create_cloned_devices() +{ + local dev1=$1 + local dev2=$2 + + [[ -z $dev1 || -z $dev2 ]] && \ + _fail "BUGGY code, create_cloned_devices needs arg1 arg3" + + echo -n Creating cloned device... + _mkfs_dev -fq -b $((1024 * 1024 * 300)) $dev1 + + _mount $dev1 $SCRATCH_MNT + + $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/foo | \ + _filter_xfs_io + umount $SCRATCH_MNT + # device dump of $dev1 to $dev2 + dd if=$dev1 of=$dev2 bs=300M count=1 conv=fsync status=none || \ + _fail "dd failed: $?" + echo done +} From patchwork Thu Feb 15 06:34:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557469 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EAEECA4A; Thu, 15 Feb 2024 06:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978917; cv=fail; b=LZsqU8MRfYMdtD6jM7CN9P3ZvFiY0d0nMJc9lN4NztPlQ/lxgoEnhgYdb+Gp8VHDFenl2b/AvMgIchpciXghCYzoORovyfymcsF4o7ksgHZXgHQk4onlN/HoxYJFnrS05ABz0DfsdhYaiiPk13uc9mVQCzw++gSvx2atOgSiwDA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978917; c=relaxed/simple; bh=9QQqTfts5FA+UTGJJOGP1NVdHOOF2YRIHgWcYnom0vQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=tUZsnjS75Vu/nweiWW+twBlS13s0BGAS18NDMP2BOyQfg3GaFNnBRd/08QBA/BcvJOu78Jzlnp392VqG/Y81ct0eBTMc+/GhHOznvTHtbLVGmyjHBGzZA0nd8+x0Pwk9kfrBEBxFo5KX8XwvGXJ6dkfKtrZo+ZlJYis12NbRaAw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=DzxYg6q1; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=JPvt4FjM; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="DzxYg6q1"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="JPvt4FjM" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41EMhnf7004446; Thu, 15 Feb 2024 06:35:14 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-11-20; bh=YHl4nSW4lBHimtuNuB+GXRB4k/USDCnoiG+nSMyLZRk=; b=DzxYg6q1C0lJjY6AwbEHVMQtYKXbulnr2XHakDhcXM9LiKxodMyFevWJu6MyYy0O2c0+ N8oO5UfYs9qXPqyUCW+EuiDErc57e3fBrg4PN1tWTfLVa0mvly0XY7t9iBTo/CFAGwKo NIKcs7WTHlzfvwGqCNqBtMe4xk4Hg/YKRxwJnq7QGK0fpiye3q43lQJilmFFkl8tdnlQ Yvh9dIIXRmb5Iu/aPAjhw9p0f04HekFtGzoxcn1q13wK/+t0Hp5ded6dcbUokyM4ObeH brsJbJSqUsxqhg2kZ0IXGHJm3bzFTxNxmkoNYEPoxvuqEBykxswSsCEGIoUeSI4/spvu bw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w930112ph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:14 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F6NQhr014989; Thu, 15 Feb 2024 06:35:13 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yk9s7a6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=llXxlnGRbGkzlkzoMkD1Os0Q+6q5ytgQOVWrGdeZ3dssChrbKUqqkZLRAfzs8iHcyvxgI4jbtquV6v6qJVYy7v5+deeZH2d9g7UOIEK4Tu6HkjR/I5z5Yh1MqqbngubteK6MlDWayxpz01UPy0D4sklRVNUSGXvpNQldfK1PBOt9HPK7nJCFd8rjUkXtbc+N1bpo/z9Is7m7QiPGKTm6QMlbBu9508McY8JgtrPSyBpDJYk4E8VjB0jL2woeNY4m+NL5iGex1XLXxaM5w6bTZVvzNnGeR59CMEsuHL6Cmy+ctUyby1jVZ3w7SaJvFMyZXbt5bndEZoTG33W8XNB3lw== 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=YHl4nSW4lBHimtuNuB+GXRB4k/USDCnoiG+nSMyLZRk=; b=odZPbQ5cuagXHC+sVxE6Yi2/1vRnSrbQA1U1JqicpEpM9UySD+h3BVm3P3xCN8HSqv4mTSyWC/xvkVTY7nH11GwCFJURgEN7yCMhWvMyXLHM09RnVEUTbrXkVvOsD/NB5qT81CswXLdnHOIuS4NcsRRrZtm9f4iH2jy64Sj60rN8adf1vmDUo0CohC+LuKS9UhtF55QmW3JYe9tL7+SmXSS90grcsIv/14SAp3eFey+6JEqcRHpS+wOrkquMA806PVcdUERW8aYDmc/YLbuv5wQD/GppznUsFqnm7iBHZ0/uOj61YmukKFqRsSjkLvRfdZ6B8bCEXwb3R2v6y+QJUQ== 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=YHl4nSW4lBHimtuNuB+GXRB4k/USDCnoiG+nSMyLZRk=; b=JPvt4FjMrzW0W2eeZWgO7eXe/GX50PiCbH7dweJdnOJENtQQWo/MuBEjIMi+lqoB+ZvuE4gAXhRN4aQ6iDWNt+R1epOKcVRFUcgbxgnE0B2cRn+AJ4iswC6BCSA3hlppIma+4xPDhmWrO+twj6cUEDfleJeuIQeKMjN5+mVp6CA= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:35:11 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:35:11 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 07/12] btrfs: check if cloned device mounts with tempfsid Date: Thu, 15 Feb 2024 14:34:10 +0800 Message-Id: <7b0f9a055c331aba64405adf60f616c5922c90a5.1707969354.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MAXPR01CA0097.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:5d::15) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 5067d46e-7c71-492a-6bb7-08dc2df0429d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: chUHSZ+Mn7KRBz/cS4LCegWEl3vrHGPRMAMwcQMY4bEKfNvkme8rs56EJj6piDus3nw5rzoSgsSsxjzuLAGax5cDWX16+vhFFlipF/chT8+wg51eS82gLv/xDsKyK0DXgQvf7cZlj2oxiWvZXF4V7nNl7I4XEB2nDN0AAB7988LIZ+e0uCe0/UG7kGLrU+Is8bAMmAsgXRvDbt7ApOoQ587F90JoGhMp/eALnm3AtZCsN165cCkEERc6pgghsjqAL+PVsUfC4iIjFegAmfmWB800vHagiEbkwvWcleLrnlcwRBRBGEwdT7kNaHEWxa7OT0aFOyiN6WzcYWP/766gWtXxwpezZbDy+BKRBb0uIebyVkw8VHFMeXPxwcGvk8oj45sEpOSd65Jo2j47i1uCZjwwccQfEXNREVIRAJF91kM3lkkh/ClwD4fFWOxpz9Hdn9lMulISm9IyCYkSEcARXbHKUU1e7tUOEAjbnmVJ0hldPYLRvjm8+pwWbsNPFzlyS2PE9JgSD1TVA1ERZo8//f1ozp+7yXL2nCHVxbYlhLVJ3bZpiMZUyhK5NN4rr0az X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(83380400001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4ttAhNirkh749aYnoiA84RalNHOSD4cSW1UgTT9baeURG7LrDE5n1HkOzozkEaaE9Ar839MiZ8tj/VJeKNoDVn+DYiB7J6QFVq7ha0OjdDN1qKUZMqKaQXx3VaofQfSoHoLzj3Wrn8lbsoSVoXcJ/LyUIzymE+M8yZWKElZhXr3oPM0jgWs2QKXNZyP4YIsfPcFrtrFyfsU/sTmMnRuHWqS2qw4Mn3yi9eBVsbozf3W8ke2nC+h9pTgEvKvKsqdiwEtqco8YUmVXSZRYB/oQrU7u2qBJSeVaLAid7FxRJG/aXSlqAOSxor7ErOzYjNLGOkwOpas8DDyXGjJPKn4hg2uJ0SQChSb5Hs1pBLn+juraJC7yXTUUB5MpZ8yHONRg+x7/7hYtQMKvklPlSUnETI+plssAWDzRGB1TGx+IUhCgsiz59GnXrQG/K7GqM6Ixx7PMLiLcZiEinP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Wi/L7aJaJS4xqDi3iVjozIcDtYpL6YeXN4tSD0ngHfRY9z+qFM05nxggDKPGtLg+zu4Xe2TJ X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 086wWt/R3yfpJuVeXNRT3S5wlgA3NX30GZbdCK2q6C/HM4RSATZM2JWNxKp3svbJy0hUWz8FzAsgPvqs5Qptodv+7YOtEQTACACS7DXTJenQWvXLSHgjj4GhARjQHYQdZzFzHlCs7xRcJKf3pyARVx6S6Un0p764ZhozmLIf674zV7jwlz0yZ9y2u0tNwUyEP+OtmFOo4LQZUkbB9klY2oNFPGhkk84cFeSSAu7FG6aeS02ivO049Hntz/xaE27xJlln6HC5Vd5ob9FfDQPalIiaeE1Odb29BARR0XRq/BNWxWf8Eo07M5MTtLAfpcq1/W0Yju9aRpT/aiQQz87BA/2C6X5kFqwx7qU5FroekK86yWOkzoK75tA/llcRoPqXfPR43j+sZZv0wcxqjaoZOY9Yq193vbLoVEslMbhzIFOg4TlB7uuIsKwiO4RLYV8DBN9maZqjlkj0rfQfRjDTfQXOfoZIP8g14c+hGeaQF74npTSvjQ9VRMDXBqMbpIPZtaLunX2pzo4UvVJeHZ8YkezHt6QBjk35Iz17trGepypMXnBixL5QOmT0tVPTlJyWCW0z+7VmmmSXJGt2USbv5qd56uzo9VTTzwWOvG/1qcg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5067d46e-7c71-492a-6bb7-08dc2df0429d X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:35:11.5669 (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: GLdjoCGoij1qdTtvX1e+rn97zw5HKm/Wun7BYpBG/ZObs8xUYTDKvWQEG//4xmhYsOba+F6dGrQvBl2T0dbBBQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: H6FjbZBBQ2HNXeL40ZzSHm37T2XmJ7fo X-Proofpoint-ORIG-GUID: H6FjbZBBQ2HNXeL40ZzSHm37T2XmJ7fo If another device with the same fsid and uuid would mount then verify if it mounts with a temporary fsid. Signed-off-by: Anand Jain --- tests/btrfs/312 | 67 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/312.out | 19 +++++++++++++ 2 files changed, 86 insertions(+) create mode 100755 tests/btrfs/312 create mode 100644 tests/btrfs/312.out diff --git a/tests/btrfs/312 b/tests/btrfs/312 new file mode 100755 index 000000000000..782490b1c62f --- /dev/null +++ b/tests/btrfs/312 @@ -0,0 +1,67 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 312 +# +# On a clone a device check to see if tempfsid is activated. +# +. ./common/preamble +_begin_fstest auto quick tempfsid + +_cleanup() +{ + cd / + umount $mnt1 > /dev/null 2>&1 + rm -r -f $tmp.* + rm -r -f $mnt1 +} + +. ./common/filter.btrfs +. ./common/reflink + +_supported_fs btrfs +_require_btrfs_sysfs_fsid +_require_btrfs_fs_feature temp_fsid +_require_btrfs_command inspect-internal dump-super +_require_scratch_dev_pool 2 +_scratch_dev_pool_get 2 + +mnt1=$TEST_DIR/$seq/mnt1 +mkdir -p $mnt1 + +mount_cloned_device() +{ + local ret + + echo ---- $FUNCNAME ---- + create_cloned_devices ${SCRATCH_DEV_NAME[0]} ${SCRATCH_DEV_NAME[1]} + + echo Mounting original device + _mount ${SCRATCH_DEV_NAME[0]} $SCRATCH_MNT + $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/foo | \ + _filter_xfs_io + check_fsid ${SCRATCH_DEV_NAME[0]} + + echo Mounting cloned device + _mount ${SCRATCH_DEV_NAME[1]} $mnt1 || \ + _fail "mount failed, tempfsid didn't work" + + echo cp reflink must fail + _cp_reflink $SCRATCH_MNT/foo $mnt1/bar > $tmp.cp.out 2>&1 + ret=$? + cat $tmp.cp.out | _filter_testdir_and_scratch + if [ $ret -ne 1 ]; then + _fail "reflink failed to fail" + fi + + check_fsid ${SCRATCH_DEV_NAME[1]} +} + +mount_cloned_device + +_scratch_dev_pool_put + +# success, all done +status=0 +exit diff --git a/tests/btrfs/312.out b/tests/btrfs/312.out new file mode 100644 index 000000000000..b7de6ce3cc6e --- /dev/null +++ b/tests/btrfs/312.out @@ -0,0 +1,19 @@ +QA output created by 312 +---- mount_cloned_device ---- +Creating cloned device...wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +done +Mounting original device +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +On disk fsid: FSID +Metadata uuid: FSID +Temp fsid: FSID +Tempfsid status: 0 +Mounting cloned device +cp reflink must fail +cp: failed to clone 'TEST_DIR/312/mnt1/bar' from 'SCRATCH_MNT/foo': Invalid cross-device link +On disk fsid: FSID +Metadata uuid: FSID +Temp fsid: TEMPFSID +Tempfsid status: 1 From patchwork Thu Feb 15 06:34:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557470 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 602C69476; Thu, 15 Feb 2024 06:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978928; cv=fail; b=NCdtOmu8HB7El556yGi/G5WfzmEa/JhWwu+44n932+64jq7iwKccjLQaQCrkga7/F28UgR9jSsoRy5lM/WzPl8muXpO3fO7OMWQhjqEKwg0DWsHrxvgOsFVVvYsn4NWCHnLunkIch0wkHI3RhVdTeqSFCuvewCMe9LAskUgj460= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978928; c=relaxed/simple; bh=vcd8V4srDE9R+U1Rlb4pSByIK7oNJ6phKlsLLe9QEkc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=evlxRChaTshD0IbEEE68ad/jgM1zDcYJuF8jT/YbvWYTeaECL8g5cwNilGy+3r8buQOHzKVcmfS6NsYaoFxXnni1FhtBc7PEpB25m9RHkcARNfMoDW+TrbOHlpw7Dp7YUfEAL+yBPhOlaymmo6O0o0mATFqIHfVxJ9CT7NfpFxA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=GLp2k/YJ; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=P5cD3tdB; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="GLp2k/YJ"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="P5cD3tdB" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41F3MvJB030752; Thu, 15 Feb 2024 06:35:25 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-11-20; bh=GGrBqCPJLTRmKIFT5WzDeLEsL7OjpyPAv2d/6LViwg0=; b=GLp2k/YJiUv6cVdvyocXYaziJlX09XGTOuKkeYXO/8yVSbCh8+sqwvkBWdJd36++6oy5 gaFxYmkoomW9KAaCJTSl6dBEEvde6gef/DpnPnb4qREQWGResdxdZZR0S1aEVeMMt1qW wmdAfoLGF6oQTtBbHXDFwGBhto+rvl4p9/KCHN76DPWuh44xkZfW/Ad686Zp3y35EbDU 2IyzEBk7oDf9Vpa6E/Oh79pqDdi0w6KLrvoN71UTgby0Swr3mEWsHn85LwrtcCqHgQRP JRDRaihm74IvWOZIjR4TNwhsSWjDrDLOEo0I9hzlmqn8vMh2GBMfsfEIrMH9pq4wC79n dw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92db165x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:25 +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 41F50lSD015097; Thu, 15 Feb 2024 06:35:24 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka290w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nNNWCHp6tjqfDgcPupjMUozVOJOuyMRiHdkCBer3Qq7XlRtuQ2BbsKZ1UNwNXw/WjSSt/FSY2CFyucOJMjwSNBmJ0kjIhuXMFYwDGQlFKWcZhh92rnLurmufAym0yKa6XRd51YCDWCZ6XCtJWPDiHJsqoLRPCU7GHFXNf8cHl3a41BXrDrFZpKl7cIxjkTFk9qC8TXREPIHsFYNCqCQbN+qBgU/2r2iYRYh4ZDf9czrLvKYVeCz/q5EnHoWgKDmmAGB0ySd29SzQZjqXlo8kM9LPcMXRpNv8NXxaqTvWl6x8ZL2XleiRYK3F+F3JiKC7eqwIALYlEiu5/oZhp+/8Hg== 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=GGrBqCPJLTRmKIFT5WzDeLEsL7OjpyPAv2d/6LViwg0=; b=XGUzyArtenRDCQXIvlr+oQfcPViye/Y11BVqGVrxbk7jj4TJ602xErbFxLrBZkVhkd2DX3DvzjaGqEiR9YSt4TLwERaKqlndNw4ymNGuA8uAdj7YFAn8a4E4dEYo9rem39Ar3KDU3XbHOlPYIkB55odEQS/axa8bacDXyBURGVsGlslSyTuX/TvsroXcCtnj72fxLlprqJOzg3kGfDUIImfQcDc/mEMxnMWMRnrfZKIyus+QYAHNeA1QrmnWnNYhFkmSM5RYCq+5IEgJSSS+pS9cEA7XQQmPrIvEU0lo/48DkTUK9mcnvp1F9scc8xWSts2SsD76t+TLTEYGqpi+AQ== 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=GGrBqCPJLTRmKIFT5WzDeLEsL7OjpyPAv2d/6LViwg0=; b=P5cD3tdBM5yY4+N1XVUuXAqTG1bJHqIm+Yw6zaMK1t/Ao1E2tPP4bWYH2wgq/CRUvkFHtHBY5W/SPvMMozZ79xSjru3Kj6bU6tbYGf/T6z0IEScf5CjOgyKz11nqW6xtHbcY6Kjw3KxpCzz6rk/xNz4hLJDMXlDVTYG5QOdseOU= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:35:17 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:35:17 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 08/12] btrfs: test case prerequisite _require_btrfs_mkfs_uuid_option Date: Thu, 15 Feb 2024 14:34:11 +0800 Message-Id: <4d9c26252329f9cbbe48a77c58e8ff42d0b45275.1707969354.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MAXP287CA0001.INDP287.PROD.OUTLOOK.COM (2603:1096:a00:49::13) To SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 8376abf3-da90-437a-5410-08dc2df04641 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q+FwmJ3VAF490y5yBedKK0HxKf9cIW5VXbXqMQEu0DPGxx+jaC6y/CXIYSDs96QgHMsLx30oZty/rfDmVVz+dci0TsOGr0FDR/D2oBqVLdwczjcYn1N30AtUGq4stRNZQ8mEJapZPdXvp3m0T9hlXs5Le5syRbkwT/nMAEdk5a4CajSH410lwwtlD91Q3GF0l5nWVDYMG/7ooHNAanmOhySEv40ikT2BIRdwv0+SuUL3sRwCvok4ORhS0GQkF5nl0rDLUNyR1qGdeP57OaqoBVMGHEGZyKPY6U0MKicYehGbDYrexMdGbEN4sos/90QKH/0RJvSqMcNrm/BW4Nf7ZOWCxnS8pHcyCax4gyEtEe0bkab8nl0/EehJL52FbUTQqIyvoUNKwqIu8+GO4QKgmdfhgwAO65iUA+RUU2MRG4vpbkkvtoEt7IX/DNTq4kiXU3CGK3noF5Iy909GKguXpUVc1nESV6jEekSTHY5uMt84jp6vUkH2ktLEcYfmFeFmCFxBIkMyc1l8EGUwW2n2rETLuzdMnbjUlDEGn5pveU4ps+poz0UjyKtsUf6CS5+L X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(4744005)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: uvAWFHR/Ky3eDfmWqP+MPC3vH+F4s3RhbceSgw6jiOtaqPF9xn6gYISGww17Awab5AmxQcnEpY8VuxnxjFUyGEL96sMIP1eJPqSx5w4c1uUJpQr1+oQkENcKANF4RGpw7uMRszTUtI5AT6EdFO7tNY2H2LokRc/HaJ8Oco7cIh2ZV5I2m3HXMESOeet8sJDzI1pw4Woo1wmPErPys8lTbrCaFNwuTBWoxTM4kZ5LtiYa9zhs2SaFNI8mArp5UVSSmyhU0PC4zDZ1W9zNf+QbDoPWEGJag/ahMzipT5UjLTeEWtIhQP1BvGDYx0+ddtdLbSYTDTDaRnMFqSkNO4CnkIfIOksd/reez0mntqc8rOdddI69jwfXxvYZttakgzVrjJVF+HIxNTA7Fzv5e40bH6fVjPKZMwKPok2LaC3QCO9DWCPpufdE0beldDR+EWbRIfogmDQt6qO5pIpmlJfw92ei+wtz1Hy4eVhgthZYxORDxz8gNw4dj9GNZuZ6WV+J9HEg/73Yu7tmf2t0yH9TiIBa6mhJj/D2WBOWQAOCpdCC8IUhzA9pVlUhj5i8Kt8mgHkf99ZWg1urqzb/v9TN/Kw45lKXaX6tWSfjDBgBGlTVpdOPXZoQqf5fh4qF875W+ci/wDmv9DRcKin50d3BmIVyPZiZXR1iORlU3nbGFaoZJNeC0Ug6siNm4o7sbvUwBbSui5F6mA3gPzGKAid31BLGF5XAgNN1EwdQTaIjADWEgWTDnpRa4ycNdFWrM5onE3gHosoCUHn04W906ShGlB0JzPQmuIL2fUfqch3uzBg8h0zEirIYz8KYwJEw4JazZcldyMsw+W+1qncJV/Vi4CFGOK8ZlfPm2YEdxjDml9TNH4kBLxmDSuY5jZ6oXMl97nW5HlGLVahTbA6EWwJ4nIePgAEYClu1KAR333HyY1FovQ/jQ7TWnxh8lhQtdRZTg3eZti8N8ooGaVnE+7K8fUJ333ci7ZMfjJATjonBBNcZpT8/0nfH5fi92tYShZBmJ2yP9M202ETJsXGyEXUNrS+2g9fQcXjIht1dSCYxUijwSnBle857G/peb+mNijzmirRcD7XSHM1Ue0zIZ3ebyD4oBHcJs8oclL1tPXVJzIgi6hJlVsxX1E5TrXfV/vpOHD/R+AOno7WDt4kNqOABUTJxxKVIarcU62AjHUMHUebsb2UfHVqjbSb0Ij/l9q+Qc24yYt+faMwGN6lLEKvHscS+qxA9yRpytH9O26d9Ji8rsn9ytEn8fTWHv2nORMp5YXacTyHhcXeQs76R36gPDbC+q7uZeD3IfbKL5WF5t86mDjg667LAZBYgnxFgFAC/MIx3syfPlRCfSpEJT6curA87sCpjUIEHFi/9MJnvxBYEzd9yuzEjM9hJUgtTZsUthltqk/9P/f9khg0PeWzKrfPu44BjVo5dt2ynEi4csFF9Lkqv02zgzwdomNnMdpr/F2RmAm16Abcmr8NKzp3uUrSNliOUT2MG+c1WUVCDHWOwzr+R4aqp8Oqfl+sTXEARaAspvh+EZ/xwl1Eltskt+dmBKyjphObgMawWgFX2t3pPoorwAz4s4k0RIrXt7sPo X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: oS3KBWyRGc3B7kC/qBbpscQIq09DuETRMATEgw72m743gm77nRUgPLpRR7qLBu+tMFxc/u7/9LmifEAvpybLPLzcfJtXxtkuZ2GpN9jnqFqLZ3q8Z30J2HsxiiaqERG9KkWOY6KernQtRv4SDGHteurw3oAIJ5khudW0u664PZt6DxizhH1IJzHNCy3Sz/nrV0oYGZv8SPr4x4RXU2hMeXmbUWmVNqD9rBiUO+6otc6BfiXBZtiaHxgTfw774sjkGX68WC2ZSm4m9q05qs9LaHzKY44EX9Qfl+L8+ymIO6F2MzRCyDec9+Zi0il3WL6ticazZmz1zmi/auBO4v9EjUoasz2PwioAS4WDBXFgp1Ldg96A+9WDGKV3bLpnWFvLhk22Nn/+uHHpcMtZhl+bogdz4T2NG5PxRmU/EVav1Fc+63nO0OxbnmgTf5nWrNkhIk4of1I7xCEMaiQkLPBfhpRato1VidAjCAkZE/qz08119MhAsiBDzKJfRTOM6fTYHR42KH/t5N+akJ0Y6tjA0dM+/wuKJ7440fUEijBRQlke9kSq3+rNo7TX2bElwsbpmR/wA5Z5AqmrFXJEIX+26LoxDPQPQut6ca8FK/61dJw= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8376abf3-da90-437a-5410-08dc2df04641 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5694.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:35:17.6626 (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: vwokzPB3Rau7fVkzxntii0aHRy4d5N7BxlWjIeNLthI+dSf0ubaii9ctkSOnfwqdt6B8KTZZ8Tg0S4e3JOCGuQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: bwdC5kTz8TBh5npYa5sC8P61Gh26vnPs X-Proofpoint-ORIG-GUID: bwdC5kTz8TBh5npYa5sC8P61Gh26vnPs For easier and more effective testing of btrfs tempfsid, newer versions of mkfs.btrfs contain options such as --device-uuid. Check if the currently running mkfs.btrfs contains this option. Signed-off-by: Anand Jain --- common/btrfs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/common/btrfs b/common/btrfs index 61d5812d49d9..9a7fa2c71ec5 100644 --- a/common/btrfs +++ b/common/btrfs @@ -88,6 +88,22 @@ _require_btrfs_mkfs_feature() _notrun "Feature $feat not supported in the available version of mkfs.btrfs" } +_require_btrfs_mkfs_uuid_option() +{ + local cnt + local feature + + if [ -z $1 ]; then + echo "Missing option name argument for _require_btrfs_mkfs_option" + exit 1 + fi + feature=$1 + cnt=$($MKFS_BTRFS_PROG --help 2>&1 |grep -E --count "\-\-uuid|\-\-device-uuid") + if [ $cnt != 2 ]; then + _notrun "Require $MKFS_BTRFS_PROG with --uuid and --device-uuid option" + fi +} + _require_btrfs_fs_feature() { if [ -z $1 ]; then From patchwork Thu Feb 15 06:34:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557471 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 04CB3B67E; Thu, 15 Feb 2024 06:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978928; cv=fail; b=nXlrKrleW+Kr4SNAWcL4xNf6DSAGuBtYix5FzkL/ylWsB7rDVkh7EmbUzEqEHKNH1fCovv8NqBN6uZCkxLl3IvQgBDAmuZ2TsZLJD+9jxz4advmCFeeZMiNe2HKKj96rOe4q2Mbflr7iNx2Fr9V7Y10J+x52tg9LTbGQf3pcTHI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978928; c=relaxed/simple; bh=Ao2+rVDY7yOPU7mw8J33EBlxvnndTh3Z4e70BTiQLDw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=uqno1Ibj5cOZQJyB3i9/IRWiueYCTr/9eHdRS23o6Keod/tlrcDU8XTUnHo5CnBRpF81OOCAOqyNb8mgZl3l8XJmR8jX8HHh8LkaGRokA97F/vMwD/XXf2h2Wsxl5Ehr65JV0VMcMyLbNrV+W6uveMeAZaY2vzbqEyeB/8sjlRE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=bchacB44; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=CLPvv0IU; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="bchacB44"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="CLPvv0IU" 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 41EMhuVp007343; Thu, 15 Feb 2024 06:35:25 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-11-20; bh=PvUrBgyf41qto8bPSqUyEJgsdOV+H/t54e7csubINzE=; b=bchacB44sHrr/hc6Oyl9lYPF7cdXGHfRk1+B09JX8qkMVAlseQoxAPhtvZ/u6i6BwJe2 jBul6MAydbIEiX5Cp5117L0ZhVRozeLLzTZvYZwR8wusDOaW7zeNp/OLIOeM6yO0Q4zT 4o8kSzB7BqLHkI3CFSTLtsiEHbrLuAFAqFWRH/3Lwz6c1ffZrydYKr6QPXkMISylAdks zD+5m3oftdVwEADpDCDqf4ivDBdcJGDtUOm6hKTlm69SazUrO9YQ3bdu7iV87JuqGy01 D8e2d+EPXrzuTHWd6a7wCvcEZuQ7NbZlNXoVskaPcPr9eNu0Ipk9LMQQwCzJz8ZJptej Ag== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92j0h5gq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:25 +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 41F50lSE015097; Thu, 15 Feb 2024 06:35:24 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka290w-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l2JN4htuAZjPDIz3EnQqBqYSEFDNd/4tfmM7kQGrtu+Rcy1W93UVD6nCQbzg/+y7KPq+nxNqopZaPh8bs7LUoJQhnM3qyVcHtffevSGV7B1h6QEovbVW7P43MXNP0mhhhgltOGQE7zzCVwNkgjpWEQju/hTrwqkh0FzjLKZMo67wx1UOWD97gOBPSbrxVeIAUlqm0BrphCZ44+bDs2ZeAsULAi38p4EkicEzTsevtVXUOR0dSb4Het8oymcka5rWtOdT/UF2HG4kaQP9kh/D+eulgXzF3JZQs1am4ClPuDdwG3tEu2XCqy6JEhjQXb6GnBM8egZc/aCALC1TmBuxuQ== 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=PvUrBgyf41qto8bPSqUyEJgsdOV+H/t54e7csubINzE=; b=cYkbC2zGjkoNU8M50BCsSZAanYc7xWwySROrZlbtYcagkvLfJuqVij/aLFAiK/eYopbloOIpDnmDypQDh/wWa8tv9k3xVGHWMhHRxJtv28uJvptGkdQkoIJOPAWO9FDR7nHvglaC0GUEes0r3bW+6Op7qS4AejT/X9Vde2CLCYhwZyS1A7UzAKjrlenoCfYObMhnOmbXwNgNSLWPAkYQS3rUYBrnRfcxoor58vuY2odgk8IztA1nSrtRWDzEOOyOOJdoN390MBaVF3qUihuNj4+4eoYx4yCJk89Zbnoicr25C+mJU6wUjn8p6flbpmgkVv7WkgaVDNZJoBPLzLfoQw== 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=PvUrBgyf41qto8bPSqUyEJgsdOV+H/t54e7csubINzE=; b=CLPvv0IUplv5MD9olI30Vd97OzmvjBpvYqMfRLQklLnQK395W7xw9Z6SAb/3QyzOBpUbRIMJm3QlkLu+CvF7DItsrI3whWOxcn28+6NfgDvM8wP5YGRNNXWn80Z3AOmJbV/ANlPnAz3tuI3XXXhyIikkxV0Xlr+hSbVJaAZk0Pg= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:35:23 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:35:23 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 09/12] btrfs: introduce helper for creating cloned devices with mkfs Date: Thu, 15 Feb 2024 14:34:12 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0118.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:11d::10) To SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 092a0348-18d6-48d7-243e-08dc2df049e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1aWB0MgnB6Pcd+N01Z0pq4ekwR6d3ihCz3RcAE6Dc9XgLrjNqWvxOEkckkHNgOTaRqrvmQPPGxRKGAvzvsl49G5Q28Ufu4JQc1mlX7rgL8t8QuhWx6hgNcCrDROabPyVavP1nF4X4iDNdF2ieteNGxj/Nga30WH8RxE8eYaY/D53C9h9R4Eo+JE7jalHPNg6CudLSuanV98lJ51+IP+nj5vAtEwpJUZPMtQN1vDjZTavIk+ATwwUy0UBDVj98tAHfHfvpCS2Y1cPAbmOScotoZo7wzuTxkM+B5Lnybu6tSCwg/LzcAZH4gRtXOm1/sLS8VDsWMkSsYxUQG19LlTyJRxOTgYW0oqHJ7C8cr+68zYNwKfNdOJlkz1DpYu/zJn3tQLreangjdvjPAmBedR+TxxYKkfB/VptRmUXPXjScottjB9KF0bHpqKCXlWeXdcEWtgRHNdpioHbBlA8POYuOW5YcbP5LZPcjqI5es5F6IQtFxaYmtHE6YQ/U+SpgSPtfHtS96ZQO/E/7lT+pxGc7NPGkUPNO0fEG8TVw5heVGMZV+ssYLuQ7AvjxSvlyxCZ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(83380400001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiS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CBs+QmHvlzD1VaOsxDkz3lPW4Kim8V4dPBLVJw+QxkmZ7iaSsV/1TeAK+8z9pSFNkcB230jsqNfpxE/zJHUid6eTkCRTAbxOm5bHjqLp4m+SmDGik0ddBE93z/Wn6YzzCjT4CVcc46I= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 092a0348-18d6-48d7-243e-08dc2df049e9 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5694.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:35:23.8152 (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: m/0AwOWQw05jiF5aYGHeUCAZu+74WpcqhH1ryN0AyiFouhozxf0FlZmt0dUwLYxQ7bc6h3zW2nH4z9lT7Yo5dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: XEowKuDuzojl-JkwTC7YNmh0vf0dH9IC X-Proofpoint-ORIG-GUID: XEowKuDuzojl-JkwTC7YNmh0vf0dH9IC Use newer mkfs.btrfs option to generate two cloned devices, used in test cases. Signed-off-by: Anand Jain --- common/btrfs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/common/btrfs b/common/btrfs index 9a7fa2c71ec5..8ffce3c39695 100644 --- a/common/btrfs +++ b/common/btrfs @@ -91,13 +91,7 @@ _require_btrfs_mkfs_feature() _require_btrfs_mkfs_uuid_option() { local cnt - local feature - if [ -z $1 ]; then - echo "Missing option name argument for _require_btrfs_mkfs_option" - exit 1 - fi - feature=$1 cnt=$($MKFS_BTRFS_PROG --help 2>&1 |grep -E --count "\-\-uuid|\-\-device-uuid") if [ $cnt != 2 ]; then _notrun "Require $MKFS_BTRFS_PROG with --uuid and --device-uuid option" @@ -864,3 +858,21 @@ create_cloned_devices() _fail "dd failed: $?" echo done } + +mkfs_clone() +{ + local dev1=$1 + local dev2=$2 + + [[ -z $dev1 || -z $dev2 ]] && \ + _fail "BUGGY code, mkfs_clone needs arg1 arg2" + + _mkfs_dev -fq $dev1 + + fsid=$($BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | \ + grep -E ^fsid | $AWK_PROG '{print $2}') + uuid=$($BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | \ + grep -E ^dev_item.uuid | $AWK_PROG '{print $2}') + + _mkfs_dev -fq --uuid $fsid --device-uuid $uuid $dev2 +} From patchwork Thu Feb 15 06:34:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557472 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42073D51D; Thu, 15 Feb 2024 06:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978935; cv=fail; b=S0BMoGHlhgjqfSrm7D2U+BVOZAzjW9BZn2YpBT6M4Z74QViXVWkwrukOb34fcWA35OoGAZDDg9VXPOTVLarrNUxdJGu7TJ14QWIh/annn8nOUlHvzGXfGOxK6SMKrkqF9bUZXK8YkEwg/bCpRSUu+QO3vRnB4Ss5i0owtPakqm0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978935; c=relaxed/simple; bh=GDq1v+jQMKzgcpJM3E/RTly+J/O1U1bJBYTwoB/Y7ok=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Sg2YVEfpMxEzu73fmctD39We05IhAcWI0UKL3tgmuh3rgZgPiihTGp8nfhLoO/3BWmbrVp7ELOmBiIR76hyRZEkoFsKf0a5WtcOhNC99OwccNBq9VEZkc+8+60CDGHLTo5+WyAC071+GtUkwVbaxmzqHLL85P6Mb76PNDLKa3as= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=SVz2nkqA; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=zF9nx0TD; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="SVz2nkqA"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="zF9nx0TD" 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 41EMhtDg007321; Thu, 15 Feb 2024 06:35:33 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-11-20; bh=GXjuM1+JPMuxCvuChu8heXqdUuhXbLpkMDAOUm2onUQ=; b=SVz2nkqApzEOpXZKtJCFpKuVPVmtYjCNLy2emOMNiHncJoIt20eXLgAPse17jk4YSBSg 7zFphUoOOtIwPHQNNrBvo5xeS98Mk/9CT8pcywf+TF2bdMTvTojRQ31SU5Kxj/NBJm7D l26RUMD49CuEaLDAPRobnJ80n+ejzw2kxepN50GPiZJoShqCkYtE5ZLE0bIvcvZ1eGVP OmLrvu1TrMsoahmy1C0L6AdX6LdX69BU8T50kFC7Tkm4bOTEC8yd9NzZGLxyVYKFyuHj lp68XW2u8CLbD6L7P76hCWCrGOsykzLc9PEKUfM+0w9kCcEaARbO4VTN31qNlbluy440 xw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92j0h5h2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:32 +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 41F4i5UU015073; Thu, 15 Feb 2024 06:35:31 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka297c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:31 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJDgRJyaY6lEpu+GeMI2I+UyOxwYLg5lxlwkyDofnn4gd3ELxBoWOTbdWvwAP8j3GtWr5AAMhzySowbw6eM1Bd4WNRi40l486tS+OYWsk1fzSJMXhagkB7ykvQEaYGi3jXK1byFs6nHelN0i47CgzVwk42CSQnSZby6DkABAfKyPgsBC2fgYKJtF60P+j6Qkvi9m3fBAaJjSJzfgty6S8fuSyGg3+5kCqYm2zqHgVbs0E2Tygxe7RfmiYmlARmNJJPb8UNi0VXQw8jkqtTYACuQacimJGrDZBkYujsadZMQgHskyxbfxVL3MpDIvx4tu1rJFC101sRR/RjFcJQBHIw== 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=GXjuM1+JPMuxCvuChu8heXqdUuhXbLpkMDAOUm2onUQ=; b=F1oFQ3vuMgyA5I93YxjetL1WIKlkVi2DMigyVq9tvnTEQtYxlYNSV5vS84XnHER05iGH8aO/Q0DM0O4kuYTmpIx6Ej0NrScqvnjuhNNmzslAU9+kT+Pt8XqBF6HAV1ByKusV7eP3H194+Wt4om7kGzhfKhfXuJng0DFM4SLNO9P4AIrMNsJjo66XhkYhAqpBeKC+1U06DmP1Ksq7zBqEqVrv0AVpNA8sQNUB35PUNpp5q1NjjCLYrgu09Yh4TGxUewdbW2kbAO6ZkVxyy3ThatjpCGIHLWlVzEKShDaPtgIGOs0C8C/IJ/upr3/DETvRbrQFJUS5oBThcJcNyzf9rQ== 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=GXjuM1+JPMuxCvuChu8heXqdUuhXbLpkMDAOUm2onUQ=; b=zF9nx0TDfX8WLxuq03IuYCVhAfLwEZI0qXAzHUj2vWPfPvTqX+S1zFwmmVAnAeY3od2qCXWB9D9NBWpCTzwdPv+iDHyj4sdB/SeEngXKLwY+KEde3efKAmkiAF3/P53TUfFnHuUdbaiR8+XWlskRvMY06da9HQgIaPn29ceM0ao= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:35:29 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:35:29 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 10/12] btrfs: verify tempfsid clones using mkfs Date: Thu, 15 Feb 2024 14:34:13 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA1PR01CA0154.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:71::24) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 53d00e32-49f9-48c4-1c12-08dc2df04d46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xyOmU/OTt8cRSOegirFR/yJKxpBblyf6oyoGpMm8ecZFrpOE8uRK/E8mJ5V4GS04fizcW8YjkCVi1OtDVYW9+6mvslMqaPrrD1s+q03rwZz/jp0EdBAS5JhwY5t99Ug8xj6bxHFrZRD/nlF/aMCdljoQYg76rDQFWuhqwOoXIi6Q0LUER0Ag15gXFfI3MEwCyttU7Yfkl5PfhsXspGrXLnvhLi2nAzKWBq3S6wV4W/1537W4Zvo1JkWiZyobrKThMfav4LG4L5IyjtAg/bcrUyMy6hwTRyxFVv7u5wGfyQ8qx8Zlruz3eejCXgwylFlIYbKQlzXsZ64AAGKaRiTM9sAagP0QpLkZCQ52Tgha3iPdtuxhWhi7xZslELCq3yGySROLs9qUFx7/BXZLHKZFY6y1bNZmz0evtEgCksWONifQwI/CUt1+Hj8A9IVaB0M5PoUhHzgoNG28KefgKRN0vpp7uKkEuuV4KaTOkbtHxw/NHA9xFBX7zCUsmvJYFBfS2SIQaandbQ+Vafc/bSQjROTl3o802PceoKWJ9IknsmavxTFFVAHBuIVyg9DS7y2d X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(83380400001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dy8eolh/j+BfTezhnIr6XuG/j/NMWzF2QU6159IVXS3rHhhQOJDRGnwnW+FGI1Alw38ECdDS5ldmYlejEIgd98fbJJTRqP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B97MXCdN535S4DH6A77MffR9OEql9Jl9VzmO4WbtJ56DgmnCBlCqiZ7yt/1sFw6kqPuLTO13CH8JpRorZoR3Qw2/+s5Pkju3ioc9sqnpkw3NAraZHfI33xA+H+nh4JOhGV7/oyf/uwDGQ202VfRks4PhFxaiVH75mXtPuqt7BL4+7K+y/xFC7eBKLN9hCXZEsUTNOLCACJLta65FBejW4+PdDkGR1YZCBmdpFG9qGJ4YOgrc2+g4IhLya0fItCD65H1Guo7UWBfnUtonun1YuvWJE8srlhY5Av31SFE8KkYk8vT6n1CPmvHpwzR30Jjz3lrQIFiSjl36fyuT2ylwzGqzDRdJ+sikC3qTw8rbm5f/jksuNPWTfaUip0Knf0b4A0X/w75Fcz2TcR0iiM48YhNK9NJqRrvTfsUh/giWS7dV X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: YbhYv2suZM8VZhY2kZnBJi39Voa858rxZqvvrhX4Zm8NQKWlxsZWdjVTwADclZtREP5KRVRV516pPxQ3LtIiGleVcmR7BMkgxruASfv2m/XlIG9MQCdoSSzbWGWcv0pAjMNE7NKJSoWBdn1RAKCLWxv001p4gMCWNEtFVw5qLUh4AO5ogVsIdW540TtaprjqiSRXbn4qv4F5gS+N/1svRRoGtc3mVVAEvs06mpRoh1nssVmtvGdx05q753TksffE+YA8Bh9Ua5Hh5kaUA9AcqT26EAyD+KiSt1zpg01snfGEKh6PCkjK+OTuySn9ufLm+BXqsguwfJc2qFr+0r27Pv7skgrLeaW7vrFNXFc7j/OvhGeMyoA6vtIEWbJA9lZsk5L9TvH4nUs8RDkSEQ5/D84PrJiMcsU1+hxwXOVnBCe9WVFrA4gUHL6tai60d+o3RDbGvv9BrdERBB1d5rVJqSSXVPC+t82TZMc9GCp/WhEsa2+VgU6lkVkrB12vKtMATTDgIyMTjBMXTjPdLmofvLn0bFcfZFiJa3yvlwEbODGDqGG4++k9guCrLqS7uYqaoY90uXGucIl0Rpxs9VWEF3ET0nnQ7ea/Vbx24h12Cas= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53d00e32-49f9-48c4-1c12-08dc2df04d46 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:35:29.6322 (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: 6DNwMczWFy6NAqP/ob+kmu2yz5B6+rnUvZlsfIqU/Ytp8+p9ydmNd9ISnyLRHj7hn+17Xx134CuWOnVNyKa8mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 suspectscore=0 phishscore=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: xkaYI3rxMjwMppIXU3qj5f-Uxy-O4A2Z X-Proofpoint-ORIG-GUID: xkaYI3rxMjwMppIXU3qj5f-Uxy-O4A2Z Create appearing to be a clone using the mkfs.btrfs option and test if the tempfsid is active. Signed-off-by: Anand Jain --- tests/btrfs/313 | 66 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/313.out | 16 +++++++++++ 2 files changed, 82 insertions(+) create mode 100755 tests/btrfs/313 create mode 100644 tests/btrfs/313.out diff --git a/tests/btrfs/313 b/tests/btrfs/313 new file mode 100755 index 000000000000..45811320e596 --- /dev/null +++ b/tests/btrfs/313 @@ -0,0 +1,66 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 313 +# +# Functional test for the tempfsid, clone devices created using the mkfs option. +# +. ./common/preamble +_begin_fstest auto quick tempfsid + +_cleanup() +{ + cd / + umount $mnt1 > /dev/null 2>&1 + rm -r -f $tmp.* + rm -r -f $mnt1 +} + +. ./common/filter.btrfs +. ./common/reflink + +_supported_fs btrfs +_require_cp_reflink +_require_btrfs_sysfs_fsid +_require_scratch_dev_pool 2 +_require_btrfs_fs_feature temp_fsid +_require_btrfs_command inspect-internal dump-super +_require_btrfs_mkfs_uuid_option + +_scratch_dev_pool_get 2 + +mnt1=$TEST_DIR/$seq/mnt1 +mkdir -p $mnt1 + +clone_uuids_verify_tempfsid() +{ + echo ---- $FUNCNAME ---- + mkfs_clone ${SCRATCH_DEV_NAME[0]} ${SCRATCH_DEV_NAME[1]} + + echo Mounting original device + _mount ${SCRATCH_DEV_NAME[0]} $SCRATCH_MNT + check_fsid ${SCRATCH_DEV_NAME[0]} + + echo Mounting cloned device + _mount ${SCRATCH_DEV_NAME[1]} $mnt1 || \ + _fail "mount failed, tempfsid didn't work" + check_fsid ${SCRATCH_DEV_NAME[1]} + + $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/foo | \ + _filter_xfs_io + echo cp reflink must fail + _cp_reflink $SCRATCH_MNT/foo $mnt1/bar > $tmp.cp.out 2>&1 + ret=$? + cat $tmp.cp.out | _filter_testdir_and_scratch + if [ $ret -ne 1 ]; then + _fail "reflink failed to fail" + fi +} + +clone_uuids_verify_tempfsid +_scratch_dev_pool_put + +# success, all done +status=0 +exit diff --git a/tests/btrfs/313.out b/tests/btrfs/313.out new file mode 100644 index 000000000000..7a089d2c29c5 --- /dev/null +++ b/tests/btrfs/313.out @@ -0,0 +1,16 @@ +QA output created by 313 +---- clone_uuids_verify_tempfsid ---- +Mounting original device +On disk fsid: FSID +Metadata uuid: FSID +Temp fsid: FSID +Tempfsid status: 0 +Mounting cloned device +On disk fsid: FSID +Metadata uuid: FSID +Temp fsid: TEMPFSID +Tempfsid status: 1 +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +cp reflink must fail +cp: failed to clone 'TEST_DIR/313/mnt1/bar' from 'SCRATCH_MNT/foo': Invalid cross-device link From patchwork Thu Feb 15 06:34:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557473 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 443A0D51C; Thu, 15 Feb 2024 06:35:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978941; cv=fail; b=MwkhAvmg0+5xKbWMvOcx+aOn+ZpQ4347ctpgBO7V+4hGtDowibJ1Xwo6qNo37znvdIkvUQcKoP/YEXINK+kZXvKvf9QI7B4Jy13DEnSHE784H+Uxo6xTzeYoa98cuuYQ105AuXzutSJOzydGAD3aGvsklb4hwEmJLYXDrYekOAs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978941; c=relaxed/simple; bh=7kwNLKhVl03OYtbd9/PKLMXoIrMnHPX+jw0cPBHjYz8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=nx9sbdBJpOUbdUG73KwSzgSP6/5UkwzLuzkNDi6yRYC5K4I96GQK1ZFBRDe7fmdYEAHB8gDQAspTne5kOlmUU3WzCzNMfwFhnJpVaEPyTDIBMTB7dQPaSWcTanM1yzxc6k4VRHHFPdld67rx9Mm5JJ9OnzG2FTMPD39RWxnNqLE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=ktT0ocSN; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Lz/1oWrh; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="ktT0ocSN"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Lz/1oWrh" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41EMiITQ027842; Thu, 15 Feb 2024 06:35:39 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-11-20; bh=ljlUFOGePRNYf1XUI2UPq5wzkyHvTO6BFCB0JVKBGB4=; b=ktT0ocSNOl52H2a+/FmgLUJ9xaGg0hV5Z/pP1UuqLcsxSlw7eT4Pg3eO7o4mrhkh+ryT fycKFaf6qBXI8863kg9G44qCgiHiZ0ZCVljFiSl75bszOQ82rRz2V97FtoioHKvYAs/f oZFgjCcI7KVMTPj1o5P2EgFk6KWNQuFQADtzu3+jxLyFSNuV+N42TunHT66MLxO48nCH jyxtwL4Sz9A1Pz91IUsT+XtfJYPF34L5GmajI+hhZD+n+7Kw9t87DiK++7N+AL+qldC0 /A0UjMmvoKNXDyrBed+4AN9xqYg8XwNxJFwBybERHTpDYkSkEFXNALYv0+a5bbZyQs+a KA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92s714cn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:39 +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 41F6TNTJ000640; Thu, 15 Feb 2024 06:35:38 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yka2vr7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hDIi+S2/AIAP+CUTlNDHA1zE0taK1OsHmISPnSCLgvgT2MZTACho/+v+jJ9Y5ZCTpl75L1uD5rP9xAuYLP3ze3pnpHClk6fW1KSQXE51tN2k0VYzjjVKyEAFxPENNw80QRxPI9GiPgDi/XsfZ3SbvZLPjfLRKrqm6YrDi9ZBiMU8AFUAltHYFQJjelgmEg8d89pwg35EOzSgCW8bMk6w1f7XLxJmYBUnxychDFuokrljpsiPR0cak6Bozjmee2L47YGCj5rXR/W+0azw7W66/Yyvx0ZtFSDWbe6NoDCb2mTqsAxFGIUiRpYL6EaA9wswR3tNiirWZcOuYn4O1WGFQA== 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=ljlUFOGePRNYf1XUI2UPq5wzkyHvTO6BFCB0JVKBGB4=; b=TnyoZ/wU0iIgzYBU8YMH2ZK00zTQDvrSaxNEY8I8e8dV3kA//h3FqQpQUiuyA7ET/HQAlvdQ6SrcUl+TH4leQHtn+MfYQOvlJL1w6VymwA+AONx/u19rDgaY5ihGHJR/+lmGXXJ2TfLE/eXctvqjcfovowdj6ofN9xaIJlCnDQXFigKCgl9ExC7/HlneF1+rZGjsJPSGmqg2wogD6DjlFIyN3n+XIySg8cYYF9L730vE52iO9BnRv3R0LKuYju1tQr3thrIXAp2Sg9dDVud89yafSUqHjwHMRa7FC+6XY1yqI3xHstdNdLpGmg8zLB7214iixYSXex0SF1o3U3Legw== 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=ljlUFOGePRNYf1XUI2UPq5wzkyHvTO6BFCB0JVKBGB4=; b=Lz/1oWrhAsaP64O+T6rEtBr/pVxMWmYJs3Rc9p5L9Z0IBuehjXcSIlq95VDI6aeOgrJqUpzLCPSs1OrF0movcXzZJ5Sf7IyMKzacnG89oaPeOKvlCYjGMXrBMNScmvZ6y4FC+9BbYoU5TefkWZsEZnxen3ENn92d1e7GbraiS1Q= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:35:36 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:35:36 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 11/12] btrfs: validate send-receive operation with tempfsid. Date: Thu, 15 Feb 2024 14:34:14 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MAXP287CA0022.INDP287.PROD.OUTLOOK.COM (2603:1096:a00:49::29) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 0cc1a549-60a3-4981-1460-08dc2df0513d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oDHZd8aufKmi6AiIjboMTR3x1q5MfX2mAfz6mSZfUa93d+hVNNkU+dOf+quVcLNnEdjmhnhhf2lsT7ULoQM9dhpQY0J4BXFEUDI4vi6VzI38A2p7+yTTVc1yMqVSojqwJ2IAu9ef4X2ZErbFNPme7yvR0Sr0MRzCDK3y6Xt+WU/QWEHsF3xEWcL/GFpF4dKzZF9cIyFY+C0JqGZwSV3k+4sG5QlHCyQrv4cnD9J1ZM5OSZW3grmje1J14WG4XTcCcnOJ5r4Gc5dBQyXtgaRcXVgL0OI8PP0rn4ntFBHjY62LTb125LgqBd638di9YeOQWLOyMQ0qAB8bEY3i7KV/MdndyNrxAAGGAyE4dTjCWn+XJ5V3RFPvgroNEKCYRXXbB91sgggJlNmuldP3WhFmMtuaToxL7C1RB5q1TV2j2AS5WW0oh8fqemYWBGdnnnJtkaX+7OrCWrBJTgHn5Amyo96MngRjz3kYVgskv+SJF2scEwKpJnEwv223atm/7DhsVxWMhYpSjrmXYzZ44H42yWYoDnWEso9DLP6IVQ1qy1N8YzRyuq8u3FeUJtzM3S0e X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(346002)(136003)(396003)(39860400002)(230922051799003)(1800799012)(186009)(451199024)(64100799003)(316002)(5660300002)(41300700001)(2906002)(44832011)(86362001)(36756003)(26005)(2616005)(450100002)(478600001)(83380400001)(66476007)(66556008)(6486002)(66946007)(6916009)(8936002)(4326008)(6666004)(6506007)(8676002)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e9WlpwR+Nb3ibtbs7U9kYyzJPRECckxi0BSL/CugZYwfib24IuWwc8XKe9y5g/t4H3sQTWX3XlF1Y3Dysb0ohZw7ddEl9T2N0Cy7YCGy5A+rfPA3fMa1vNGJqP5uSshtWEUsoB95UazzxEuyPlNdxppVCFI4XwMdKoQe2uWZiDAYF+QKr9WIj9SDsnwaQm1uZoKMb+gicGywGDlJVtCmhT/YPLnuEUd7PLtf1khPro/DEE7QEvoTPzAROheNPYgOvpNyFWKUB+spZ9WCwq7U5QecBtJ5IN24IncYNIa3ircNz7KYOeXpQDrXodSuCG3EnZNjSR/lRNb9TZyyjFftlGcrPYLnadd0j7VOqrS5kqxNJn8mk90/PKAjaXh1m7e2BIajuDoUMCTIGFSNFlwuGGUoEKqiNEAVk4FtU+1bJYlWHwpGgn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I8Ep4fIBRTcmgdQaUBT9jNmW//CEsSfgjKUnYkrx6K7kpsbP6FsqBV4Khp077Ugwiv6PS+P2Gdg4RaAcSyhoBipgtdA X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: L9Jywqva+Vpzhcfds9cvSG5zHzG0SXHQhaWyM+uHX2hiBrDGfLbQFWi4YEGlxzUvll8efPnO8t02sM4fTk/y/5vce1/Q5sB3OrIwDtbqBI/BbIkQOCSxgRUcqRwKFOuFHgfbhyRCTSlfe9w7qqFzApRuk8MOYThswgEji8YQKMrB7nNrQWSvhG3uDImFHzTSHnBbP0vVTuj/qWcPbP8niYlEX3SUOLFm4/DHH6E+zNztyXUOyXCIdtShBHnWHpAXYqVedjknAk/pg9I00XyrAe5N/zj8aeOHqQGOqKy4Nqt4dkxww+4IKzNH2F03UPNpypqRqKwXuXexqwBpuYG/KC+XQrD8KapXUypiCcBBi+J15F+8FNFYlpyI2gG9s4GQSGyy/6DMzFpsL+uodq5yeKJAdf1G+KP2uj44GM/zrQgpSjBOfugmc8ITHaUFVuvGTzVFfJ8FLz6bjmE7IlfDaYlMjeFicaYcXIisVX6AuwAVUrZSK76bmWB02ISBL7/ZBAOrANXNrVB0rSGYWd7viV24BrQ1UstaOV+iayUnOFT+CQHHeM8GDKexbcSiFrL3JmUfGSoivCvsyIOsKg+fD3o7X+dDXjGcmD8r24zaVCc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cc1a549-60a3-4981-1460-08dc2df0513d X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:35:36.2677 (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: R3AGXYq+s0xOSuFFRHDQpJW9GwPuLHgAs1BcaeernD1oI/+dEchB6NDkTt1vzBtzLy9VCw3UJq7qmO2WbmHxAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: S_Tdd-ze6k9yQ6xB_nKW-sBD8qPj9l6h X-Proofpoint-ORIG-GUID: S_Tdd-ze6k9yQ6xB_nKW-sBD8qPj9l6h Given concurrent mounting of both the original and its clone device on the same system, this test confirms the integrity of send and receive operations in the presence of active tempfsid. Signed-off-by: Anand Jain --- tests/btrfs/314 | 85 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/314.out | 30 ++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100755 tests/btrfs/314 create mode 100644 tests/btrfs/314.out diff --git a/tests/btrfs/314 b/tests/btrfs/314 new file mode 100755 index 000000000000..1ceb448d2a5e --- /dev/null +++ b/tests/btrfs/314 @@ -0,0 +1,85 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 314 +# +# Send and receive functionality test between a normal and +# tempfsid filesystem. +# +. ./common/preamble +_begin_fstest auto quick snapshot tempfsid + +_cleanup() +{ + cd / + umount $tempfsid_mnt 2>/dev/null + rm -r -f $tmp.* + rm -r -f $sendfile + rm -r -f $tempfsid_mnt +} + +. ./common/filter.btrfs + +_supported_fs btrfs +_require_btrfs_sysfs_fsid +_require_scratch_dev_pool 2 +_require_btrfs_fs_feature temp_fsid +_require_btrfs_command inspect-internal dump-super +_require_btrfs_mkfs_uuid_option + +_scratch_dev_pool_get 2 + +# mount point for the tempfsid device +tempfsid_mnt=$TEST_DIR/$seq/tempfsid_mnt +sendfile=$TEST_DIR/$seq/replicate.send + +send_receive_tempfsid() +{ + local src=$1 + local dst=$2 + + echo ---- $FUNCNAME ---- + + # Use first 2 devices from the SCRATCH_DEV_POOL + mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} + _scratch_mount + _mount ${SCRATCH_DEV_NAME[1]} ${tempfsid_mnt} + + + $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' ${src}/foo | _filter_xfs_io + $BTRFS_UTIL_PROG subvolume snapshot -r ${src} ${src}/snap1 | \ + _filter_testdir_and_scratch + + echo Send ${src} | _filter_testdir_and_scratch + $BTRFS_UTIL_PROG send -f ${sendfile} ${src}/snap1 2>&1 | \ + _filter_testdir_and_scratch + echo Receive ${dst} | _filter_testdir_and_scratch + $BTRFS_UTIL_PROG receive -f ${sendfile} ${dst} | \ + _filter_testdir_and_scratch + echo -e -n "Send:\n" + sha256sum ${src}/foo | _filter_testdir_and_scratch + echo -e -n "Receive:\n" + sha256sum ${dst}/snap1/foo | _filter_testdir_and_scratch +} + +mkdir -p $tempfsid_mnt + +echo Test Send and Receive +echo -e \\nFrom non-tempfsid ${SCRATCH_MNT} to tempfsid ${tempfsid_mnt} | \ + _filter_testdir_and_scratch +send_receive_tempfsid $SCRATCH_MNT $tempfsid_mnt + +_scratch_unmount +_cleanup +mkdir -p $tempfsid_mnt + +echo -e \\nFrom tempfsid ${tempfsid_mnt} to non-tempfsid ${SCRATCH_MNT} | \ + _filter_testdir_and_scratch +send_receive_tempfsid $tempfsid_mnt $SCRATCH_MNT + +_scratch_dev_pool_put + +# success, all done +status=0 +exit diff --git a/tests/btrfs/314.out b/tests/btrfs/314.out new file mode 100644 index 000000000000..eb0010da264e --- /dev/null +++ b/tests/btrfs/314.out @@ -0,0 +1,30 @@ +QA output created by 314 +Test Send and Receive + +From non-tempfsid SCRATCH_MNT to tempfsid TEST_DIR/314/tempfsid_mnt +---- send_receive_tempfsid ---- +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Create a readonly snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap1' +Send SCRATCH_MNT +At subvol SCRATCH_MNT/snap1 +Receive TEST_DIR/314/tempfsid_mnt +At subvol snap1 +Send: +0598aa54768194ade580b9806ac98ace43a0310aeceae95762f62491625eee52 SCRATCH_MNT/foo +Receive: +0598aa54768194ade580b9806ac98ace43a0310aeceae95762f62491625eee52 TEST_DIR/314/tempfsid_mnt/snap1/foo + +From tempfsid TEST_DIR/314/tempfsid_mnt to non-tempfsid SCRATCH_MNT +---- send_receive_tempfsid ---- +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Create a readonly snapshot of 'TEST_DIR/314/tempfsid_mnt' in 'TEST_DIR/314/tempfsid_mnt/snap1' +Send TEST_DIR/314/tempfsid_mnt +At subvol TEST_DIR/314/tempfsid_mnt/snap1 +Receive SCRATCH_MNT +At subvol snap1 +Send: +0598aa54768194ade580b9806ac98ace43a0310aeceae95762f62491625eee52 TEST_DIR/314/tempfsid_mnt/foo +Receive: +0598aa54768194ade580b9806ac98ace43a0310aeceae95762f62491625eee52 SCRATCH_MNT/snap1/foo From patchwork Thu Feb 15 06:34:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13557474 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C41DD51C; Thu, 15 Feb 2024 06:35:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978947; cv=fail; b=YhZWnfGOtu+C06qtxlXVLycjJmJvysrWLeI+N/GnzggG1BCarQxhQ1rhyMOTOZmHwg0Uav6kF2nsnGU0j1naWZr9MAfdwI6rfBaNhQW9PnRK2kLLtb7Wbs7XmGE0iTjnWYjmQhc8Pa5ZQ32GYzQzJIvD3FBULGs+qW5mFBA0Y18= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707978947; c=relaxed/simple; bh=/A5vSZoSwC/0jQgjji5NVmqi0I8S7XZ83c+KSW20B8Y=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=E7SenbR7NTpdHRD7tU56COqrkwukqb87FRZIFCa3KOJZiEzpU0P7E/Ub4kw6409rSriOguOpyM//gve7sjwXzDjmZmtbaxgmjYIzqSSAz62dG+HF5jrP1SM37j3TKR6+GlOdIWHzU6y9kiV7Kv/m824pbelcdjCeLMvb0HCFgIU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=YtgtNq+r; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=JxAbueL4; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="YtgtNq+r"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="JxAbueL4" Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41EMht2j007007; Thu, 15 Feb 2024 06:35: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-2023-11-20; bh=fQTPM7JDKI7D0fPB69RACJEFPEEirI9tF/KhLTsp5BY=; b=YtgtNq+rzgqUibUF4BWGaXdeEWAvmzr52dIXwMC8rXOseSNqYwoIcPPBMbWrsOq4pqBs cSgn9lnZRSxYTlnRNc8iYbR0m2Uygw4y3t596iDRnsXLFkvoaY3abWSGscVtjaNKwLVs KdbovMmcF75572kE1dYzxY4vawkrG9XnUVPeW7kcicdaGPGd8N359JBS6J0C68OHZemz XoqMas7TELCFwKjl1/f0Rc/yts5sAz+pFd7GI+jZ5LggL/D7iccLbVtdwq1Po1/3ZZU4 72Z/HQvSLROtVww3dqJEojwIdcLmW0bd1QEDFIerDAVYdZAZgEZfQSzb43JulLmAiwsc bA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w92db166f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:44 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41F4WalZ024577; Thu, 15 Feb 2024 06:35:44 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w5ykgbdf2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Feb 2024 06:35:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ROG3/vmkGeib2mgN8IWbQdd7gZZ1F5E0Ud17pqAFgBGSXHHlm6VGfJoc9mFEFEL7FdEH/LL7Ba4Z77RkX37YBFVgD+SeOXZ+TLphW8pNeXY5rJSmr8Fxh9sgq33j2n5SRBu6L8orZGIhTK/QmT+ebxgRiqNnnQgBhMjFUU42tccTXm63Z0sbdUDzNEnvkYBNlp7H5OUvb4J6ic07geALf7QJ0jJSrh96OzDSgJWig3F2sK1DwIJ/bbiuaZMM4vFTgVRbXBITpUU/Qcm9ebltb5Sq57ITlZ5jOnEQBBuHVMJAYS5/MiO0T9HRM4TH7Zcg39BNyeMivoBtTngdfxQemg== 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=fQTPM7JDKI7D0fPB69RACJEFPEEirI9tF/KhLTsp5BY=; b=VINkRPg7or4wCN52zQD9qOXxFj89zAvcIDatT4o8IAIwY93hh/K3tPfhmq4hs0JGgI5JU6cKr7s5x0Mb04WrT32UcBm/5YC25sZEf345K84BCjp3EOKbtKoYF35bzHQF6LI1hYiSTy6kY/KYmHYXtGcgammZ8QXT03TOesmPeDAKkIkopjUOtOiqGRIOKoAe3+bjvEPNtmOPnPb+ib1jBQHv0rVchXK4bEskqR+MdEzhLV2VY7i+ggaCWLU+1uViGack3zBDVed4lLE0kYgb33ilwGvrHBzE8jIIHSR1vZMSaOb5UI4K0pRo7p1sNU8Ngy7hB84+/q7/T1eRAc95qA== 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=fQTPM7JDKI7D0fPB69RACJEFPEEirI9tF/KhLTsp5BY=; b=JxAbueL4Ap6L2MlI4Du1etQXJ3VrHoZcAfF2J4uZU8txsxD6mWG2zOkgVHYxB1Fc7sI4EtUBcQo3BqAwqWhv1o2v+CeSzpirDIGPCoScRc/psm0z6KZw5q/dA4PtNRvhhzWCThusji/K3v8YXoyRqBniDeWQdOhJbVLFbG4IhBo= Received: from SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) by SJ0PR10MB4544.namprd10.prod.outlook.com (2603:10b6:a03:2ad::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.25; Thu, 15 Feb 2024 06:35:42 +0000 Received: from SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85]) by SJ0PR10MB5694.namprd10.prod.outlook.com ([fe80::8711:ada3:7a07:ec85%3]) with mapi id 15.20.7249.047; Thu, 15 Feb 2024 06:35:42 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org Subject: [PATCH 12/12] btrfs: test tempfsid with device add, seed, and balance Date: Thu, 15 Feb 2024 14:34:15 +0800 Message-Id: <325a9476e06cebee3752d32fd06e75b2f478b8bc.1707969354.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0074.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:ad::7) To SJ0PR10MB5694.namprd10.prod.outlook.com (2603:10b6:a03:3ed::15) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5694:EE_|SJ0PR10MB4544:EE_ X-MS-Office365-Filtering-Correlation-Id: 8892fa25-1b6d-4fad-3946-08dc2df054e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QdZV0kJMLK665cvtD5Vcv/fEfmsL7JAPvM4phsjbgHr8IbqQMLA8bDZzMA7cuYPUEyjq/yOSA2faHnEOyaNs5klfrzF7hbCSjeIbiT4ewKQhRGFrVLqxA02ZCtZH2Pn3IiD/nZ6FdB5lIyYpfALuyh1wDxPlBdIk/BUIEREJT9pWAVVAwCbahsMXAV5Y20wcK1A8u6vIMeiL8AD5dGD5X9yMqSegXAE0/ooEJo/TMKghrrx3OZ6CrIYQyAKI45lq7NMAYeADQVZRfdR2Gjw7hRYLNEmG6n8QZs8OXsI8bSxHKYrbgT8/rh+q51BveG9BAAejN75u+3/LnskervtkQwvPBqsr85esZIMKG/cI1nkKAX7Oy36jzfCzLCUajmooMmPC3cLCYlmGlMZOPlezUSYCq8fx878Is+LV19RspPi8CobwN+4+RmJV9vzTr5G1HxJCzGb22n+c3rKj6y1Z9vyFJ8sC0xVfe0HnVW9HrKgIUctGHf5C0LSQQRg9YNy6W63TE8tl2VM+FvGTzJ0tp2dh1jrwHru6biBd027VxBFDhyffgai1krtjkclc/THd X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5694.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(396003)(136003)(346002)(366004)(376002)(230922051799003)(230273577357003)(186009)(451199024)(64100799003)(1800799012)(36756003)(86362001)(8936002)(6916009)(66556008)(66946007)(6486002)(6506007)(8676002)(6512007)(4326008)(6666004)(478600001)(83380400001)(2616005)(450100002)(66476007)(38100700002)(26005)(316002)(5660300002)(44832011)(41300700001)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6+3gnhwbNkK9FEXpCNxF4e/3PPTbBLn6y6pcVReI1/w4ouYTVl4m27QIphEl2th2ynCQf4SQFMu+nFVde+7gaGX6j+Yzx2KYBmAKpK5IlOO41VHKq4+gbIzl917jhUvbclvW54oHGWBk+6y6Pf3rqdut7dTDW3IiX8ygGTjMXndjBlHUqnMP+TAGzDmF81QIvCpHWukkxE8X+Eld7o2RSVmFsuKAKOn9zz0esOJJaZgj1v9QAhahINnA9dOcxCBZkt0lNe7Vh/Oeq0HWJ12HKjYTR/QIQvZi64IiKLOk8zX3GZo3DE3B6C3YA9RBMfHWJKZzadTonEj0PWsVEtdj+pnkjqrV8UuC5kTchY2/tvUmTcj0xUn3geJ8trUXPrJ9CQtZdYoNbOF0iEJAoMlrl4EyDUyVkDSkO8Pff/+2MY5MKl869XFITWbTFzJIEtYRDddMlSKoWG5vFlDhhRrOuGlWUx7KZwaAmuuNlvLxcbGDmyB5Y+l1M2btTUNu2yjWs+wtIo2SNhAN+FlJxLft+a7SzPvk2ZoYENHtDCkK1Wgk5LAGFjIRreol9SST8VrnMYUKqIpcekUO2rTRIgNnSF9ZEZw2t41Zo2u7lqKNysiOccpFR+Vt3ABvIpgg1RNBorczuTZbU0LQF3HJOO++zIFxH2bnGU8Tl5FFkCrSWaO/UBMCiFs3FXJ7d3zDwYprBWJAWralAwWlHOVSPTw7XKXn+QhbKKNWWpjhuMnLUMBm2Z8+eCHZfa9OvapoihB7z7occyW0670nsKzViICs1mkryIcFdlYaDys7njTDQQq8ZDkixxyy43M1RtiZYP4gC1vs4C4CRDfO6BOAi5Za7QmOx7vXe1XdXmt7exGROvbfno/8o3OmpJTnW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oJcqrUk4oLWy1icmwzaqUjt1thudeonO2USiYgqUvlCEMxB81HmD2CRKMd6TiaYAvmZWNmSQk0OxcQdQqjnzQyUx2GDgnAACGMXRB7N5VpxIFnMDRBfv19rrk6ypxQL7ZLKOy8EPUBVhJnNK3yBA74+0AAd8X+sbsbt0lZ/CddXRNrBK7o5+6KzYU3WnJeOBHbAMZ8vj9SU8NUVw7ZmI4wuA3DUJ89jyFmvnl9c9FMSP96KxjlXieRcbWslSLNe5BGMou0h4356mAGJmphnET9MBKro7L2arKa9DLrg1dGGnqTWI/oJkW+aJ/7m4ZSipC2qD8I= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8892fa25-1b6d-4fad-3946-08dc2df054e5 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5694.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 06:35:42.2258 (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: lVlgnMBhJE7OLIxg4QvfxD+TEtRDOvkerYkxk70isOqvAUa5YjBRWa35ylurt8pVapvf8X+LW+rSsa7tNOlZ1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB4544 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-15_06,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402150049 X-Proofpoint-GUID: ta-o7rZf2qqKjUC74PCGXO0f1fuSLKpP X-Proofpoint-ORIG-GUID: ta-o7rZf2qqKjUC74PCGXO0f1fuSLKpP Make sure that basic functions such as seeding and device add fail, while balance runs successfully with tempfsid. Signed-off-by: Anand Jain --- common/filter.btrfs | 6 ++++ tests/btrfs/315 | 79 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/315.out | 11 +++++++ 3 files changed, 96 insertions(+) create mode 100755 tests/btrfs/315 create mode 100644 tests/btrfs/315.out diff --git a/common/filter.btrfs b/common/filter.btrfs index 8ab76fcb193a..d48e96c6f66b 100644 --- a/common/filter.btrfs +++ b/common/filter.btrfs @@ -68,6 +68,12 @@ _filter_btrfs_device_stats() sed -e "s/ *$NUMDEVS / /g" } +_filter_btrfs_device_add() +{ + _filter_scratch_pool | \ + sed -E 's/\(([0-9]+(\.[0-9]+)?)[a-zA-Z]+B\)/\(NUM\)/' +} + _filter_transaction_commit() { sed -e "/Transaction commit: none (default)/d" \ -e "s/Delete subvolume [0-9]\+ (.*commit):/Delete subvolume/g" \ diff --git a/tests/btrfs/315 b/tests/btrfs/315 new file mode 100755 index 000000000000..7ad0dfbc9c32 --- /dev/null +++ b/tests/btrfs/315 @@ -0,0 +1,79 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 YOUR NAME HERE. All Rights Reserved. +# +# FS QA Test 315 +# +# Verify if the seed and device add to a tempfsid filesystem fails. +# +. ./common/preamble +_begin_fstest auto quick volume seed tempfsid + +_cleanup() +{ + cd / + umount $tempfsid_mnt 2>/dev/null + rm -r -f $tmp.* + rm -r -f $tempfsid_mnt +} + +. ./common/filter.btrfs + +_supported_fs btrfs +_require_btrfs_sysfs_fsid +_require_scratch_dev_pool 3 +_require_btrfs_fs_feature temp_fsid +_require_btrfs_command inspect-internal dump-super +_require_btrfs_mkfs_uuid_option + +_scratch_dev_pool_get 3 + +# mount point for the tempfsid device +tempfsid_mnt=$TEST_DIR/$seq/tempfsid_mnt + +seed_device_must_fail() +{ + echo ---- $FUNCNAME ---- + + mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} + + $BTRFS_TUNE_PROG -S 1 ${SCRATCH_DEV} + $BTRFS_TUNE_PROG -S 1 ${SCRATCH_DEV_NAME[1]} + + _scratch_mount 2>&1 | _filter_scratch + _mount ${SCRATCH_DEV_NAME[1]} ${tempfsid_mnt} 2>&1 | _filter_test_dir +} + +device_add_must_fail() +{ + echo ---- $FUNCNAME ---- + + mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} + _scratch_mount + _mount ${SCRATCH_DEV_NAME[1]} ${tempfsid_mnt} + + $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/foo | \ + _filter_xfs_io + +$BTRFS_UTIL_PROG device add -f ${SCRATCH_DEV_NAME[2]} ${tempfsid_mnt} 2>&1 |\ + _filter_btrfs_device_add + + echo Balance must be successful + _run_btrfs_balance_start ${tempfsid_mnt} +} + +mkdir -p $tempfsid_mnt + +seed_device_must_fail + +_scratch_unmount +_cleanup +mkdir -p $tempfsid_mnt + +device_add_must_fail + +_scratch_dev_pool_put + +# success, all done +status=0 +exit diff --git a/tests/btrfs/315.out b/tests/btrfs/315.out new file mode 100644 index 000000000000..32149972beb4 --- /dev/null +++ b/tests/btrfs/315.out @@ -0,0 +1,11 @@ +QA output created by 315 +---- seed_device_must_fail ---- +mount: SCRATCH_MNT: WARNING: source write-protected, mounted read-only. +mount: TEST_DIR/315/tempfsid_mnt: mount(2) system call failed: File exists. +---- device_add_must_fail ---- +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +ERROR: error adding device 'SCRATCH_DEV': Invalid argument +Performing full device TRIM SCRATCH_DEV (NUM) ... +Balance must be successful +Done, had to relocate 3 out of 3 chunks