From patchwork Mon Feb 19 19:48:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563031 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 D7A465731E; Mon, 19 Feb 2024 19:49:18 +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=1708372160; cv=fail; b=alXUyinbNtz4r2n1vqgCcgO0xR4rG2UA/awoZz/aycged/Skd4jZgT+KgdrepxgUhZvdVmRxf3lTuzEnAIXDT5M/kDuSpTT0FCxZumSrYo1+2rsfkSIXdJNVBARTnsdcTl52TP+f19H32FImTcoByEb9hiJ5hQfyAfB9w+u+ze4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372160; c=relaxed/simple; bh=IwaF1Y0qGNNQ/IQhxaFRv0TX8116vykW/SbNSpyoSZ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=T9iXNHAM3lfnkIFWxu5zVYk9XG8EdCyxn+fbtu/hHDunO1BVJcyXRUf5vG1zgsS7kQJG8njVLGr4My2OW/vFog3gmviLC7JeOChtu3h1wg5LbSE1kGRO2nKhlkWF/8FXZ6eQgXOPzLeF7wzxCRxNhXPBNQhfTPZxoLcmCiLBCZA= 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=RudzrhBB; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=P0ldGkg0; 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="RudzrhBB"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="P0ldGkg0" 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 41JIJ51l031793; Mon, 19 Feb 2024 19:49: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=WzmUgCixtOU683xoD3j+QCsxp7ln0hL1WqEEvr93r3E=; b=RudzrhBBeClE0zPv/kZqEYspzXoHEYrKuXwy/oN/GSp07nrgC8m5yoE+d8eawAkOskre xGU3TjsrcktT3bPskWJXjwjDZO3sVnjRUPrh8W6QLFwbWB4auRoDag4+bgeD/hBNC5pV 8y2u/D/P3vBV32VmZYozCRXzqMz082XC7N/iKSJVuxHkAvSuxdlk3svYb6E0s90d1Dvc CdrDkJa5uaXy2n7puYK6P1QsklBlIgXRXEBnvXZ2RDIKcV974vTWmp143YJn0jRNx01Z FBM5UqNmds0llyHvrYYhVdUA5bjJAsyrpOtM0aQz8fPSVpw8kf1IEaqeXGJJGzKsDJgB /g== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wak7ed0ph-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:14 +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 41JIIS12012968; Mon, 19 Feb 2024 19:49:13 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wak86aa9t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iOyZ3qobCof5UeeoAgEr8J6MhxGwJkNpFiKw+fXbf2kmJ+ArJmq4dvzXqra0Lh/Wvur0ErZ/MTBXTj6Y2htoF8r9GPSb1cti8EP9hZ4i03vMJx/4zeMIhh5b4UxhtSL2vPSuF7gsxQfJJZDDBS+2PkfNZratXuRuZCMfJQ94hqG2knNVATBbMD/mjoFuqCGOnLcq+/NJOP3uhuHrktrZVXhyKt88tfAf8umOPRXifUHt6xw6Y2vZ7xVRJ+YcSY7Si4tUSfjnlU+qvZOmzuDi3qhZP1ZwgszBYZAFkGWZ9JVusTCRiA1wSfqlaARlvlfQo+AoQdfVt5TssE/FzdneaQ== 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=WzmUgCixtOU683xoD3j+QCsxp7ln0hL1WqEEvr93r3E=; b=VuGPz0Rzuc4Qe2SWae+q0BplqH4OfD/b59IfXKt9y/EO57PFuQRMAVD1cSYOdyxY1ogS16nZM7NCTv/zP1Am7dcbFEoMDVy2tjg+P3cMf2wI+uQmjeKwcaXi4EdQkhVSTFecER69LP+pLXmCPh2MPeMEbkR9GQKrwYe3wfWOi5W0Xp1VWi8tdDFvmp47qWTHNcHMlRF0sD3H8AsPozp8su61M9YHg6u/LsV4I9M2N2xXOfBNDTaVyhD3kippDsbeOhQN54rDlEu9ZiT9soWDX2t/jgOIQ1qy9He0BBo4zfDXuf56/uhdGUPvpClu+uDv6W2lDRAuuCuw7TDGkLhI3A== 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=WzmUgCixtOU683xoD3j+QCsxp7ln0hL1WqEEvr93r3E=; b=P0ldGkg0DqcpzoD6lrE36CbjwMdqmltzY4jrgF+GMT/sUIVek9c2jQLEQv2oQsW6rLX523PlnfOITsZBVUxaFTfPh1E3mWSwJgsHXg//g12Oubn8xDXcI+nEozgGAq31ckY8AErv+qrzm5ZA+Q8QdMrkJ+mBgu+XPfCQd3omIko= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by IA1PR10MB5898.namprd10.prod.outlook.com (2603:10b6:208:3d6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Mon, 19 Feb 2024 19:49:09 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:09 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 01/10] assign SCRATCH_DEV_POOL to an array Date: Tue, 20 Feb 2024 03:48:41 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: PN2PR01CA0058.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:22::33) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|IA1PR10MB5898:EE_ X-MS-Office365-Filtering-Correlation-Id: 5450aded-2a1d-46d2-85d0-08dc3183d6df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F6T8xWEmLVmiv9v7Yd3dROAzTnx4awyK5LkuxMIkimFJLCYTKunV2Umv+WvAIJ6HzNd77tERPjvFCqA9oUGzISXVAxXj3YJ8HIEKhoPaS4DrhBghIAT97or7a7GOsszh/cDiI0Gpu46Wxc8jz2e+ZvhqXwvI/wGZ0ZyWyXM/q2YDuRCkhlAp5boW+IBUzGqGPafu0H2B5TxiNSB7ivb+jGguFb9k5KwCgkgwp5QZkE8vkSlZy19BiDk5VyiwSGCcyDxUkMQl+1kXRi0ykldlRJN2pfSjCI+oOBYTIbG+G41hNA7Ur9MRFGRJEq/SjFBJZ75iEMMxeNK+k/X59XI4hk3U2mDToCOi7jQ/PiD3sSSqBtBxnxChaXSAQ9958TQU951vkNYB3/nVNeovwmOLMh+niPpumzc2Hh1VGtf6VNLgngf2nwZh8p3cdH54esBVNla/umiIq6LbPj0e6Wf9QWitcrg3JYSMrJzryqoS63+6PkVGjlu5deSfSDU34d3JhDwMuck/+tyMknJfABq3HyqGOfA3+7CSIrJHeBWDsYw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iXi6sdwQUwvvkz2R+Lng6587YdE4zE/Ec77sCe409rgce90Mw3k7OEb2EhpYTSNls2b0lrLXRmT33SOkJEvFOfLpxHaDp12vtLQ2ReS4XDemUFvTo59Zc3+JhzEqC2RaBS2oXBrNKoeDKyyb7glnkY7LbbbF6raCPekjUD8bsfrffqu6iJPjJpJBwEB3ghfSRSxq/cqEdDxVXecKsze59Y+FDwHFG3Gxxg4CV1CK46RAH2jB22/WyY/eirIKEO9FsajPiur7mg+dcO8URMoVkl8nJGPeLu/PcfvBkd5t5URB6QBaub9NA2IrjnYZWVrc76/WkuXhlWOtpXpCq5zugQo2ZXMRMNveG7jgQq3HWf/YeDOku5igFH/Ep963xE7PuxbpYbyqmcyyxJnaMUepNm9/nsupNr6sZSQiAxYt2aKudsiXNVzGjrODYv2/SXWWiSlTsuuSlKbDaKaE0Rb1Zg3d2dHSmmoD1j91/e6x8f8bgaP05zIpDy2qxnlW/RJurGTZcECCrctWmezMq+dllYbZEXjIaS5uHX0YIHnTdJiuahQCQ+3eDsFKZH2//GxrAg8KkjVTDWiffW4j5Qi0ZeMpvxj/lEqtrBHpgmctsXYgJumVIYBDcirC29cNBMQT9xTSz4CNCCmuxGekJRVXNgJCyqcgp21dco5eGEHwlGHA1nwId4LjghaH/MmVc2avd08StfYvR/r0q8GvunmNS3c0kGn6PN3JGbTMS1H35Uo6TQsXp6REHhV94gB5oQUjiDisbY0gcWs5U/hBHGfae9HERokpiXchiupZUaxZ3E6hmjifGCT48krstBIgIRkmmQsUlbENwti0r6LfBhaguNDwGDZv6zv8hwblncRoH3aLGLViCS3W17F/k5MPgGUmO5nKTF71MEHJmjkuyRHfdjlXCGIDPPoKEU+4o75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6DJQsT7QHSQ+Cg88r5RuHj+C+BlkAqGHCTfoZALaduEl60MsXHyIkN8vWF+txP9rJJME8zaT4jioB8dzf9ZVjzBn8LUlqbJO/+Pp1ggMHLlVuJgfgsAwgX+zVkcwPe4q/RyoKz7EXB4eP/122HyhllYo1JE3pMnZQiDi1MNpe+yPK2JFqyIR3qSECj04TnvDAjtg6qLW0ZXJ1X+HhbU6XOotRwc1DBzKkSPYx59gsdvsaRlfXtPJEquPoppDVdoXuTZ4KwXdbSqqnRiP9iDkOzyfbpQMGv/zE9yybY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5450aded-2a1d-46d2-85d0-08dc3183d6df X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:09.8668 (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: x9cnakcfOO+wiACdznXJxJFbuwhNkUUuiHPv+nZVpGvo1b4Z2mlvThs53PAU7L+mJ1me/prpkKbu60086Ngiew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5898 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: pJl4_K6m9rrMsgUqduebhaiAL_3r_g5T X-Proofpoint-ORIG-GUID: pJl4_K6m9rrMsgUqduebhaiAL_3r_g5T Many test cases use local variables to manage the names of each device in SCRATCH_DEV_POOL. Let _scratch_dev_pool_get set an array, SCRATCH_DEV_NAME, 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 Reviewed-by: Filipe Manana --- v2: Fix typo in the commit log. Fix array SCRATCH_DEV_POOL_SAVED handling. common/rc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index 524ffa02aa6a..5d249af3df37 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 Mon Feb 19 19:48:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563032 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 9671B57324; Mon, 19 Feb 2024 19:49:23 +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=1708372165; cv=fail; b=fYWsYCU4Lk2IgmllzMxUMKH+fkbbORuF24DApWcWKSd+FxT1tZJ4OHSxSVByy9w5mtY1LO0syGjWN2RvmYzwbQfD6dbDO9RN6jUvdWWvxsSJB9QF8FPWde2ao+xBskq78xyzaUzP8Ebsa7JbN9Kr0d6pfr+hmYr+Jt0I7NeywWU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372165; c=relaxed/simple; bh=TXsIHrn5iERTenciECpqiQAG6x28tMOoSrBDWv0Krek=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=XEo+cxsKu7n6+y4EWNAs307yhgjG2rjUl/JFkcNws6e3bxXENeNaT5TtBTKy1+eymv+JYo2LsYcPemUQ0kfPZX0fOK0hd5EMFRXuzSV2N/C6FMSNKOELW+fitMebdU69Qv62qOuzabZFwFMXQ4Ds0WUE2lWb8XFIorJ8kDdxYBY= 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=RUi4xTHk; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=xE7M9ZpK; 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="RUi4xTHk"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="xE7M9ZpK" 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 41JIJ4td018019; Mon, 19 Feb 2024 19:49:19 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=CVWvXsz+AlGi1Sk8h82ITdkQqK/LRTe4opdTHGWn0+E=; b=RUi4xTHk1+V9zlNxnGp6ZdD9y0bBMst770egGtiMa89KbDxzPfwJ+Tl+gFlq0bMw+7dp qkIsmdD3fsr6ArdjIDR8Td1Qc+5JfNorQBM0N28c7an1pjyeqvnKdXIvGm27u5q3KInL cJA4Jkn00gC4MJKi3/Xo6Sc8SB7PiHPH+nZorhLuAE3bKCh5a4TpVxIJrAuyRfReL0A8 FhulWDMEw7zAsgjJjkmXyDvIfdJmw2pzlKDAm5iZwv+A6Tt7XalP6Ww8+wjigG0Fy7p6 j4VXBbahxwmxNnRnxIlL7K+GYvXkoiyy43/qozPgCITFhJXXz01YlAFN4aErsCJPOaAM OA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wamdtw04d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:19 +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 41JIU9ou012963; Mon, 19 Feb 2024 19:49:18 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2100.outbound.protection.outlook.com [104.47.70.100]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wak86aacg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C9UAc4bExGyA/CGVj+dbB4lo82Ay+tsvlOYJ5EK28L6RPRereSTQtfNbGyyqBC+TuTUO74HjQCGXCGribEvCD46LsCvLVfdhgofsh/G4L9OmhCh25ALc/7AJ+xR8URdWjMFKcfPRhnKkSR5ztqCvzCxw9OiTUVqtafJ/Gx5xf3ZHEwpdPCfmzoELb2ZremJ1gyG4vXjkm1xUvbCNTBPuaGlrxLYS+xgnDjLJfwOkOsyuJ3yQdIj+CExN99fNU7FEj6yQ/nUVxht1WLkXzTsOwflloAilsM0ZaO39cLJc1OaUyMPyl2Wnl75USxEkbW0Bh2TBaaVTfHnaFszFFsX3qQ== 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=CVWvXsz+AlGi1Sk8h82ITdkQqK/LRTe4opdTHGWn0+E=; b=cl7lRIVDJeRA2tc+RF8rvinZ9zET6oTFJzldI5psCx2vM8xVDZuhNxFkY0Bp79sQZFuuR9D1i9+tQPNYa0j2TCAAMGKohKAAWQavrJGnFG+w7vzqKhUhEy/16CWNtmT8lUZxi8/VSFUedeUJHM/U/inJiDUQhOiqljfchfYIJRFPCfU07TjrA80Mk+KOqIdJHJT3IZ6gzkcZggo9yENnTeo21rggKktGwgp5Gcs1ZvHjtUvjJkXpqVf3WWNQ//Vj+nqTtlxqp0Oz3AnJP8zhuBWgypEM0hruZqF7ixoTBZXkEYwbzl/8VlI5a2z6/W+YiHmd5JJYFG8zmRW4H0uG8Q== 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=CVWvXsz+AlGi1Sk8h82ITdkQqK/LRTe4opdTHGWn0+E=; b=xE7M9ZpKp6rPjMlIVaJQ9z8LtLP8T70ORz7hXRuI8J09xZyOQBdMJxNzT/DqNiB4MtLF79zFprKvLcg6sy81ewy0t9S9FwKBvZoEVOxv+ABS1doYi/2sWpMoxuMZIsiG79a3D3lp0+Rpm5UWMUed3lqgIcYWhMmphts/SCwQEBU= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by IA1PR10MB5898.namprd10.prod.outlook.com (2603:10b6:208:3d6::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Mon, 19 Feb 2024 19:49:16 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:15 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 02/10] btrfs: introduce tempfsid test group Date: Tue, 20 Feb 2024 03:48:42 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0062.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:ac::20) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|IA1PR10MB5898:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b73370f-fa43-452d-4701-08dc3183daa1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UrK6vBfvKEahhE/zKZyRXgxzIjsobkVNHJqm47KgkGYBegUulvhm1h6DpHZIkjqsYokeiIpFy+lYqcDCnW5x9Q+SnkRAsKchGqG1c2GzrZtDKpVgELAXTqnFkCcfKe5584Arz58WN8Dx8CoDkhsPsMJJsgWtvNmaATC/95En1GePQU9UmCC2rYdn4j1IDSBvbo5QBi2Ych4vOLS7ZDk7Di6Y4qSuWsDAHs/eBlZgo3N5tgFodPWarBCUAl/87gHlYCkdqSX7Rdc+aBoGvXdFVEnJRseVzDZD/QOCD9JljEJb9S6892SghfRxnH5SI+QTyjAynfKFN5JZfWdFuR5kCyRPXUFVKWNBmX4XEJ0gLGR+sS8fj+GLSryFr/FPBLDSh40uHGO2LjolO3ZMWZI7h0q3ER2rWtwZ4tmbU3V8pG1hwrBgh1+fdQAJN7/+5DBo1W/RNZQWKlOST1iHNuENCOPYRb68dLzudVqKetIaJUiRNXfu5+/tM/a8emjW4SbF59JXeZc52sjP+vNxlnx0tWtW35s4j467mzprFiD+FaY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u+rUjlEf+XLShyUFrczxc/p0S1i4I+sKkPdzd/qMGXKFZKoB0p4OSmdPE/ktr9c3V/SKGz4vEf7CNcuz6TF8QsNGXWWPS455RNCNQFZmd5fbsGZ1DrzVSlg95+AelhD6kTR3yPKHcBW9O+Vawb3QPvtANTd4DoHnr6ao5OsAikXUKUjaGbSEUpdgh9p1ByFlaWLOaQQjlOJrWcmGmwSA+ebglpIG6Q8UGFyXBu8tnf/OSuaupTLZGR79JSWJ5DZVFJDf7d9o9UJ4sUW75tXtyaBTXrdIFXWXfruTlddy6I3hb1EuI/VTkkCRfWsz9l+wrZWLv+7gvayht/KKJCpUNnYA34h6QtarwxqAjTFdCUENQWEzM6jM7gEKmYBZcwlll2vLVqnL8GEOO8CjsgUZ4noOrrzYKK36AemeseulEvjAipMG2SHNkfrGaWPAgpGbMoiAJIGPWnB6xoRMBoswy61HyY3a+F1GUY9u+nOh2wVM00Z1H8cIyGf6TbB8nY5sz73Vp7QgJIywKoGMM5RiTH4hWtmcwE7NTsWDFZTYNrkKFwvrAMEJ1vkSoUpJPsXtdhW5SgeiYgSoFtRKM0QMUhZapztZgphg1qrhlodNEWlwIuwajRRjVci7343psWvQ8r3nE7AheXFvX48edUyBoQpb8k9Z7/BpTEw5+tPU6Qgi/WDoX5vFG6X4T4Xr6UWV9Gj+9yVvs1Jjw/SlgIODFHOtu5LJzfPX3xFNOSMjHJYrtdK8jLtcM1Ti3sAvZIwr64AOG9YntHEl67GG3zQqdIepLfR3EKXKFXJfWjJ/zF/J75iLSE8vFabznnfr8/C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eQ0FKRMNnlc+wxq5A0So5gEGf7Vqm+bvSbCxe2BT9bBDb0nbXftw1Jt9npnmubklxwl9s7zJrpGD6dCQTztX/ZgWyFj4N3kw5IaHSGn95TamudMgk9wyWBbfraSAtAn7ViTvNsDqlA11nfK/Uqkkbp+x9cJ4o/7Ph5KcvpkNGTqic9EmnfU/NcVOQpjgxQEdG1CDJK0AmJ9CKj25W8wZTkK8Zm7JNP7hhctOrzW3hF+GB6EotXcqW3C26omn6EsuAFs5jWzrCUc7E2UWhhdzb1IcaPqqM6Q3g4QOlMo3/yXDr/kOzK8+Ij7sO0Mxzk72oL5G6cAuyrVw9JNanOMElK26UEcmozMmAJTqZGNlgDL7yI+l8M9vcLZKwF0DwYeK4JSDYJvhAzTJyPs0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b73370f-fa43-452d-4701-08dc3183daa1 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:15.9267 (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: 0LJmP+2HjY/mO0yPMTv+I/vtLtZ6IF+Ze5eu3ufcVNo+Wo0Hvy8waYyg08mXYwa64DI+inakdAEp2VALda1qew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB5898 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: hgQhn0nBOFB8MuonV8TGJUgf8_IdUBh8 X-Proofpoint-ORIG-GUID: hgQhn0nBOFB8MuonV8TGJUgf8_IdUBh8 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. Reviewed-by: Filipe Manana Signed-off-by: Anand Jain --- v2: Add rb. 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 Mon Feb 19 19:48:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563033 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 902655731E; Mon, 19 Feb 2024 19:49:29 +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=1708372171; cv=fail; b=u9rDdAQOK2XmgkNa7AsDieLBdDI4c1o9GrueiAs7LkYO8XFiYQzALhSDxTwcMBqR5edFoOnx27XdSETmTig0KReKaGyWxq/r2uEDXZf5Yo+tLYpJXi+7PHpWcgqYDiI7cKO5uUEti7P6LpZ+VB2aO9nMBEIsi9qdHlKJlbWnDkk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372171; c=relaxed/simple; bh=ZwiuERAYuVVM7VQa4PxqRYhCOWJVMcgJQyU50+4EEjE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=MeiRNK8I9LQEX+bjPqqwa2qiZZZMqk3SXtxP5e1Nw7apzdn3jE8G2UzU2D8jVIVHJC2ktkVc0cXiwTJb49TDXN3ucGKCFfGrgiwFSN8s9+8R9Xw88OLGrkYSYiSgvLxgWkwAdgmviYs/LSQaQ8dE15nbphwHec+9qoZ9LMp40D4= 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=nxjoi/g1; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Ihn0yoDb; 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="nxjoi/g1"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Ihn0yoDb" 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 41JIJ51m031793; Mon, 19 Feb 2024 19:49:24 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=lZA/jV7+IyGVI333q6w5k1r8VX26NW0R/SbQkcUahIg=; b=nxjoi/g1O7tn9xuDcTVGH/cILY+BDLYJog8MB4eTo4tWc9AzSfMMF3h6EKbeBcC79J3Z gSD8kg6L/CAeu04k5Y0/ITprhyyXjKcbOtjaxOjJXrsLEraO5kinzFGu91uwkEtTb1Sh 2/qZKhr9vmUL5TNigdFbgZ+wQ/QMEBqeFPcE6tlxnrq/yBr5efwx1U2KQkoa/UqAby4B Pgm2bnc9UK1KxOIIFOEzcrPmxPLtAIRyIn4oN/t7Q9pqnc8tDbwYehYu8VewMydytRgV 4YCC+f/Sh1nH8/c29qyULk4gDrDE1jNbdle+FjJqxH1REr1J2CBRr5/cF0YHkeWz1ocG Iw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wak7ed0pq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:24 +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 41JIPxFq006609; Mon, 19 Feb 2024 19:49:23 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 3wak86hyrg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aw2auVw9qmm7IJPE7d2KntZuZL1xx07Cubd/PJk068wrlOcUfWrvw8hk8WgCwnN5+o11qBLn5jt73NGQRQkSJOThKKnpPK7qhLM/OeWYERhQf1wwXsf/wVHt/QQDbynNrzlQVXwq7xmSCsSUdxVxRh/OdxG37ufnHSnB11xzNDWuJpKd8wZSXBBrEP/eAO02JUX3LXR4hFv/92lfnIbUyuy2MDxtRj64XxB84BkN3qHwrkJS5X6epjw/LhnpWy6CM7emoJ9kl5wIphev7vdC3rO9/NSnCZkC2zgZcZGWNHfLuUKCrnAcpwipYKveH6zhjh+qfNHS+kfN761UFKCEkg== 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=lZA/jV7+IyGVI333q6w5k1r8VX26NW0R/SbQkcUahIg=; b=cMy3PnvLuPMvtGs4Vp8BeGC46mgtsl/vAS1P9YDZXbKljPCmaCF2aTjj5F13KNcGDjKnoDqplZxyhlbLuX+dpikEV9We7iJxK4lG3iuT0R/aa/UWMwAOrnGCtBLz0oza0q9r4ogay1nKBiQZNOpldtVeOOTPfHrjX4bYD8F5l+bxAsFy+r8wIaR+ewf5TCOl9NuMvlK99Fm3ndCRmC1nSIRlpXYS6k/xyk9NhFKzbHqdVSZabmSW0jDtuLdsWARkMQu0aJC0Mbc5XSFcD2na77VR7j+1UqdWJGgGQEqySnKYY28Arpo8aCK6zOe6hB2mDB3tW3uPjoasIJq7Gm247w== 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=lZA/jV7+IyGVI333q6w5k1r8VX26NW0R/SbQkcUahIg=; b=Ihn0yoDbdj3g1nPAM2Au62Lrr0CsSKPumkPB0ydFUgGIYERN3Ww6nOkB87HQchUNVYL8RGxxapjNBbLazvjAB7gkPfOCRq9dWVwOd1XrmLSviGDA4pPij5i4Sgd/LM++YkS8FCIXCwGy7p1Gqwlqee/TOQELvXvwn6YkmsjwAyM= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CH3PR10MB7573.namprd10.prod.outlook.com (2603:10b6:610:178::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38; Mon, 19 Feb 2024 19:49:22 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:21 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 03/10] btrfs: create a helper function, check_fsid(), to verify the tempfsid Date: Tue, 20 Feb 2024 03:48:43 +0800 Message-Id: <265a0f1115d7f421aed9c87d52b07e3c9627f2c0.1708362842.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0065.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:ad::9) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CH3PR10MB7573:EE_ X-MS-Office365-Filtering-Correlation-Id: b792ca73-8617-4303-0c33-08dc3183de15 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x339sAL3vivNtS/kjB2IDIRu0Ru/FWJ7SKCG0G/U/Bf17yfKww6kaiTcsDVpXbfmulznSYd3GY1rZXqMC8tzodWXNQszKYixBa4XgnZYJyFzfshTuFWbIy3lWTQ0K+iqJcR+f+ikG1WPKAy9fWgbizn8NJmNW7EBqQ3mJ1gMoxX4IeLLXnBD8Th6LmVZBockvVvEmFHB//m2b879YWqR+xPt4UPyKu7Fx255sx4dNWXaQvQqsuPmq5QTKlpUJ3EcwhdesF/0ebSN/EONFlcz5Gj6aVPduS+ksi+vEM32ncPVmpKSUTPgI4HD+9WZrQzOVhLYFYst6vjRP73xg8Jf7n5DrCs/wp3/JZiJGpQVmrpoOdyGxYCFDTP7UxQAn9ZyYbqVaf/OQB3+dXE9ANj+OkXAZule5nFijPVtiEYCGslZeBdgVBAawFlt4qP8qs25BBrWIkd+cZfVCd1WgCotch6iUfbcgzdrnR8F2/H6m17HOidka2BMRJJ/RwEzbm0iDMpfSC695DTogWddSYvXOXHVCLOGAA0cnvMgZAIjGao= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: K2eNM2i5SYRqx3Qze+2PTyREipzXJFULzCWX3k7JzciKFDA+79EdneW++1rXwi/EozUTEhX+iy13iS8jrh7gvi3ZwFITFpUW1Y/Y5iF3f91b31knfmRr8macDJJLrxNimD+mDyvIsQHYnEcrSvLk73Iuq25oJAG9EDAussdvjOJRmlDHfAYNl9sWsbxxNxwc/p+4c1IvzGjgkX/iMlPfofgMJoiRtpTDo2YfnebGkjvSlGyxUs9l6c4aO5um9b3yTdZXGkZAy3J3j4kbCy+F5iD8aMSgbB+ayiv1sXqc/GM+w0GUlc2Qoa0AL2D0fe/jI8jYTAEXSO/7agT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Z6Cw6H8KcMYIwZcvs32O7VkHK3mKdCH/URZJzCk1nBp4JU0EL7VM2C9Vnc1vy0AQYFCOgP6Vw5/nwO8sCBFpuix2CCoGu2NVSDQnu2ajXnZYsbVvLJK2gd2h7kpMOCuyT0gPrlUx7Pkpvg8nh0jfqUElmjpbFVdmJJZqgfC+JIrxFyTIZCUweZmYtGHifUpp X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: +KAk4EVoPOoInxdWb3t3F6vpYQPjhFK2hxKZVIiOMuyqcGK13aWSlZlByf5piK7S0BZ0ZrFWZpYGhg/FJqA0IWfj1xTCO+dNJle6wvGLqYjijWytV4M1iNDd7xZOZYhS9jCe/XG6seNEcXjZhazIHIvpcEILmgRySUunXbX8OWg8L+bvaifjKaElB3SlxbR7cjYJK78yi3TQoLNZGK5DiO7hTDSnfJtxWaI0zssqPXI44+EkIfAgDgGX/irl5vyDjoI3QLGNZ9S0p75m//fnYVwQ7P+2tE8wOV2hijbdGW5AptlRu8memqmjJePQ5C5KXdoujd2oYAvE+uFyA160xMG9ApLDUNtna2sfnBDhtakX2QMrathWQXaHtCzeybd2J0DxieAO9OIt/L0LFo2j2NwjAriBz/p+kLaXiff98RvyV0zQB2220glI5eq2GYJvtrAfKbLmkbTn16y3gLk5HVc6Gt2pnAO/qWQd4W9L+gMJjnESmalZadKNCAHMPi1PCzUkIpCeVLn/RelrRP9CvMTswsYkY9k0lQ5HERopzlAVxpaqcjuKPld4PJiOxfJWFU0Tlz825g7xzYpbH204Bk+bRSSidJkOk7GT3YSO+k8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b792ca73-8617-4303-0c33-08dc3183de15 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:21.9142 (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: JQBlGcTEhySmuOxFNorbwoI6ormkhtwYsYTC3iqMJ171+zM8r9owzSePH+QuNC8lqlQBY7NeX4wAvYdCGf6ESw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7573 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: 2sXQB_fVrdhwcgL1MaCR44SpedGuIDU2 X-Proofpoint-ORIG-GUID: 2sXQB_fVrdhwcgL1MaCR44SpedGuIDU2 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 Reviewed-by: Filipe Manana --- v2: Drop the function sb() Use $AWK_PROG instead of awk. egrep -> grep -E common/btrfs | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/common/btrfs b/common/btrfs index e1b29c613767..797f6a794dfc 100644 --- a/common/btrfs +++ b/common/btrfs @@ -792,3 +792,38 @@ _has_btrfs_sysfs_feature_attr() test -e /sys/fs/btrfs/features/$feature_attr } + +# Print the fsid and metadata uuid replaced with constant strings FSID and +# METADATA_UUID. Compare temp_fsid with fsid and metadata_uuid, then echo what +# it matches to or TEMP_FSID. This helps in comparing with the golden output. +check_fsid() +{ + local dev1=$1 + local fsid + local metadata_uuid + + # on disk fsid + fsid=$($BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | \ + grep ^fsid | $AWK_PROG -d" " '{print $2}') + echo -e "On disk fsid:\t\t$fsid" | sed -e "s/$fsid/FSID/g" + + # Print FSID even if it is not the same as metadata_uuid because it has + # to match in the golden output. + metadata_uuid=$(cat /sys/fs/btrfs/$fsid/metadata_uuid) + echo -e "Metadata uuid:\t\tFSID" + + # This returns the temp_fsid if set + tempfsid=$(_btrfs_get_fsid $dev1) + if [[ $tempfsid == $fsid ]]; then + echo -e "Temp fsid:\t\tFSID" + elif [[ $tempfsid == $metadata_uuid ]]; then + # If we are here, it means there is a bug; let it not match with + # the golden output. + echo -e "Temp fsid:\t\t$metadata_uuid" + else + echo -e "Temp fsid:\t\tTEMPFSID" + fi + + echo -e -n "Tempfsid status:\t" + cat /sys/fs/btrfs/$tempfsid/temp_fsid +} From patchwork Mon Feb 19 19:48:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563034 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 DE42E58109; Mon, 19 Feb 2024 19:49:35 +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=1708372177; cv=fail; b=Ve2x3LGJbeD8kz5BhXXLdjq6DdHlmrx1sZXj0An8MMGOHzA9o86vDnKscSq4wzoPp5NqNVVk5k9pB865203mxiSfoBx1W424MhFdJp4IKeIuaJ2br7D8k1Rv7V9yMiyvBNww2YuAxdjoT9fOq8JdyHpBisb4Jq/THL+47b+t0kc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372177; c=relaxed/simple; bh=7DNUkGH5E0XTVURvZawrgNQw6VF0jkID+KmaP/orhLg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=arg9oUCH8j5PfASaJ83GwY7jbp9DEXscrXBMopGuGfHXEr/X5hcQ1OR9xPlGvbP6aX4AuyctqG9gbecw2W0JLLKnukoRR2ZRQ1tJ/KGsa9jSdBPIaZwTIlYm4zh4KuKAVaXFjZwazZhn/q37oyZ1eIS2k68ExOV+R29bsDrYSUk= 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=m4aJ8zhb; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=XMrlDeHq; 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="m4aJ8zhb"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="XMrlDeHq" 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 41JIJ5gF031783; Mon, 19 Feb 2024 19:49:31 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=x3mJBMlVeyoDXD4ZIyIXOOcP+Z/p5CkmR1Ta7N70glE=; b=m4aJ8zhb7KEbA8cXz7QouB3P4GIEQdCBYOSgZcjkFY3fHoQQfFSQ2c1JIQq4/oyS1hAO hXYZGbREfL045QTt5mQcNnA1HviegXOCyo/z0XuU8C80viz9o87h/ogVkoLfgET7VGY7 +NFkgxbU0m7ASW2Ih3oG/gO1sJz09zGwLoIwWhzp923mbrWl4p+JchoBJbNXjgh46R5H Pwg+XdTfaYOlNtk2eKA6wVoKcvN2I9Lh20/XOgapBh7tRM/flBL8eR0B5yaDUgI2o1dB t4zaFpt8M+ld6Mm+IEDxV2GdHo+gVdmyDWNXTRTXiIMRsPnTpXaCa6PTbq8LVp95XlG6 hg== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wak7ed0pw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:30 +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 41JIPxFt006609; Mon, 19 Feb 2024 19:49:30 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 3wak86hytg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NJX0f5nGmIovLszz8PsZRgIdxXAE1eJlrpHrsvNFayHKsehucMZGZ7fIk3BOLvmUTVzvc6vmbfHjgV34Zik1AGgG/bmuZUFUq3Ac0BFBup72dXSVOS2eHA4/GL+nHDx4z3qEiOMqFygzQKrivYKSwAtx9/6mOIp5206EKfQHeR8esosr2F2xJx2B6fZKyCymbWfwjzqiO4BSX5Ie9nKLeJC7GEpvP93L2a3djkrzYZl1wvT/+cPYwMNdFB7o79ZpYTdSxUSHk1j5oNJMdj+si+x7cTB2tzIx5eICvSt0zXrnoJZFJYr2LODrPlaS4STV31sk0M/A1swIeYzP6oqugw== 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=x3mJBMlVeyoDXD4ZIyIXOOcP+Z/p5CkmR1Ta7N70glE=; b=cH2Sy87hMpAdIs2M3jxSKg2o5oWwmgRyoOKriq7m+q83hntmMcXcrnKdXgey96PLVxA3ANmChnzxmMF9X/0NECMh/f7gTqMFsYQ+laVZ4AsOrq66PnXdgpoE1km+O5LGwbiv9/g24oAsLhHIZnrWMDJM+Fd4QeMlK4SD7++aSyHk7ZH2kYhhp2Zv72UG/EQS/aYNbKfuNQBUdfjrcd8d9amnumwfjUCmwUGY2UODPDERegNFGt+BOZjRqbYnbM0xkk5/gRi80PdF2zxRn0dvZbsM95wQW8JuECO6A6ba32R7seqY8OhqXZNqMJs4B7p0AUKzBBDT2cyeRMnjMiHeLg== 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=x3mJBMlVeyoDXD4ZIyIXOOcP+Z/p5CkmR1Ta7N70glE=; b=XMrlDeHqmtIvCbL8cKCxNc3WW3VuZEILpGPluxQQx2ZK/sFaVzIJR6rOJIY3I6bPAOArDGGYy1UZf2cYBTDDfdBK6Ukmoe7f5w3tPJpgje4q6AgxCbh+ktoxSWR9gYj2AIhCj1RO8IFGU14KhsqSCj2HjScHDKu3UTq6e4nD/V0= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CH3PR10MB7573.namprd10.prod.outlook.com (2603:10b6:610:178::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.38; Mon, 19 Feb 2024 19:49:28 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:28 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 04/10] btrfs: verify that subvolume mounts are unaffected by tempfsid Date: Tue, 20 Feb 2024 03:48:44 +0800 Message-Id: <5c5a57b1f937b7a6470976643fad1c147c682e80.1708362842.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0032.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:b8::19) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CH3PR10MB7573:EE_ X-MS-Office365-Filtering-Correlation-Id: 2cf6fbca-3980-41c3-7081-08dc3183e1ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bjntQegZUCFl+5T4Y/PYyvQwoTOSVkSSs9QoIRdDEI5D/8WIPOaeiFzGKP/3rbqgp20jaDgBKoxFh+54BfHVbOCpY8QctapEnJrlERn7l2pubuVPezuNHnANpeEL0T1RM+pIOQisLyB/DnJu/MFn8WJnuvep9YL/92xaRNP92TabUz3ohRJABJZ3KKwy5XkwCtn2fp4PwvlQMIVn/NXDh00F43Zd4CeV2kcSIyCGEvjTFOXnAJbxGzrOsRfVBI+SlpJI0lch/REYmBXp3rM4tBe0JySy+K1rRXkhRotg27Dz+nTZJDbHnj3O6YRnyCr15qW00fQ25GpjNjr0KInw20ea+6vRtG4u2icmnilFwtLy5ucrwn+CySqU7BithhTR+z5NtAUP7mxS+e7f/gTlEpBhDWzrh5bB0UVmfWSG5C0WX2/mmsdobiA4GzTRuoOnU3XN0HLLEhALeixT/Eb48I90ZOp8m+D5ZbfyeyfEupRb9ukBZRCsM4pSG8eB6O8lv8I2dLKnNET9bZHUT1UeRXK4dNWNv1afLGKGdmF0ZAs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ceytfywe9eNDurbQ8UxwmItnF0Bf1VhmSMlK36VU3GLPrOTO98+eyF0SoEt6EaUw2ZhvbP+BP2P81lI8+EgExlkUZdFIrtQosdYyFcLwOWiIHNWkfgr/kk1KNGV7pyCK4yh10V/A1wXy533lONqheLim23ASfQG9jaEi0fh7R9v165s0grjbrtk4RxcuyvUVEp6apv4LRqKSBQ8mH8wXzyYaj9eJUjBcTSTWm5tGwg7BoKpZicn52TQIqRVFpeitSkJ0lIsvwdgPGh75Mx7oMe0+onyHaNgMP/SvGRsV3MIrIoHrP84H3GPyW+cDejcHEVIF+SL6AQRTUV29nVNlPC62sUysF+amvYXpFfM/EZvQ+7j+v4kB+CaxsLC6BG9M/WiEDS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kWjek5Oy77fRxZdS+PqBFFwOqrD62sjZe5i5NOpA//fAWseXG3EaLJ3yK+71+dTIFC61Zo2GYSZu8Zj45B5X0poq0hxMOo584YAnNKwfG6WzPV/HVhru9iUa9LPI7O8ew X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: GRowYf2aTrPLEIEVWk2bVVqR4nBobsGjKRHFfLkanjGZgWrIr/DgeuXsRKn3YsOcrUwOA4T3R7h+hnPvoRJC0TItE3bxCvbgnPg944zXISbSgdcUGffAuOgt83gEomngi/TQBicCPR9qnv22LvHoaY+9QQ/C24SJnPoX8sJsoYeBKm3a7Ss+CcZFNJkeFzIxRxAz51bO8Ox0IgM+0Hg2Vyze2euKYuIAiosMaaKv01l49TmaoYaDVxlrBqpL7f9uq8ceDCmD0trFcSEdHispNv2o9tgtbXTkO6S97bkKdT61MJpzH7GSX4v/b9pnmHlEGmn40mJB1vlgsY9603HWliXrWXx8mtTJXCeFJ3mphcnYxXJUrDO7iU1+Xdi6BnLDdsKQe5GGVzYTb4VNbrAznRaEKv2b/9ZHL2DrFqXyFL8LYqujvFS+mbpOmdtzaZmaTdFoX7R3RmqmqWkNgrXyjOMGOO5JlSQiJOWrUvN5Zxso/QRWGGGgyHMC5ptr9s7fKJO4PQwCVfYIwDM6djndTntLE4bV68+JIFJfnpOadiG1bp+HnnPPYr7FxqatfjSAyOQ5+c+f7GZ5GEB6XrgEcT3wSxQIOBkhfcgUOne36Bk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cf6fbca-3980-41c3-7081-08dc3183e1ad X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:28.0193 (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: vv4jxKX++ZRitiy8dZlXH8IRTWt00kVUT6wcoOwkOAVNrN6TRIXNRupVEPoYk13BNvEICVX/DP6WQ+eROQ/s5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7573 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: U0-9PTm9IA0IJz4BK1FiIGKbrfkWUIch X-Proofpoint-ORIG-GUID: U0-9PTm9IA0IJz4BK1FiIGKbrfkWUIch 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 Reviewed-by: Filipe Manana --- v2: add subvol group use $UMOUNT_PROG remove _fail for _cp_reflink tests/btrfs/311 | 89 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/311.out | 24 ++++++++++++ 2 files changed, 113 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..cebbc3a59e6a --- /dev/null +++ b/tests/btrfs/311 @@ -0,0 +1,89 @@ +#! /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 subvol tempfsid + +# Override the default cleanup function. +_cleanup() +{ + cd / + $UMOUNT_PROG $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 + 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 + 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 Mon Feb 19 19:48:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563035 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 A652358212; Mon, 19 Feb 2024 19:49:41 +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=1708372183; cv=fail; b=mqXKynTWsED0+km9bYpmkzbrjk0b9hJrs2K3zSm6nMtZEvshO4+M6uQpE8b9Ht5izj7y+SoN6+0dLTx9tDfCWrjC7iX7Hu/XhKDoUbHE1kQOG50jefzb6qQy1u4k/zoB/+oAmqRch2bXI0rx9eEDNIbb/8qsQcwNeO18DPjJIuQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372183; c=relaxed/simple; bh=cwteLNONSzit2Nb4utLL7qUOrgHHQb3iP6SY9scHo6M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=adJ77lUMC98aJoP2azhB5uLeM27KJTzwHTGhe3+HTv1ZFanZ9st0z5UBso4Chm0uSCuPknZB7uX8Y+Et6SkCC6uCAnzaUMNuJA25sJGRsyB0z+pw4CMD+SZ1aGsFt7XVe0MPO0Xfk1FWAIPV22g+SCYieopwYw0etLHCUaS2k5A= 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=UrLxy0Dd; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=qkZbcAfy; 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="UrLxy0Dd"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="qkZbcAfy" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41JIKUTb007295; Mon, 19 Feb 2024 19:49: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=hQiIibmcBBgyFfzeHT2MQIhVAWktmMQQKaLRyp0GsDs=; b=UrLxy0DdF90dRjvfiVd+1Tdhf6G4a6drLnxrFIQJC1lYu5+KIz/J1m0ck3I/BdzCpLjD DlgpM6BkIwEQM9feIXOj94B8X9XiiFQNb79l77+um8MFaeUCav4YiQUNWq7hw/zm4VK+ fKMDmyWTnaFdLqy0M1nMiDHwdy2NS2mG+dgipDe79HNJe29w/p4hFjSKHBWAhuYPG1xq EtadRuu+T4odz5DOGol0Uh/YdU7ZAktaJBMBku87Z+swY+Kb4Bjalg68Nrgbrxs/3HYx SgBXh1QNqn2N1EYwfhm7I19Iy9G58VW1DnwQgpSWKgqV5teY9A9LyJ32arZvkzfLeQzF Mg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wakqc522h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:37 +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 41JIKZTg037778; Mon, 19 Feb 2024 19:49:36 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wak86a10m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OUOn+vlHF7D1a+qCetP3n9kTJEDPT4gRJT4EwZeLkbZVKUmFbF7ryAahzK0kT48AqXcAFc6OJxId4loGBXxGt+PFS11BqbbcarDNitZYet3woaTOQY8S5B02elrc7oQ16SZGzDsR5uqF1u8M2sQ55vyObIx3YfoaKwjT5tbrddVrAIw828FQRYeJ8c9NKHH7y7RImcfvdmvNPwH6LNmdyQpreeAN8Nz3862KQDFd1fr7YoiBQiT4NUvKy51OBvK0MVPHUbkMBHDVaAqZpn4EvKmmRFU01ghMG7wDQwK5IIqFKPT0lNMjW/WviZ42+KIS81eKdPXZxojNANTKj95o2A== 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=hQiIibmcBBgyFfzeHT2MQIhVAWktmMQQKaLRyp0GsDs=; b=h0tRmEjFw7iI3n4MKorp/OPxSzt6Epn7C1FO7duyAMpT5Dmk7u/0ULdnrtcDOLDPo+Q8pAgwO+k4v0ePe/XXibvU1PCjFQzh+Xz9OqkrAKq7K5cFUtysM4cghGFHQIVzUl4rYL5jQGzHh01YLTIFI2gOj0lurqtR376ad0yTBHLRVYj2v3A0qFrULoMCB6qEOEb7xdwii/MCprlQPZHxT6GHO4SSlxM0+G8lTrxL+4TQic3HWCp+i5VwQNJ4i+Zm10ErZ5r6sieN0Px6EvFW+M6TkrK2sw62/FGNdxk908Me7l/xJIvCj16J7PFFjE1VL9lpgp7YVxED3+V6eDo86Q== 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=hQiIibmcBBgyFfzeHT2MQIhVAWktmMQQKaLRyp0GsDs=; b=qkZbcAfyd2El30UoT/g+Nlr3gB9XoBmhQJ/OOzxm0L0B/WA5NJc02a07q7yrELr12tXxfWR1MuPSHdstXC+qDWUeOmDJMB21Hhl8hNrYKeu3Hag9CKlpGOzwmHt6xzdzjlXUB5Xr2ytDtY9y4lOSOcaqA5TXDLPeHFzpFg1XiEQ= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY8PR10MB6852.namprd10.prod.outlook.com (2603:10b6:930:84::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32; Mon, 19 Feb 2024 19:49:34 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:34 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 05/10] btrfs: check if cloned device mounts with tempfsid Date: Tue, 20 Feb 2024 03:48:45 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MAXPR01CA0115.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:5d::33) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CY8PR10MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: de5764bb-7626-4490-061b-08dc3183e58c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hi9cQXzjh6F2WDkZaLQyp2eMX9F+wH6yKEJ5/wtgPIzsVLMP/YizgL3PpZxDkRXtIRdrvNsPqpxGd/nnMH5Aqfxrfip5vNlnH+xVKByFZIzX7E+HIjytyRfblV5BhGmL5/WVu4Ymu5TtcTDI888KPcRnsro1Uh7/yZ/GKV9g8P2a0/xqe/aLSAZDcoMR5w3t5AlqYHo8tndQF6UlBWXwnjnR1zc12V4qnwcAXyQQQgMxpSDdF6fzJXGpSc1A5GTP3wEYwKkBeuee0mgTMellQa9gU2qkACDRUlTSXsFa4ml6PSjWWvMTgvThhqCOto6V+cQ536nN8VUfmxCtqdX0LIRrQCryMdjRfF/cOxC7ZnBBOcc886pJVN0TiBJunmeKnYKcPCxo2G6FzgWX/0/49t0K42/wNivaXzojFVSU/2Tk6MVTK7wJlwD08gZUrG01D478pEMtpfMYPNxzy4FaXFdRNgCJXOklv8SdfXyvTuNNOv+/7bfSsctWlfX8OGzxXQ7cyiAYJtg5FGvep3Rfr3eS1CopYACi3MCj2JlY8h8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F3k9a7B2oA+6XLDbMcncRInRDKEGS/PcvziE5qc+27Vb3id5zJKZwJ1gofNzM52gWeiB+7A/x8S5USKHVO+yIL8TXeDAQVP87RGIvkBG4X7Qf8uk0V+FJptG4U/iVWeu5xrHrmItUvQrNWZTcQHATnjFAzbyV9RbSSRHHix20FNdFMDMeiTuGsqNmKLeNUWXtDLmZdJ8P8MqKA/pr7jnwGQUCh7M9Sr62icunJ59idR1+RZVzrziWCA6hKY9Ra7jzFS98V1fTxuz3qHVDIVkWm4y9IvSEwa/x7gJP8UZTSPRAOP96xJnn5fVuAX7xCWQqcFMPJXt34GqoSgKI+04t6g+DEJ++3LkPLJKxh99SwzqOMJws54sKM94AbR/0ymnRfyiLsYjmTqq157GzWmsjdkH7xc/UqXWlq+S2ZA4rMCDvxG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pn6elk35DOkFvtGMNVktz1jV7D3iFtlyD26+ycYL98M12bZ2MqfBvRD3OLNnXhb/5kxic4qaoym4sy7Ar X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: qF/SWF31VqNvKondNeNL+O6v9UFGx0HyOhphqgUi8RMDinwqEVSOccvy16bnXjgw4S1DQSRlWtOtUxYgf4+yFKRTWu1WJ281kh/VhNLDsVtwGFGktPKpThb9vabQbhG5ln8bZpPSQM2NxbGQLZoj8W/wV00EKjPFluTTwadXIN9/6EHr5k2Hmf6xalPKp3E6dc/dGzRM8h9ty3YTPRfdjmrsFIe3k4gRyb4WuiNq7WBEx+drttKC6dpv3KfBLUInRcpJcaYcCJX9SfrGJU3OiufWuAJY0wLq3xzlIvd2swcQilpxKr85OmDDvqq888DvbnEMuKakq4nGE8HppFK5C8zpuHbDmHaa0ehocTsgdujCHKQOdIkqSdPYSuiF/SzlA5Frq1BGRSjI25+KfTQDlNUD6XAUOJjssljtciW9N2q5e7bXRcJUCj73bX7MaJ7GHwmrMcz/GiH62/KmtXg+5z6SRpMncVwPu3XGuapEpYMtmHD4GOPE3mzWhkYY3/tb+YKcU0wme3B/fKNqZQpZ3B9VGAnN/eFYR4Bmwqs4Zq+WzcYaIBILa34qSg34wC034KXi1f1MEoX909f8naAJYR1xQISAcXKCkfYOo9pb8YE= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: de5764bb-7626-4490-061b-08dc3183e58c X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:34.2682 (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: H3UkrmWvsyvutsuUyQfmsnuUr6wQYnfBdgaIjsQJOGiOBb/7lkDo/bxvrwbJsbvkGRJWxOKMe7cGIObS7nE28Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6852 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: ZqkipskC5xu1RSD8jaWDlmyvAcq_U2OM X-Proofpoint-ORIG-GUID: ZqkipskC5xu1RSD8jaWDlmyvAcq_U2OM 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 --- v2: Bring create_cloned_devices() into the testcase. Just use _cp_reflink output to match with golden output. tests/btrfs/312 | 85 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/312.out | 19 ++++++++++ 2 files changed, 104 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..6dd5811ddaa5 --- /dev/null +++ b/tests/btrfs/312 @@ -0,0 +1,85 @@ +#! /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 + +create_cloned_devices() +{ + local dev1=$1 + local dev2=$2 + + [[ -z $dev1 || -z $dev2 ]] && \ + _fail "create_cloned_devices() requires two devices as arguments" + + 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_PROG $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 +} + +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 2>&1 | \ + _filter_testdir_and_scratch + + 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 Mon Feb 19 19:48:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563036 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 F214751C4A; Mon, 19 Feb 2024 19:49:46 +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=1708372188; cv=fail; b=A9MBxjZi/LLgCd32WbI6V550oyr1XHeeUmlmBBBBLtrqhnwiZtW4HUifkYlkUFV0wQUuch8fF7WfbqvnfwViLNj98PlZzy5ieZ3hQud37tBrleuhDU4RLlRKWYVnFK2pjbuLxy0VMJb8INF2shE/kQxBudVPXIS7Ekxq6hTuI8o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372188; c=relaxed/simple; bh=NSo0WDtDKicxYT0gwgZCO5A2HJQOaSvKwQlF8X+UxiY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=miZXoBdqSvsDvo6mCuUirARd2iiSFp0V0hgNhjW0h2rpHRAPlqWlQXRRFt1uFFqgpUOxgtfE7uIzZHKo2yf43cgL+vPtDYgauBeDcR8OGVHO26iWq0Insekrh3Heizhp5gfRirkpMUns8nWQ91zwLwij09DDSEQzOzodIJl+KwE= 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=IhKWNLYw; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=SSVTx67G; 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="IhKWNLYw"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="SSVTx67G" 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 41JIJe7i006594; Mon, 19 Feb 2024 19:49:42 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=KAVAoq7pzsHjuViYDYOAOc2DHNwnu5xp6D5tzewYYvQ=; b=IhKWNLYw9dy1jcQ6im3AkvY6SiqZxbix++2ilYFqA499/QlEHT79Q3oA/J7M2gNtpaj6 pZfcWKp1f3UTOS1eWBKfKmxnv3Mv78xZgWfZFsn273yGikwr6q9Y8RhyAD9JZwTsjKAA S7JYGwXrXS9hMkn8jt3m8by41iR0GCBEDN18jsWHdDRtipMVTcCuf3Y+8s/Te4ZkTwX5 vtwhrRMZoPy+8wqeGHNz3a+FExOtX6VMbNyjbXDCL79/Jj33jDQ4IehuDonFdfF2hhQ3 0vj7UWaPWBJTJL4TRvNNwO9k2iqI73LQAOvZ/zRBK3OLwuUgGfqEIoF1uulhV1aMPDSq 1g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wanbvcwcv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:42 +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 41JIIsAF037793; Mon, 19 Feb 2024 19:49:41 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2041.outbound.protection.outlook.com [104.47.51.41]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wak86a13c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kAcnEdur+3hrftImTq06uEgEEK147UPg9SIoccxLXgLqvLLmoD/TxiIscUbw2P+ZwlTT/nItfuFXsxo4snpX0HZwYk7ekhsD0sI/wZfluCqkW5um16mJMhiLMK40mQtrKGZOL5+x5aFimB8gJkue1lmyak0522WkGx8Ibw+67sjN2+LtLvnoYGZZDrTFVbLnMPL3siovqG0NnyCSUNeoIj2ZNRihWVYz0IE/mrrhh1MmfGfmcMr+EZcodzr1st7tzv5AJNCALZbfjJcTd4z6EQtHKQrWYypfUfNTJsKHJlxcaihHfgUkhJO7wlH0khGl5EMprHN/7oeoWvoUYdpQAw== 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=KAVAoq7pzsHjuViYDYOAOc2DHNwnu5xp6D5tzewYYvQ=; b=als2TMgwps9msbkVKBd4JWGI1eSp6ahXzMCbvWcm0yv8lPrq2wroeZMLcahSRrmjv6gnSbs9KUWSsKxrXQAYDaFrY1QM28UjZtjIK5jsi4GJT5ViypQ6RJzlJsggmXX+TPNgCt/XVlMmbY5nK7aBtCmpo5jwUaho92hHH2/k9rTBRPuuX00IMn14m6WrWkyJ484LADL4qUEeggBQFFqkeZynBdCPM4MPQNFwOeXd+O4VcVJ3UAL7yNEp+kXPfWOXKqzFgogpAEhXP0GEjpQ/dIrwVOgrqH1X2Ow1MUKDVl3ns856BX5xbAR8voenVQHffc5dJfq1NolxZ2zDE8Rxrg== 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=KAVAoq7pzsHjuViYDYOAOc2DHNwnu5xp6D5tzewYYvQ=; b=SSVTx67Gl+2a1Gp78nB5JGOK01j1nFuI+1GMZQzMKAI7eEeWtm0Qaxi+/e3citL+DZYiHg752JWg3W7bnhjeyEP/9Mu0/KykRsn9yrfjTgF4s0OgJY3RmRr4FUL+SZqus94v+XtHL7b/+AhfQwxfQpP245Zi+a1Bq8ndZktCO5Y= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY8PR10MB6852.namprd10.prod.outlook.com (2603:10b6:930:84::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32; Mon, 19 Feb 2024 19:49:39 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:39 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 06/10] btrfs: test case prerequisite _require_btrfs_mkfs_uuid_option Date: Tue, 20 Feb 2024 03:48:46 +0800 Message-Id: <664d640d44d787f0b7c5cfba1b57abd2260b747c.1708362842.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0103.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:af::17) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CY8PR10MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: 9722cd86-da9c-4a91-c780-08dc3183e8c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: paurMj9CdCGCzt8icQK/m0XJjvj40+SiKmYATPFnGs+EUVUsI44CrkCh1aCUFggh/0HFLSkq4WZP6SABCOnHLZB6i3ARcgMGVRe1Qn9xnU0oQk8aEYz9cr/fE76NH7/XzY8ta0dSnGTA4ZA7OWBHGT7DA5PErhmTNQ1ewRAx0rr2mbRusDB2AQAbM2H8hhs2m24EsFLlY9HyMOLhHEMDFoKeeutfSQpogNIvZ9Rv/zbe3NJNSwF+XODL4CWa776lKXvQNKLm8eZGEZzL6gWKXZYU2iDpxsIdeDwzW9QfvKwhlirz0H73ZMeftpzPIMvKUW5g5IsurXbVua4Y9L8hGepnN7q3cxFsrjo34PKwPIgai2OEUgKMRpLDq62Di3KvULuUnAy6Ale6hJPZ+/pcQ2cwl10GSrVWq4vTeMR8Hen+vvughCM1ZdFW/yboFGEPh3PJrMPs8X/7umxvXAATqnrCtsexedLohq1zhX6k0NF1Pow9IUtsJIWDqlLTjtyNKBDrqebcdtXkwB5D0j2IxYu6D6ZdrfkTa6xPgdW8oPw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sb+RAgqIV+LAbe9+SgV5oduWE21o50M6GGZ5+gxQSEv/QA1RcrguWArDk+M6ACCyPbIBiX5fotS4GFpgvfW54Xa3Z8Ggs8If73W+1DPD6/3bAJ+KSDMTtUtUjs8yT2WJp2pihf8WrakcpKpuWkMrP8mm46nKkQrKJ2BnOvWsOfc0MBXoondcx6P5xbZYyw97Orw8twsh1S1/+7gMsLlrYdYiQxCOG4KcPfuKlwLicipnADm7mm/Rp/KC/hy0rOTutNa0Y5JFS98pX7fxqmxEvR29y0AjB2NaU+AohE1yPgav/Tjc3agARf+tN+gZKnz1I/TSLNeVOqh+rLdnO9KKjZMHHWKLK77HbWNp3uxC3JwGEIv5LIYlkBY0iBgas0haOaRSpUd3ScEM3P9+pK4NYTT+He5dyH0U7eCA05+pP14mrYbU1EqmRpg3o/Qe/gj4PD/qnmX3Iv8P0p8RWczqGy1dqBiXptrlQ4A/ptChkzV6az3HmAnPg36HorzZnYwagb0bDpotExxZ4rk11WdMyO0z3TsHoXF/L3pm0JzR0CpdjuFEMpdwn+NoUJbsT97k2bgdNQPeLdhym+1UTrC/W6zt0aBjh6SI11ZP1m8uIZZrE58a6LC78LexWH1AVUZOB0Qo/g2EG4flHTI4ttuVHAblNpikB7zrz0hh0zXgn3LoXbRItUHf/ezT85z6GXE3VBPV/dG4K8aTgj4dYXOcD0utkaXgZkJG1PWKivWph0uJyNBPSiUsuuX29kTVIssVYB6bDiBnp8+guQaorxD94MWrFLP0y/uvD30DdTsOVXHPGqWL9bxeypgBRx+pXsqnzHE7oPE5H56KERzHvyjfDYgNJfSEy6CVAAQsdUFTVfq51BU5DXFQjtzAE1sUTeSy9YdKCIhmaQc6DwNAX8RE0u1QwbXeTqRmeNzPAu2JJUWdlKcoW83jt5EljjZcl8mV8okAAMgWmUW1dFI2X+tjWwmJTcIaElV+ftI0nOWkbdng09gMj9B1N+51zX0R37+PxXoINFOKavEH0EP6GTm1b3Mf9fC6pE769MLuyC0NNgQIGg2gfijgnoZyiF5q+KdgU1OdcIyiYuINANm5AFXDUu7EHYccAHsxw7ItxyaR4SqZWLyRIkdjRAp6gvUjmHO78siP48jgnrqiMDvoho3n3adYbExVoZxXPDVJSHySPXMQ2L/TnIBip8b8MJVaoJSm45k/H3Kki+8Ubmq4tYun3cC7yqhMohuV3w3KaihD/Quvlc7b3fESizZiTZaKbiFM7jK5jo8DRtA747R50hCaLvNn0JwLxdwZCQbNCXY6WXiNQ9Dant3p/dS1BOpdk0nol3OdTerwpy2b1Ub9EkGRP3EQmfnqW8XF3KVstX1nfjdAwmnaFiNziU9guYenR/t40gqkaPQxrjDZYb/cMVNeBsjMskC6U10DAluMMjFTaMc8S87W+Yo4py1ERp/ddJRIScqvXV4AYOkOogYeWUWWrhYsP4OrYmi81QFNR5ZET4X44TuLTQyHluPhEFEuBzu4Z/Ytn+Cf+ylZazIkLllEnlviyGwROChRJJe9V8EaVOq8GppIpbpq40/l9XpExqHw X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: yRthX/+sR3ZMSWqlPbz2VuKUkqzCwCoj2iYedUpoOrsQKfFHrjnjCma8UfXbAezzwVplObcozy8/34kNqQT/ebjUjv/mKw7SN61zUu7hk5FkKZuGazJOpqKe+ve4BJG16UuWuCNUGgFJpp60b85qFPNBIpselsHxBF1iRrm8K4RQPdGGTIpcTUQsfe5FdZlyrmPfHrZ/mtzMybU3M6Z+jEN7mhnj9wYCSYHwspIpV/8+PEp2ys48guzTdTu+9/HCieikv8ZXtqWmCW3cvlTqsClFLRGXt7WLg01tSm+ytUzixpLVTMxAcgjqzvAaHCW42dUd758E2vUP68vIjWZG8r3Zjfs2MsnWz+73cJ7CHDV5zj2GCvMPGIsJaRzP+GQYZe8NEH0cB5X+goWYwe5x601dKTp4xCYNB16Z+w5J6eWhjdIHDEhnEo9f0iYH/U6y08aj1rUJ1OaKp6BSRiVYkIM/HED3oEMqrCJrsAwN2JR21OAZaqYti7mnHJGTLW7ci6aE55BzrWpk0qvz5zGRUF0Ne2xeH5K6US5bnEiZClWhxyYIaAnYWI2aRemBeSkvn1U/Usfgf6tedCURUW/TMo3OsePGuwB4frqBErvijW4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9722cd86-da9c-4a91-c780-08dc3183e8c9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:39.6709 (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: dr+lrevMUuN/iDspLPUVRO346xrQ1r1jajATxrDQQM9NnT/qnpLAnsPDT3Qa/g3oLVmT4pQCzm/BnfO518ytvw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6852 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: tOWI2QL_HkgnT-sNF6jBEXc-Od_TwuSn X-Proofpoint-ORIG-GUID: tOWI2QL_HkgnT-sNF6jBEXc-Od_TwuSn 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 Reviewed-by: Filipe Manana --- v2: Fix coding style, add space before grep Fix typp option -> options common/btrfs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/btrfs b/common/btrfs index 797f6a794dfc..f694afac3d13 100644 --- a/common/btrfs +++ b/common/btrfs @@ -88,6 +88,17 @@ _require_btrfs_mkfs_feature() _notrun "Feature $feat not supported in the available version of mkfs.btrfs" } +_require_btrfs_mkfs_uuid_option() +{ + local cnt + + 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 options" + fi +} + _require_btrfs_fs_feature() { if [ -z $1 ]; then From patchwork Mon Feb 19 19:48:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563045 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 7317F58AA5; Mon, 19 Feb 2024 19:49:53 +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=1708372195; cv=fail; b=T0VFjfxKmx6VmlglSeRkQH4aN89phwrKPGgRuohOb1r6kSCPVeYedYgADRqIGuFKIlqHTNg5uTwj5qUTyahJwhTDCCCgr4dbehkOSRdbVotPC7HARRwVCLIA0QtvLZSV1WPjdSIicW2GRWsyUkcSO4kbAop/4gx/MSF3L0g3wqk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372195; c=relaxed/simple; bh=bfWal707rllY98vKFCZhkX9Pp2zLJZjCfUALUUNbK2E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LlxVkVRdBes7PKLMeGd8cNPlfydJ4m+d9bsGeQHF3I+0iRpY+V995l+q7Ea2gfO20Q2RbtlcBRU9Ert6sVw8bRkbjC+J1BUW0+To76ellHRR8RWubdlvVZhC7+H+4tsk278opveRoRhpP343ICs96gjTIw5RiEjSytREXaW3h9I= 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=GYc5VxpY; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Twh+s8PB; 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="GYc5VxpY"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Twh+s8PB" 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 41JIIxMS023188; Mon, 19 Feb 2024 19:49:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=cCAMEzYe5KsdEsqNQG9R91uuIgHHzf8pzma/J2qOnrI=; b=GYc5VxpY7/e8kcNSO0iL0JKzeXhfU2uE3mUE3zXrzvaEAjBdTmM3ZmHwzJI2/VxQPSAv Qfzu3G+5uFPEzFmPjDJR8dG/OE1uEfCIxcjbyTiW8/u4VTj6d6XXhSZk9D3mekfWU2pr rn8U8xSg+d5sab2iC9dBbqCae2IotaF2ZGR2Wbx/Z0KI+eB4iLhewmJelAKMusvnTXSG FKsNDcjMCwtomDxFrb0dwElmuczSFYqG+EP16p016IMNEVK/INwNU+9evA5I/Fy36YYG dYOcmz7svkgeayfVuFEbOqq4SRtqPR+hCLrt76+kf4ZKKTkC1DAkwyWDyetxVjf7OIZI BQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wakk3w372-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:48 +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 41JIIS1C012968; Mon, 19 Feb 2024 19:49:47 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2041.outbound.protection.outlook.com [104.47.51.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wak86aaru-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KdHRKK8HFxfvPzqBpRn1kKtlpxilp/mFWkwGSObCf5SV9uia+RLAeNqXiSJOykQuCwr54vtbJBOSJrjpUhBZpNAtc85JVPXhHnnSI9dS71tRkFHUbCQzlzlvt86et7zjxd1ePmyv04JyvLswJZT73/BnpeedamQXCFUCJTqCbCA5FKzJSf5R937pw7WmNyv0xS5bCmhOVpkEECQsIq4cq1etO6yx2xzBLe0KNAufs0gt4AJUW1VJQgsCLhfhIWneUb4yjLmfeTxhznliatbEr4Vsz8J+D1NxyVcDThuH4az0lQQKAVSGVgZHkPQpMI694zOv1nQTTRwHv9PEp/XL7w== 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=cCAMEzYe5KsdEsqNQG9R91uuIgHHzf8pzma/J2qOnrI=; b=mUT3sbblZOuxTY+nySmY0u3g/MaeN1KQB+5DWsTDbpxVSvcjCi7RTrIBaoCS9hXHUPB6H7+43IZqVnBCP3xVRflRDskn4rXRHw64uXghtt/9uMuH7Hx1bkG40oiOEFqLILGWl3XRYnkI7r4SKJoN6cuhZhIrQPjCB9/SyOVRVadY1vTpTIjjmvqj9EkgyzkiYnDaPd/qOB6rnrMY5UDG+sR9uu96dmLP9tMGbdP6qAWh1xRwpEjHDlYgWGzhevg4B/9CrTMW4lcZKqgkTe9zT7ieYugfKMejFUQcTZPsurSUo2/woKonhgokleGn6bRZlrSWJh3SsQMKNsVovFT6Gg== 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=cCAMEzYe5KsdEsqNQG9R91uuIgHHzf8pzma/J2qOnrI=; b=Twh+s8PBBwwcLtf449/NYStmbWTiVHrt+v+42zwvjFL5/K8rrll/QXPUCktlHPQfOqPyjeAR80Vwq5bjaft0/RS6Yv7Nw4MpFdxHnmTC/bKge7At4N8siE6rnGkmDaKysdFirNZS/cAOU5/0KZOpK0nzZ3Z2+2lKh40KG/MaraI= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY8PR10MB6852.namprd10.prod.outlook.com (2603:10b6:930:84::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32; Mon, 19 Feb 2024 19:49:45 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:45 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 07/10] btrfs: introduce helper for creating cloned devices with mkfs Date: Tue, 20 Feb 2024 03:48:47 +0800 Message-Id: <3b00cd9a28c6728ca2bf9c216fe67bf9c01cfc83.1708362842.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MAXP287CA0010.INDP287.PROD.OUTLOOK.COM (2603:1096:a00:49::21) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CY8PR10MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: 3dd38421-c016-4357-275d-08dc3183ec30 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4GFo7pkA9zdi3cPVaPiz6fJx+ZimNO5kxWQpH3j9EDs94b7Yq+dFCtksLOSL9Xo138nQp++uIwgfEgGfdl6zNTiRLPO3FBLD0pL1u9N/jMrFJZs/vQWaC0vhlAwvqY8OzD2pS0mGWpn212+4YpS4De0+skoJMuw66xhE1FO/7Rml1cNOM2UZEUbDfh3+7fptbtK8gq3BvgeRra9pmfQ12G1VidQ6J52ZVQP+3VsV7/aDx1PN1Ff11bGcpa1JgyfD5f/5nLQvw24iBxESgXknxoH25yYMdh3e8q0hTj3tRKjA9eQk0NZel8R17qA79UidN3OYmpopkmTF1j5s5v2Y9ka2AIv9ATo3E9glITuhL9rl6EpYJ3FbTfsKgA1hG60fdbGoB+Uxlk6RQ4OX6trSAoDj6NSqN0ovqhOE0nck6KAB0xK883wttvRqVSTDKN8Tobgkua9Bo5dXAxtQRLH8JNC6LFdxztIsBl2PNGpWq/rP3SEsvacghl5Xf12pbJQkLB2ofegdQtnHTZmcr5aorwQ1u9wfzzOZqpTzuWfGCFA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NCIdOeaEPNMSuCKrkzBQ3Gd2z9BZrw/fUiSFA4b4HLXji6AVSVa/w+V+QJRkxe9irhCTUej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jxD1/XD0ays9ovVU5Vg1i+1SCoflLifGagbVWj/yyqNInTGs1NMbU08tWw9dcO9TkKf9nZdZRMNUedxCXxFNZybo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3dd38421-c016-4357-275d-08dc3183ec30 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:45.4351 (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: Su6+9J8fjNH+FgdASPJiPIIyHFUuuJ+B+8qQlFb7CIQUt/kUv5pUcKmR89z7uSPNgKo2MtMGUOIBm0jHyvN53w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6852 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-ORIG-GUID: LSg1ohvFj1cF70aW5GLqsx8LYc14LBLY X-Proofpoint-GUID: LSg1ohvFj1cF70aW5GLqsx8LYc14LBLY Use newer mkfs.btrfs option to generate two cloned devices, used in test cases. Signed-off-by: Anand Jain --- v2: Organize changes to its right patch. Fix _fail erorr message. Declare local variables for fsid and uuid. common/btrfs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/common/btrfs b/common/btrfs index f694afac3d13..c3e5827562d6 100644 --- a/common/btrfs +++ b/common/btrfs @@ -838,3 +838,24 @@ check_fsid() echo -e -n "Tempfsid status:\t" cat /sys/fs/btrfs/$tempfsid/temp_fsid } + +mkfs_clone() +{ + local fsid + local uuid + local dev1=$1 + local dev2=$2 + + [[ -z $dev1 || -z $dev2 ]] && \ + _fail "mkfs_clone requires two devices as arguments" + + _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 +} +>>>>>>> e22bb3c816c1 (btrfs: introduce helper for creating cloned devices with mkfs) From patchwork Mon Feb 19 19:48:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563046 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 4372F59B7F; Mon, 19 Feb 2024 19:50:04 +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=1708372206; cv=fail; b=TJrinfQgk1php4Dzgpaoei3dfhnuKHW5MwUHy5zcCne56fwQ5sZWv99Av4lia8QIdGh/JVQJqcICd7WMEcQrbuQdYdAisJkbuBUHxrKhrx6K8cZhYeHU9tY7/ejT4K/jWT25puLvi4HTD2rjnMMi3BT8bfzLENVuFsh8soLCvE4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372206; c=relaxed/simple; bh=5deobIGpSrYWZZiR2cDdYTAFGCwvr1AgfPDG7bAZclA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=X99BH0b86U/EFlQAoHHL3wJORo4iC2oeRi8gz3ssoNQvgo78/S5BQQZCqFuVvTNGpK20wJ8tu52JinzzUDEQVkzheGMCP1Y4yPM0OOMKhd+tAOwjqarm3IjY0BiemLUfcYCOEORN7UAeP32pFCO/WBanyyd5prn1MR0ZKG934CE= 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=Wj/8J/28; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=CgnN5G2M; 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="Wj/8J/28"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="CgnN5G2M" 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 41JIJe4H008570; Mon, 19 Feb 2024 19:50: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=fvTwOUPP0XgFqVIjoT2LAcfhJ5sUDbckTiP7ncAvjhY=; b=Wj/8J/28gAhLvo4vX0ohb6vcSTnD02gmjFGbaRAaO/gwaygERva6yPTkYxm9hZy7rh3S tiwTCIAU5b/y7f0/K+qDzfnvTaS8dxWRt9ZQ6zFeSb3QgqQ5dt0UWquIUDcyEl9Qv1oR MMXdp4KBC2ikyAMJAVurJLEtsKxyETSCsU3hjEdnpzgZL8PqBEkHaWNRkgSZFDGxrUqh 96e84TEoiNKCmrWugAjrxSO17VXl8BaJY5OG2OrInp8zXlTZURYuusUbjx3SqMp/2TU9 GlCSSQaf/6AjjPbhZBBkhm2vb2XffEbQ8ROyJMgAjXCvs8VFTPolW05ZQ3IxS5AfKKjl pQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wampavx6n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:50:00 +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 41JIQkFm032069; Mon, 19 Feb 2024 19:49:58 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wak86amqs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:49:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mrGwcwH4B9W9lU/L9IFmR2Vvyikx2dnDEdsMFnq/3L6ka6HH8ib+9oh3+1MAHV9Wa7PJbV1THQ/nXMeazM57vM+H3710HiG23GKpkWH8WgjifPMoKDoFy3RrjqN3E6zYH+k10dTliym5bZEq0u19KmlEIVQkwYtUtiW6KJ194n0ugcfTpSZOdoroaE9XcKGhMa/9RclMOlOVWlSAAMZy9TkQYSeAY6OX2fkmn4DBS/DCv/DXQ8KYMzfjOyMDvxteLJwHO35JRN/jFO00O0G888CxYTsoSetbZ98AxE971L/TG2yMHvCBBDkGtuSkfM8Tkq7RFpHrn/O4tKltiq1pRg== 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=fvTwOUPP0XgFqVIjoT2LAcfhJ5sUDbckTiP7ncAvjhY=; b=X3x9LvLsQ1fciWFqpGbUv9y+mN96lU7Fo1PhQTVoTyu1n3zCWeSLDPyEi2dp+pwrw7pPS8blMKokVKiY6FXQYsc0t3kLee7LiVRxPAHdjorjcuMmdjHyXN4m2ussuPcuHI9P00j7kXI28H9m8FJggkB/Y1AoYrW5FaEhO+7O9kAeiHuawCuTQKhgHT63AYfskXj0M9DpfLBMKDkCqzKorrbPBBlRBKwl7orCSlgetMF4mI/A8ciE1zQ2uoc7yU0IUNa2imxDuY/C+6OGZw2AyxbUNyYUmT6RedPx1Ycotea2SOyYt3KQJGOBe5yyF6vBHtyxVu2c3X/NmS2L+C3GKA== 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=fvTwOUPP0XgFqVIjoT2LAcfhJ5sUDbckTiP7ncAvjhY=; b=CgnN5G2MEpUOKxOHzo/kk1oohhyhOYswOcLKj8C8Mr+bCdLBUutqgz+NE2qipP0qdvwNGBBC8iRcilv7blVrkB58fPqCGSe1sAgRU+2xMW++IGHm6U2Uqth3qKPsRu6Y4w5BPdi2gzRhnstNo3gyJw23gXV6icVSdYspqxdROV4= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY8PR10MB6852.namprd10.prod.outlook.com (2603:10b6:930:84::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32; Mon, 19 Feb 2024 19:49:51 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:51 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 08/10] btrfs: verify tempfsid clones using mkfs Date: Tue, 20 Feb 2024 03:48:48 +0800 Message-Id: <44ccd4eef48ef7a8fbe863bdd7b13b2ce8fa642e.1708362842.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MAXPR01CA0104.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:5d::22) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CY8PR10MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: 65d2de89-e15f-4107-b272-08dc3183efd5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oLqlOE4hmdS6/TRuhL9bPkudeisYbyDXvD4WVxT3D5ZTeC+nCFm7MlQIT0PpFfYInv/R2BcrN4dIqbVPrWUJYVTBfDca3IUlhTACH0bBkxGK2xIUTmN7ZBMWmjn1acLyJCN+En1nw3Qfnlk//J/7NsmsBQFHiM0dq1aFVC2Htb+GCiweE3EjGS83MOnH17VH12oRKKBUcJWTQWVbzVdAPqeoFcchZq4rra2XwteMOMdo2NSqe5M57lQipz4Z4yEveG+vgt7n5ncsfzOse9sJN9iUXfvEe9eVAVeGJOD6jdhSAWJOYsJHxQNX5cQwAPBNUWTmf6RrQr4lGhyApc9PC4Ds0NW/LiY7Q20G86UMuC8ksMBl8CoC0LpNNilpKqXuDh9okkLAUEVkcNerkSh3CQy/C4LgFdjMsHHZJBysrrUQiosKyFIjzcm3KcbfQww6uxjEHmGGIYC/nMjzhtXj6SJEJw6mg1oYCqENyMQaamPXrqC8hvLRjQoGEENC36vQBX/O6vXUGJxP59433MqOnOtuFdlTkVUThSivLyY06Nk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZjbcmJbylyvj7c0qxN4ISclRX+Oec6WmlnIBS5dL6rQSASeCsZalF7ufUOiV0Tp7SFTJouppNr7DCDOPdrVaReOxoJGOS+vtVJKr71B1Fp7ziHo03ogCpqgfS7/cdH9gqQsKJCxNWPFYDzV50019cM+AlNKlFHWMuZb+5t/3JDszZZ5jyiYeRXfbszPq870fSOMPUBpEe2hUBHtb1+Odrn0tG9wRU6SiiKj+RFvQfLKTsTuGeCTPaINE4AwTkUubt4DzHqhI9e/n3ZbZip/kW/ptRAYW/VEH2v6Te9yzYFzInzI4+O3Pick+KPKNobOkbz8S9UxnDIxty/8oN2TNWqfKhanLLWqULjrh5AZihNeK+Ajuztu0IYJ4nqifKSQ9x2Om1LkMBIAwTihp8R+FLTHEFTGbBn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hOtUCYy7t5izGec48r/QtkdaZM3sF5h3YTQ7OuEtqXeueaXFazYesyd6cMh14MDHGvLD/sMVwmhMqvYbu/KJWFHZRqr2Y1rmbLWc X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: hOtv/AQh20fEHDApnmrwwxpQ5OeBP4lN6ltNalcQ2jWbew8Lq7VUH6PngWVtdCJw8PaQmyoXl7FFsbQf74lE4lSyCHW6slgDwrKDyZ++qQvcARLAx6IdIYLsQ1/LU/mQ03weTVEOduYxpeIWNeiCxOkidiXM+G7FepreJG+3sT0Ql1Fa2q5xtKxGdNxTK3ZflFmlSrtwSnl7clCmk56PV5FPz6Km/scUubumAZWHOBO9s+9XW+K66iJ1EHEjMhVd2nlYlWEPcaDjmykCx5vk/XfoNAEUJPVHM0LmmTkN+LHA7GorCZ54/ymrUIXieCNClxbryc0wJlfIgKEsIPgC5mfNKHtvnHbAL6u+CUEKvTj/a5ahhyJoQhA2yzqMKy3XKJuLxryUz3uH4ZjQKqT/BMttk/52Uj8iX7/ZUj3SfdGDzzN9Dk0PWRI0/1Y1x9Vy2Xwu5f4SuiLzWLDPxK4uYH+woB6AGTnTt9s4lm/ZzETDHkpkkhvrcIaISHd5GUP6uOgZ20j73lh3yr+cF7EjCPKZg20uXifoDuyzS42/dV2NRkxJxtjO2I6rEUVsHbjfOvJ/VzIxCEItbOjHoKWMlzootc7MrkeRi1GxXrfhlqc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65d2de89-e15f-4107-b272-08dc3183efd5 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:51.6900 (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: 6ho+8XLQ4E2t4jCBOYLJymlQjNTT0Y2LNWmP5Car799DyExZ/akVSkHusPxTgYpVUBrixa3G/yjPs0D5IdBIJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6852 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: QbtHEeEdPkXPk6rt_Hl8XiFH5-LmJYfL X-Proofpoint-ORIG-GUID: QbtHEeEdPkXPk6rt_Hl8XiFH5-LmJYfL Create appearing to be a clone using the mkfs.btrfs option and test if the tempfsid is active. Signed-off-by: Anand Jain --- v2: Remove unnecessary function. Add clone group use $UMOUNT_PROG Let _cp_reflink fail on the stdout. tests/btrfs/313 | 55 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/313.out | 16 +++++++++++++ 2 files changed, 71 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..c495a770c212 --- /dev/null +++ b/tests/btrfs/313 @@ -0,0 +1,55 @@ +#! /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 clone tempfsid + +_cleanup() +{ + cd / + $UMOUNT_PROG $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 + +echo ---- clone_uuids_verify_tempfsid ---- +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 +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 2>&1 | _filter_testdir_and_scratch + +_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 Mon Feb 19 19:48:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563047 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 3457F59B7D; Mon, 19 Feb 2024 19:50:05 +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=1708372207; cv=fail; b=W9QIqhzY9YioCfSxdBM27cfo5bK+/A+rTbQ+glCOSGzg0BbveAXgMCdaFgJ4AmFzq4HPGRWCfkeDfFbV76hkkc/jow2lJDUt/v/AZVhr23qYT3kxE1AUc2gkHzHk/QFH3CsmMxoAxnWDXiYOiHK8G21Fl40zmiwx92E2MnzKhYM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372207; c=relaxed/simple; bh=cwbMWBWHIHQl8mAueJljLlo9Oq95ZNCvp7n26Tj1gLk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ry9KBBEiDOCq8pr4G6PktXcWI/mG6Uiq7d0vKDk7cFkLOc6Y11TrblPtVIinDA8IFeHYFoymZug7yDD8pOxF7QtCILNmKiV8UYT4CwJiKyudT+45z/BQJxyvCBO+7ihtEavxfygU7g8cp0JPSnlxaKRxkUw4Pbq3/djdZndOMso= 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=du7n2MuQ; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=R0RSeb75; 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="du7n2MuQ"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="R0RSeb75" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41JIJ0is007922; Mon, 19 Feb 2024 19:50: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=JzTh6GNAQniFI69wmY9SY3ms0Wm7FXN5iyCFqLWPOmw=; b=du7n2MuQ2uo+m2oT3fLOeB+4tADCdSv/4f9izpRNdtWqvKltr4mOKYAQgGwZ2tW3XS6P Gp0FfmnzWCTAE4H04eqW1douC8EEiLKnYo+bmzVmZfmuFtcwngDNuPeA5e8g401zZpsU hhzYDP+R256Ubki+Kll83IxWah1Xo3LIeaox3uZe3fjCBz7yPkXXEtgQD2KN1mX/asQS PeTrYe8/BFDkPbseFqK0FeeJ6WG7gcaC9zwctEbx+YjjuENYeURorB1H83+KrX1bzzHs 9HpVVM/wJBbEGsoC8HsC2JquTLL4+ZE6fjxAsoMjE2hnFgNJRYV21eZmArmV+lNMjF6K IA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wamucw11m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:50:00 +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 41JIM4X6032517; Mon, 19 Feb 2024 19:50:00 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wak86amsc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:50:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hcqoYMj8rZhVN45Pa12A7vEqK8afauTdA7ktKtuUVaDbauaGqDedF3JvQk8X9BnH7ALWlOjTyBRLwjrfha1xxFSWPBtVmOxf78GZY+8E32ZTumhVel6jq0vsGXUz+3z7SGlrDh7bG0Mk37iaAzZWtM1+QCjieFkYKCOp3g5TJdZy8edRpgPEAKXWMGAHDi1ew0o02atfMZRWNgLAF82SQq12WFi0KwFwNBmM6TDwIYsIJ10cbm9qXndiy21lHDmio61VKY33fOiDg5y+xTwIvGIt2ieoTskXF13VxcCKAH3/UcuOQuT3XuE7HbicB4sAcBVDtD+hhqpsxJmfNnGhUw== 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=JzTh6GNAQniFI69wmY9SY3ms0Wm7FXN5iyCFqLWPOmw=; b=CZ3pg9S0sXKhug+hDv/mV02u4kzatXv0Mzt4UcFNoB7hVRetLnjRl58rrgxGDdBvKZtH974mVJEvxJK71M1HkLUBjEfJBXRBaROpm8rK7LPNvOarWqaTvej+2bNz4peBbZE/KAylSzzPntnDAm8ILkBQ/COrmZ+d45KucmdD5SvHRq/StDbAPCObHjrHO2lEfQx0R+9X0sJemRLXvjFAeZz4ZzlfRYwGYihnJnZ4JPU3x44oifYaS7TI8GZgkvVE4W0tMepZlVWDlXYezy+QGfiigEIcSDoc3V7Q4/Pv+z5KvZeH2DcLEa9pEoFTEy3CnwnW9o+HaGombfTwfUCOgA== 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=JzTh6GNAQniFI69wmY9SY3ms0Wm7FXN5iyCFqLWPOmw=; b=R0RSeb75iM+7dQF/pBZVYbeHQ4LGY/m2BOunhDJORxkJOOXzeJfq7NK+vDzWiOq5j2XS2cEj82ttXZBal7qIL/DJjOBp6DywokUVXW+Z43H9A2lOfQWi9nzwZoqlNB5U0QWo19F2AnbmCgo4jPoR6XWHvStEVa9GwmSrfRwBx1A= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY8PR10MB6852.namprd10.prod.outlook.com (2603:10b6:930:84::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32; Mon, 19 Feb 2024 19:49:58 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:49:57 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 09/10] btrfs: validate send-receive operation with tempfsid. Date: Tue, 20 Feb 2024 03:48:49 +0800 Message-Id: <7d0b939fdcb0052c184e18226fcbbc4454508243.1708362842.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA0P287CA0004.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:d9::14) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CY8PR10MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: aaba7eb4-e145-4065-7c3b-08dc3183f351 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Evq73fdQdvZHTq8dFvqOOGn36xoACL/oAoSUdZb3pCIwwg/WhF9S8Xd0mOHFl84at4l4RKcoBKrhbIYVwfncg63WPdvW6JfWR7HFvyzcylP1bXz4CTmPegYfOos1WMOTnxm4aCbgbDIHUS8/oylLBDaDFC26bX+Ovt0NOC96cFVKbfGIo084C5nd0Cau+/HuiJpm8gWzb8K83xwjMlFNfvjjuP7faHjJ0KP2jAB5m9tARs3D8HmaHMa2wltNZlAJvgzRKWK4esolCA4JFr3G7b0SMLrU6pbUDJG5aCwQlw1gBEEQBCQALMEAr7ZHX2LA6fCCdmKgcpCsE7xY+BT/Szx7rbV/5gXGNWb4DHN8StAabQTUqlCRkElSsW6Ut006enlgNo81MZI035ig8Uo4pYEvvzAlk1YR/xwxmSWWiolZvXDvmJewXQ8zTQZ/4SQhlBk863MSlmE4f/tn5jz7I8hwYOWHGQbrbjIGoQRJdLllWdn2AjfzzXSuFl43HRACOkTOxC7v0zSqw0LGYOK4jaGGEV5kmlIxfkDS80pd4Z0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;C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KsQ+MUBm9p+LGWmk/Kp3qjDPVAUN+bF1R2RmfMsKXO8N7gES0Mi5JUAiLj9tJAZo6XLon0WdlbyvvMCzG+aVchh2bZgTcteII055xjE9l24yWLDsWKod5Iv9sTyzegW1xMDO8bTaHpztUK+npiWDc+7AY4DhdpC5PvuU3XLckniljCOEgF8Bbn0BKN3hAyfaFPCE72jyfikbRiaFuyY1GXTzvm4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: aaba7eb4-e145-4065-7c3b-08dc3183f351 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:49:57.3308 (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: xoKFuo5QsZh7DjLTd4CZWo11LZBn/LrlBiI1u1kOPnJaqAudaWOQfFZQrleZSUtq1jk6ZJmO3GFySTeUGxWWpQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6852 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: 0h9CBdjCceCBjVXMGvilQrbGBnUdVFX4 X-Proofpoint-ORIG-GUID: 0h9CBdjCceCBjVXMGvilQrbGBnUdVFX4 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 --- v2: Organize changes to its right patch. Fix _fail erorr message. Declare local variables for fsid and uuid. tests/btrfs/314 | 81 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/314.out | 23 +++++++++++++ 2 files changed, 104 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..59c6359a2ad8 --- /dev/null +++ b/tests/btrfs/314 @@ -0,0 +1,81 @@ +#! /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 send tempfsid + +_cleanup() +{ + cd / + $UMOUNT_PROG $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 + + # 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:\t" + md5sum ${src}/foo | _filter_testdir_and_scratch + echo -e -n "Recv:\t" + md5sum ${dst}/snap1/foo | _filter_testdir_and_scratch +} + +mkdir -p $tempfsid_mnt + +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..21963899c2b2 --- /dev/null +++ b/tests/btrfs/314.out @@ -0,0 +1,23 @@ +QA output created by 314 + +From non-tempfsid SCRATCH_MNT to tempfsid TEST_DIR/314/tempfsid_mnt +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: 42d69d1a6d333a7ebdf64792a555e392 SCRATCH_MNT/foo +Recv: 42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/314/tempfsid_mnt/snap1/foo + +From tempfsid TEST_DIR/314/tempfsid_mnt to non-tempfsid SCRATCH_MNT +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: 42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/314/tempfsid_mnt/foo +Recv: 42d69d1a6d333a7ebdf64792a555e392 SCRATCH_MNT/snap1/foo From patchwork Mon Feb 19 19:48:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13563048 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 311A85A10A; Mon, 19 Feb 2024 19:50:10 +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=1708372212; cv=fail; b=snyA+/CHvbKkz5h8eRSK+X/XfyijDitJRvIKIjzupUb6KdXWvSuTWXWR0du8vP4WWhkPwyoj6/+GNPt2vTeiZ8MwG8zvaiRU6QJYl1p+cJBmv6Rx/7IbnNUbKyBUj+GG0BJCNZ9NqpNsgXYYABTaxquzv5XF4hpJjyc6hnl7orM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708372212; c=relaxed/simple; bh=rgmF3qDUPEutVCV1kJnsQ2iIdpHoti55nDu3oKf5DgU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HLRZbBoie86RCTuEl4Govw/mdylV7qF1Ngm0ZW0aBhynWFXj3+L90Ao9T+z5A4OEjuhBfxCqBfSBSZedTpVPhDMEdl52Q+jatK3H8Xf/iuZoqQR2MpZHZGw1MZtKNos44ypCmTFj4IL41rw0a6xsxIVgVjv1FeYEnygVlxJtt9Q= 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=Cikr8sU8; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=TPkiONRO; 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="Cikr8sU8"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="TPkiONRO" Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41JIJ047007941; Mon, 19 Feb 2024 19:50:06 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=Ldy/Nvhd0AZf00ID67s0cK/PJ6MXUppZpwua55dnjL8=; b=Cikr8sU8nF5YouOYKv96vur9BinkxpdQX3dYNFQLcVuRBLZ5wF6bUXeiIfGu6KfwcsiX GYJaNO43xA4JPjLAeUUv92KZ+vzP2o1xDN/9CIPEArgeyYPM+RF1EbGt7YHKmnOsCNtR 41ZHKHVBKMry6mZQXK8jTyY0u0Hv9Z+WjpoTuqFOW9nrKSXZUCs18QSBsUEb+wCttA7G ZhE4hUyudAU+/MLFYx3US6T06qj/SVxNPDCCjzcTmTQDtsz4ZJcGDHbzELw/9Z2sAXbt OAm787wiFlqfjd49uPX0YRn+Co4zvF8CteuPl1VTYz4qwnUjUHDUbnJCFgKLFtVH+g6d yQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wamucw11r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:50:06 +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 41JI8pis006608; Mon, 19 Feb 2024 19:50:05 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wak86j068-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Feb 2024 19:50:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=famkb3PRNBaHmESEdIzPFEB5lwA86vXlhtNceT3n75INsv/iukU6ae/OdhLSJOIepZQEIrhnKmuj/V8C0d8lYi+qr2ZLSG+wx7ba01G4reHIE8Nq21fxnSNUkxNhT68poxmn8SblXzq/I7T4ilP6XaImJgSuiG/+vdfTViBTbmEQp3L/ltN3huMiGqdKwhOQHsAs/XYt0WgvYMJdj/wenkx14K1kctZPGzG7oeAsCfnsGZxe5Ac37Qe8/8HUdbk5kD0fiW0JDKVkpxNiSj5drb7YiID9ejsQeT8KipBoK03i2zuy+OG/xEGH7uCZ74OLDWZSeATyv+cZf953Qap/CA== 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=Ldy/Nvhd0AZf00ID67s0cK/PJ6MXUppZpwua55dnjL8=; b=Qsmd9S/jPTgCGOJQjqYi9duzzcoa76wS6BfPnxjGzzhrqcsy5eDcAsfiwSVefIUROyG5h2sNnQ/HTp81X+G4OMx3p7dKiZl0hNd+ezaeYRgjDkTqcYX55nbx1B5g6WTdyTKUwfSKbR0LbNQMUEmSRB1FlbpY/lf71MFOZpnucANQWxFPSz0v0id7+hGy3QZAy14Gad+1KGLNGsF6XHVZrk8ZN5yez+94P3pMhgsocexoUSltmbQzfdymmHvYl1W5J5Y0SXoLGA3Esefr85xk9laBauehzFTm33h2M0HAknx3MAoW42t3rH9itUhMJjJcGwV+zlr1xjlQtBpo7nKiUg== 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=Ldy/Nvhd0AZf00ID67s0cK/PJ6MXUppZpwua55dnjL8=; b=TPkiONRO+QXHdjn0W2Kn0A3TB6NGKNPsFZMSvq1ruiz5R4el1uCvtt9N6sf/2sV/QIFbCOJ0QJP0lSKEtR0ATb5H1bp89k3D6hCKuLMOYv57M4BEUH92YY73FUMjHIlOhugzxTctEVfRGQoEhsIqF4NKRNsHqEBPPoRjDZrSLNg= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY8PR10MB6852.namprd10.prod.outlook.com (2603:10b6:930:84::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.32; Mon, 19 Feb 2024 19:50:03 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::9a3e:7f11:fbb:1690%3]) with mapi id 15.20.7292.029; Mon, 19 Feb 2024 19:50:03 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, zlang@redhat.com, fdmanana@kernel.org Subject: [PATCH v2 10/10] btrfs: test tempfsid with device add, seed, and balance Date: Tue, 20 Feb 2024 03:48:50 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: MA1PR01CA0162.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:71::32) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CY8PR10MB6852:EE_ X-MS-Office365-Filtering-Correlation-Id: 2451fc3d-a2e5-4fba-da75-08dc3183f6dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RY+ENs+AHbE9JCoCbQksqSO+zl7ysinILT2KuiPvDKc+fJijajSUGhderS3Z/WBjJjiCeFkhOjgLS6jFKfjn3JfvF6Sl9/6m1ipVatzU4HCtryAZv4lt0k8dGwgJiUhcMI2n3RE+W7FqY0EBwIsSBmi4TlKvhpJ3bKF4aGLTwmaXdu5WhmUlhIfRanUVkDp4RPdaEhRyY1voeVun4Cwj75t3m2IDiV1GJjcBYljZBBPMh8EKgT0eWxMDzqjj1ZemD6v2L4MA+Q/vM5cHdDiGkDsmLB9Bsita+DbwKNyEewXyCMeHqoZfL5g+zLUU/G4D5NdX7UTtt7hQX86QDZUiSnvd/tx7MI+TBWsqd8MJ0SiZZKJtJs0e3RHfKHTj/OSkYPjKdTRYhoAG3mV5PKdvfyqHeUI+tXy5WakVbl3lF8R3zRiFlX0PMZASEhHt5wAZtA2q+ukaSDXs+LX/QwZlWovXWbuGQz5r7Bapn9g+ZYiL/ols63TgMTRGTlLZEPVMXpsx/6fWDB6nGafO37XLzGG/cMa153Rts1ZhEXrQBJS1y1negH3ecswPaNBFllw9 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR10MB5706.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(230273577357003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eYvidHU11pSwAfq/zzgoSEEfl4lHfSfbv8I3OPDEsKa+EJiHIP2r/tSI1sXYhXSTsIa22KSv2HABJnuNNNQD/Ljmd+IekTnuo6cw7aj2UDkskQnVkrzzW5Oz+wD4l6tGpOTJdiicw/EhQRjYIc7gA0Mct7jV0B0dVHUin3GpgsBIHA/y9D3TEpJGw0MMZdx+nRRCRhrWXN6CjY3DAVfitxxd2bxgcCn9K/hmHRLoCwnSZ7IePkmWTsQwkArzqT5db7JbPAofl5d7hjzvf8TGg6qI3xIVs0IVskfzejOYBKc2/EhwsmF/YpoHcqC/OQ/6WbgBi54qfTaDrFFbLv80Aso6pVaFxs2bt8YxlvjVBfvjRgnmoYaVyDpSOHoYF5xGv4FBB+0Imhkilmng1h81XkEUkPcEJGG58O/ihkRtqdWaGRTWtQ1uX4xZloxG0KEhOO5Sg0IFBVmRBKjHdLfGfbk1LKRU3IFJQX8tozmDGhQN3yVSz0LiqBnLYW+H2hTEaPHDpaRqX3pYpMIcZdA6rAtAgt9Go2Mt1oDzUSaJ3PMhr8TiUWOarIzw0vGbO2sPpbTRazQgpp9EKyfu5+Omo5kdBVfBI7Ucx+uoPBeSmx+mLEHtxSgF4on/uYNJOM15EDu85Xx5UI3ZdGeC12pCNblvABui2un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8fw5L/fzIF4v59gOEnU7rUZ24Z9jeOKMIdQjlBFEB7/z3lzLaETyyR9gUZhSf1pfTFSBAP0YJnAFXaPijV+AlZ2/C+1Mpf+lHKSd15oHEokkSzl6bfr2ZWC68R1hIcUE0iqki/UgduE6/sMyQiT5cEFEtv5I55xkJMnzJ19I3OFVPLy5gkwiw6MM8psXY6N5DnUBSkI+5Z/2hKPq901WY7k/arXKQ8yeS4nSkNR7/zR/RuUZrWLjQnraGZL3PwL/vTcUwoxXhqv71/JziRiFrjUgGshmFk+TNM3Hqt+rRkEOemHim1FqR9tHflm5g62XCWX3nTob5LVhxLdcfGbzCMRPe4mEL7VVt/erozpVCwT23Y7uHmK0LyQrsKCCK7wByxyEFDuVG7ITLgm2dKxpDiwmNvh3MbWGgZ0S64o7+VK18UHAKwEDXXUYhyDSylQUBwv2v8PRpin5RwOn0RYfEgnVqJHSEDKqUA4olSrcXmbbNQu4Stzurn+EMp7tBYRYTDcGVy8lVwDn8jBTkA0iGEVbq9njYCyo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2451fc3d-a2e5-4fba-da75-08dc3183f6dd X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Feb 2024 19:50:03.3141 (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: /N1DmmRbk15cjJyPinGMW63nG1b1BuNdLrxSXumncBUVbWhkOmtEzOM6YDL644sL/T7+0NJuYIf5GKarzYoK8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6852 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-19_18,2024-02-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402190150 X-Proofpoint-GUID: CivbLhzb1MdgXnD8vFEaMvdPecEFddnZ X-Proofpoint-ORIG-GUID: CivbLhzb1MdgXnD8vFEaMvdPecEFddnZ Make sure that basic functions such as seeding and device add fail, while balance runs successfully with tempfsid. Signed-off-by: Anand Jain --- v2: Remove unnecessary function. Add clone group use $UMOUNT_PROG Let _cp_reflink fail on the stdout. tests/btrfs/315 | 79 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/315.out | 9 ++++++ 2 files changed, 88 insertions(+) create mode 100755 tests/btrfs/315 create mode 100644 tests/btrfs/315.out diff --git a/tests/btrfs/315 b/tests/btrfs/315 new file mode 100755 index 000000000000..4376c7f1849c --- /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_PROG $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} >> \ + $seqres.full 2>&1 && _fail "Failed to file 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..e882fe41146d --- /dev/null +++ b/tests/btrfs/315.out @@ -0,0 +1,9 @@ +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) +Balance must be successful +Done, had to relocate 3 out of 3 chunks