From patchwork Thu Feb 29 01:49:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576398 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 EDE4F3612E; Thu, 29 Feb 2024 01:50:25 +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=1709171427; cv=fail; b=czz+HtWCm4+OXUz1424yxRiqISdY7V+URpVn8Xea8FdHecrtkJOXNZyGmc/73oUG4j8l0sGsJ1113n9IL607cKXs4kMBO6PN+RcFHv5+6GBaytaqOcGPa2mWltOLauYhRHCtagdqti/9mVhp41Ox1fHNHcjlu5l9SBir5FRwYSc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171427; c=relaxed/simple; bh=WrMBRabfHse9Apy0zNbhVilDYiF2S22ebShInyAy3RY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=e8+amEMp41hbRfOWn6KeSefM4MMgJGVj/wWsJGQZGugkcXKcnYHUaRTSFexEyJRWuogyDVRWwGGJBae9r9oN7YwOPL51hmWEzSuxVmhAs4/Rg+6keyxkuilpGeB4ZWKKzVUuie9aqYCXM9u2s9vV1nwnzv4JUt/52bfrFgPnFjg= 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=X09au5j8; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=yuaOV3C8; 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="X09au5j8"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="yuaOV3C8" 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 41SKP8ZN013132; Thu, 29 Feb 2024 01:50: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=WihQSDuEsBnDc7umj5Y79RmxT53uB8WQ55Jw3m00RJw=; b=X09au5j8vunQzVDitphmhYqYLifpAkhoUXt12ZIUu6lPQhJTY+RMpq9l1I/PJOKhhV83 5+vN/FmtvT+cKx8EJz0aiyoJiN7iTV1iU7rI4K0itGXsps0WRzP+f5Yfq6NsxPiYUQPP 5EsdcGkfwpOM28bqOquZBnzdBsWiYlrD9y2bkb3bkxAD7bw7cUinIvEVILoALhk3r8O6 0aX5qYApDYm13FqWKEmviXsGBBejbDkYJjLBnafGFRzlgyiVlXtaVe7ypr2yeKUbeTA4 nDI5vO8IEGf1v5zfsMXL40FHzxu6rwTcgJmq5yptkZ93B7O3+zrZwsL3k4oDdbhB59r4 dw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf90vbx4r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:23 +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 41T0UxOu015351; Thu, 29 Feb 2024 01:50:23 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w9yxfv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RjfKW0l4d2G/g3FiQw8Zce+DI7Meh+UoiK0Yf6f0t6e2WNr6T2JeCCvsxiBEzUSzUXcsXoM2knjAIS2XALZD7m1UCXlLjb5Zs/4dLhqMiAu3nEUQctVEQ8FOhDYvDltzVQc/vbq0fDS8hqWtbTCBPf8lrbK+vjuKNETTUadZW0hZVPvgmNTHp/5qq7lfO1Q6NO3/J34UoCkdkFryRS6/JhCdnu6+OItP5WzDW40u1hqa6fvad1+bAqFKbu/5/PUhICijlDMEXdwQwGI6uifL2Y2ptf5XrQc0ti2Ei+ASvDcI9QUaDoAECWQXTIsX8mocHa59RLOZGm5aDpawoJbMoQ== 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=WihQSDuEsBnDc7umj5Y79RmxT53uB8WQ55Jw3m00RJw=; b=FF/zuxbGqE922Ayd5cUdDMefcYRjQ4BwiO9aqyUneTaSQQdmX7KrxNdURlAXAdlhJz5B4FnUZiSpBnpr9RKUiTTZ4CHJpEwIdaYfJN+2e0zY9L4HGtxX8pqeYUTkPZLLU2T0GP2ipTXCaHtTaPpAsbU1b8L7oEKCT/4uQG6+JOF55ahPv1q++jU+SsgBpJ42nlAFnJIqNeW15YUmVJtk+Oq/1M4lzke7QMDc14AoRqrVrjiW7F6Pk2stJF3WjoSpZZTO/UZKQerhk/dOXIEYxZBIN2tuyqmwMhYcuUo8bE1SHukpxAl5OIo5bFC7p3kZ9Z3ppyiatjEnvHyoeWBmgQ== 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=WihQSDuEsBnDc7umj5Y79RmxT53uB8WQ55Jw3m00RJw=; b=yuaOV3C8Ytw4GdKydm8Q1H5xbpb+JLT2t+Hq0vV2UM0pwynx0OFprXWDh1Qw2T8RQrvvv518L5ZvXQvJnWoWNsHC7lMcwJcv3F2p6PvGhbSXNNY6NFmX0daw48wkO5IHdb/VHOEYHnegYQt7hWLmovYQyScx2Jt2DaFBvgSrJJA= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CO6PR10MB5618.namprd10.prod.outlook.com (2603:10b6:303:149::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Thu, 29 Feb 2024 01:50:21 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:50:21 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 01/10] assign SCRATCH_DEV_POOL to an array Date: Thu, 29 Feb 2024 07:19:18 +0530 Message-ID: <79ceba6505fbf13ed731db3588bd7fd932dd9f5f.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: PN2PR01CA0025.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:25::30) 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_|CO6PR10MB5618:EE_ X-MS-Office365-Filtering-Correlation-Id: 16ccf931-62f9-41df-2163-08dc38c8c9a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D9uco/kV8K5v3oqKNjG1F7kyK5L7ef7QirwGm060S6QiBDmUUbJbPHdU1PTs104kuy4cjVEJGGfdTmRxKOaH4EBPbcFH7tCf9CL8DZR5w/oAl1rOE7MiG74h4ZPpktedXJ61BAphka4uPzYQ4FNohkoDWMXe37GakVT93s3WMEKvfH5jBrq9J7+0Z98wy9hMEXKClh1mrXQdXoj3TV5gkO2KVF9LCo/dhmojy7WR9MjgpnDeZ2UdvcuRRc+MPQUkgl70Q9xbWUb0zbgJOLAOrnsMeZkCAnNefEMVyJroh37i58lLT9fZQ3FDxK9iVwx/QOrpVkA9s3g5ncfGof9xtjeTsyzTKinS+D/gyv1H9ogopAhuTZpz5BoX0VQOQ+D36wWs80nZciJSFhk0em3l036OEHWEsRuWju8Olcb6tN8PJtowpQUaKw5dhHKT8ORh56NMxAVMp8eVpfkB1HVEmXrS0oACAx0jUcOOlXOdoqcZlbFozVNIvAscXheeonz89k2VdG256Ew9AbdBMltKdjs7rdp5my7DzXkehwW9AYuE+M8kheicTwgxHdgdXjM4j+FYj8tlON2T2MjyBWGM2Skbxg9x7xMcPmkawPbnvFO2Tx7xq1y3+qH7HiQ/aLs173bDLCuAnF44dmxgvT2joQ== 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: 8aCBN2Hg7bDq0t2/XU+p9Foot1SbPgZj62G+h/KGnXxVCZTnirtmAzefFXFsKvSr+xp2croWGvwjk6Mv3LZm3Vh9rY2RLT8G4Koa2rOcec9Il8eK0pD3LjAN6x1rC9tR/DxX0pdhVMOcQY9F3pQTC4M1JEIIPFMQJ1wptbjmSWLWPR8/PU7VwxLurC2QYRcP8fGu0OY+ZEbVKvgvZ5QHz3+lM4N/FyW6goKPZc/rKfNmWay1CF+lbROWFOcNyhO+rL53+H6Q+//YOUa0ynR6zsXcLPB4MEtUOwvcUMujurI8/pXORU7ixRDY2qknmqoH3GqImu+hmA4MEYIe4JU5fX6eQmWxCMqZxXYxboXNaFPweRpUoNVFtc/aCcMGtClCi6OtcqfUwMysNa2q+r67Iaa5nBmMAj0UKtWN26SPpamJuFVaS4Mo+pR8zxTZzIOXJjn1bFlZ+ENstohUrQ55qkBMSIQNdfGKzreazQ57u0hrBlbbYYlSjEwz1bmcrlX31OnnPVSk8dDaAt9Fu8HEdQOL8YCctW56c07SMdwPZ0NcAZI1Zg3DME+6MaYl1ZFfhwefAQpAi9JfIE2bLAGVzUhzfca0TVoe49ixdJi57aheSNpDVdaCR4uzny3CsZFCIe9eGzrIAU7TvruGhafKF+nblBk03UlptjCyjjGXGldqoecbB3T2tz9Bc/NrLBWhrMTXdkLzlIyRbE8PG+qOsDHpplDKZBCwjQJl9U/mrK9JQz4DjWSmYQOwmRiwW0tG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9Yq/WemPEH35HsKnv97r83c1kRSKnMnmhcWO5CLrIiTfFzLpPWpzSLsnY38Nv9XXh2ACJvxg8wXWUrEuhhkZU4O0MHDi3gdaNtwOTEL5htphurEzh2kJktvhuvfylpVFu4dmMytsfOMANqGOd40XtqBioEFYaaOj6r6myoh3Ss+r8JmETm1zxyda+qkX6fSjBU6FNNwWWtW1xXQjK/eq6JjYuMRo/FRjUgm7MKj94T4BWh9MZl6Jea3oB9kQY4u06roFFnHIkBGhUxipy5KyZromY3aRs09VB7WMGlU2MfCIj6RS19sYZDA4Gp0LVK/8CpArByWRDZw4Dt6dd8YHb3gqKlJYlt6NaE7cHtITBhMv6M3nrtY2vxWadPyDasn3TToETNLqxFJ67ANtiVfrAhsu6oYJ7c0TKTTKGKdQERmtaHQWyJGmTvAXp+qSFB93d4FQFbfmU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16ccf931-62f9-41df-2163-08dc38c8c9a4 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:50:21.0482 (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: tKY/aIv+vwkxQme5yeLGN979u4ewARVqb3DyVdQvJEcVxSQxVogZ1D2vxz6OTLX35xmg/DbQWqkuyCjgQ0hl7g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5618 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-GUID: ZocYzreEWidRwBS-4vyUaB3V81IMvqoi X-Proofpoint-ORIG-GUID: ZocYzreEWidRwBS-4vyUaB3V81IMvqoi 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 --- common/rc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/common/rc b/common/rc index 30c44dddd928..b53a1cbb59b0 100644 --- a/common/rc +++ b/common/rc @@ -835,8 +835,9 @@ _spare_dev_put() # to make sure it has the enough scratch devices including # replace-target and spare device. Now arg1 here is the # 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. +# the replace-target and spare device. So, this function sets +# SCRATCH_DEV_POOL to the specified number of devices and also +# sets a SCRATCH_DEV_NAME array with the names of the devices. # # Usage: # _scratch_dev_pool_get() @@ -867,19 +868,28 @@ _scratch_dev_pool_get() export SCRATCH_DEV_POOL_SAVED SCRATCH_DEV_POOL=${devs[@]:0:$test_ndevs} export SCRATCH_DEV_POOL + SCRATCH_DEV_NAME=( $SCRATCH_DEV_POOL ) + export SCRATCH_DEV_NAME } _scratch_dev_pool_put() { + local ret1 + local ret2 + typeset -p SCRATCH_DEV_POOL_SAVED >/dev/null 2>&1 - if [ $? -ne 0 ]; then + ret1=$? + typeset -p SCRATCH_DEV_NAME >/dev/null 2>&1 + ret2=$? + if [[ $ret1 -ne 0 || $ret2 -ne 0 ]]; then _fail "Bug: unset val, must call _scratch_dev_pool_get before _scratch_dev_pool_put" fi - if [ -z "$SCRATCH_DEV_POOL_SAVED" ]; then + if [[ -z "$SCRATCH_DEV_POOL_SAVED" || -z "${SCRATCH_DEV_NAME[@]}" ]]; then _fail "Bug: str empty, must call _scratch_dev_pool_get before _scratch_dev_pool_put" fi + export SCRATCH_DEV_NAME=() export SCRATCH_DEV_POOL=$SCRATCH_DEV_POOL_SAVED export SCRATCH_DEV_POOL_SAVED="" } From patchwork Thu Feb 29 01:49:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576399 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 1F7DE2E64F; Thu, 29 Feb 2024 01:50:32 +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=1709171434; cv=fail; b=sVMN7Ft1upH7JoNb5A8tUsevYb49WNEZgsFgnNT1Lx4TlP7I8kXbd24CVsO5j1PVbDF1g0uINNUxFa3ncLyWvAB7R1jYRz23H2XFlzInTcZ8QPB+uySqa4a/0P9oxLFvzG0M0OXGhV05r+VFcStwUxzhaj3JcFy4qpcff8BqAvA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171434; c=relaxed/simple; bh=8I4Ksm2P0uA40omPt3RtNnRDVnr7OhBcLf0mDRXJ4N8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Z4am4KRlUl3j6rdihJJSVKTSIKd4tz0gNE+hhZfVM6D5egjZ3M1sIVj9vlpIYLZPjv94J/dK56oV5Qa/MSNOdpp7TE22mS6tL+3xg0pBP3q1U7FM0O/J5NRztoOTyV05ADjfJ6t/jx9ZJAJxtVJvV/h9X/X+QoyOtrt/FSRcg30= 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=DoKkBu75; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=iC4Qhht8; 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="DoKkBu75"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="iC4Qhht8" Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41SKVw85010141; Thu, 29 Feb 2024 01:50:30 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=fBXBALm7FwiKWDN37XZ0VT2+DqkPxcaDGXbJPMeRGDs=; b=DoKkBu75pO4BgECI5qS//8xworhHTVYRGYQ2C5i25Z3p1VVN50Pj9pFB1acgR+kPYvbo ufzkKKs9kO8iHoVZbUwwJwGr8id5YpD16lKJPvoGf7yMKov5JjS1I1ydTLN+1bRm7FX7 W0gCrZL7oajQY5jHiMoRMG2ujzO3cHhHFsogFSJRPbDZqFSHFrC5Ze6AkCVrG9Um6N/f 9tWWbVG4pMRHyf0rUJrmE5fg62rJ8YS+RkJ+fBJePnLsrd/4GTXgXLaoXzkJTNWHvfj4 Yg6D+VZCI9uGvWGefurwg7c61MsoYzPPp5d/3wY/494kNhThy9RC7qSGOoJifDJeS7K+ kg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf722kya3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:30 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41SNdct7025510; Thu, 29 Feb 2024 01:50:29 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2168.outbound.protection.outlook.com [104.47.56.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6wg9dbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WRN77nj0iR+PPI24Nc57A1N66zLrtplojYzLby5R9N7pah2dZGKIYL06TLWwLSpKBW5SmQFLF1O721pTJpNzZR6ISeCtAheWl7CPQbf2UvqmwDmM/6jjqp4C5CBXQih2Pl+4xd840NsJ+U7pG+JS9OLJP0MpzyOwhLvG1L/tJxX69q6xW8vMzHFJJYQUPiXELvVLftfDSLEv4/iy+tHZ9rF6kmfHRKtJzz09mqZHzfNEzhmFSABYmN7PBUEDO9n3bdYz98zuu46UjjanqG31lE27b9Wd2jAEShx0PCvgJH4KTKT3XrBqyEPkbwofhkHS/N4nEQbz9UTei0ZnQ0B1Bg== 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=fBXBALm7FwiKWDN37XZ0VT2+DqkPxcaDGXbJPMeRGDs=; b=n9ofdp4YAXM1PdOz45YpKa0xcm3GooiEEEL1/7qLMbpNGed1GH9mf1C3iPdOpNKHT+OIm6nZrm53/914bhAZze/QwXwWSpTAQpiVB7HfdH37dhxWEoTaspNzxeBk+uH6jSbzPVB2z4WmL3/7++TxsLWWWkd4f/qoPE4Y8QCVO1ddCoRAw1sCdde71DvNW89C1tFnWTjPjUjX/FK/2yBMWIdP0qOlEu8txUtPmTaQqLR4AtXzUoc3HvRM6Gy4zd4cwPKbczveIcX7O11sCFURf+SA+VqebR7haa7ORdhze9R/9uPunyXkRP9loP30dGi0X15bIQwykKWXUYtEkvju5A== 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=fBXBALm7FwiKWDN37XZ0VT2+DqkPxcaDGXbJPMeRGDs=; b=iC4Qhht89D1yY2yOfw0QFCsdhoF1vpnWi3e9GTzqcnB6Hkxe3kk7N9etffZpynwBmmxnHTyQ93Z3kvBkQL9RUwfeTaNOLuRvYC04rAJ3jO2uXaFPcXuEozGBtJaMtmuBPSY3r1fuD94bxb7cTbpvAva6ijMbXbI6xF21oIpiyxg= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CO6PR10MB5618.namprd10.prod.outlook.com (2603:10b6:303:149::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Thu, 29 Feb 2024 01:50:27 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:50:27 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 02/10] btrfs: introduce tempfsid test group Date: Thu, 29 Feb 2024 07:19:19 +0530 Message-ID: <112633ce1d075a7dca242565e36325220bd630b4.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: PN2PR01CA0218.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:ea::10) 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_|CO6PR10MB5618:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c9ae2c4-b119-4cc9-790e-08dc38c8cd7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pp1lqZeQG5wGni/yYDamz5SaWwSiA0IIhtpEIq1oOOPZM5tpc/6h1Nvb2t9DcCedSV5f0woUiInM2fXZdDTRCJ6dB9/di7EMVVQTujto44B5K9YB4/H6LvvqqW5WH17vVc3ssw9rR1cNstPJTakdEcKW0fG5d53EsNFRb3xUdVmtK1Km1JxUxH0a7po5mEvE9tOIF773lbgjyd2zGj8zbtrkQLH/dCr5O9lqidmspkbCtjhtk+FnrVfFWrb2Z5wRsKRbu44VtmtjJqkRXf6DZqcqQx0uIK6YMMTA6LupzkOidrZyRsLaWGmYFDc6YqkiyZbaBOhpl10vOsT+i2u95YmNV7NI/Ih/gt3p+HLp1nC2/lC0moNuGtKvPUE8gBMl07zKS1eYej/uSaukUbhH+ifc7zX7akvuSCC7QUvJt3MVeDArfPtpwj4VMks9/NszIJ3p/opUZgH5XnbSwyqZ9tXx0VHD5bGXGs/Ci8BHMESZK90tp4KoSromSuLayTh5f1yisBOe/h92Bajf5Gid36HGlRkY1W0h5yta8/tIz9UWP68c1ubkX5iuoKReR196BhEdnknIZtPiNgxJl/1gA3A8EYbdsXAAL8/8YceF5f0+pWaduwDbBzEqo//pfs9oig9AxgCF9d/sfL/RFvR71Q== 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: C/8CHV1omEZz7Njk2fRJ8pwibF1o/YoYpXljEQaRLzDJQwEz9+GQzZpu6UtOyvJfTuVbSeY7fzzecC2xPOLf09TJq6cleujB/LUF6M9DgUk2NOsycwCU0gg/S9PvkRV/UNZF/GbY0P1OtSTLPTrPL4yjgABzjPGbM+SyNGKxhjVqzARgi+fFLxXOc6rm6OLZalNVDbeE6UTxAOhiVOPzIZOMDiLx2A4hpWPbUmQOINCx9y8bYMvCyOtyl/s4JI+Y/D0juwQ81sgIMZQ9e3mBz4/S1eLN3c9gqnDZFErK9cu+NM3JeLWWCv7ud5qEgcYphtIjPcv8NAbpWBIeD/8bOVo+GnCWEF5TsS+UZc04SakGfbTYb90oNCMu7Z+T0A63eDmk+dCoeu03oHOTBpKMZYocYbowr1vorTJn/ism7Y2LyehtTjGmaSVUuiGjJZIF23iOlwKhGhyM83A0m29KJ26yu/ztZD1cULXNsCwITQ7zy07X1RFqCdSZoObdyfPret0ooyJ1mHDc3TdspX7F491XsCqcZTX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-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: JI6EiggMcBSpGSa9XrkFstXX1pidg7qyEN4Kdxby6ANH0q1VxA9DZlBQTy2ymjIVhPL3GGKSEyYZFAKNyIhRdTdMDmfG2Uk968F+EVFDLQXBtZ3+q7zFyYYMqbScfbfZ8yG9mD7mZJdMVMqvI7SxlcMm6BBqULsK6MS8fdLct73o+htUIiMvE4eGsxQ0RAby5pslGrSaysNB0GKWaGdTqxvOndqeZPjI0e10tyas9hmraqYUfAq7M6Vok2PpwhUBnuYqNBmKRrXfMmZOzKjsqM2XLu37VVRgG3w/YwLBdcQP4K79VJBpurencL8GPKLizoNa4t6ltQBMIeEC3CiA0W1gvy3NIxAJn+KBklVU+UKvMwcf6jhgie+SY7Ez8Tz4k3V3yzdXjhrCPsURUEEQHUsByx00waX+mO2q7Y++U4RU1VnWdBu1wjtl4hbp9PYVRHNqH5AqvQuFLyWhiX9gBqihhaZovDS2ORh8bxPFuA+1B4//jZE114Ywa6EsiTuMDMD5+yb4xlCx424VcLrZ3vHTnGCScH3eascpsU+tgQNWnYTqEoY172SXu/Cxwtp4LK0+qrOqtbaOozOZ02c0ib6wQO70yS8NO8/Q1sZwnxI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c9ae2c4-b119-4cc9-790e-08dc38c8cd7f X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:50:27.2800 (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: U0/uYHQ0Ui1fdHrQkAdEsKkq0QNAj2RUo2xpW6TdMupXqaMoQ+pcsWUkI9ZQcfEwKlK/6Rf6RMucqZXmg+AWnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5618 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-ORIG-GUID: sQPixABPHz4jzQqFExm25J89yNc0SIDq X-Proofpoint-GUID: sQPixABPHz4jzQqFExm25J89yNc0SIDq 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 --- doc/group-names.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/group-names.txt b/doc/group-names.txt index 2ac95ac83a79..50262e02f681 100644 --- a/doc/group-names.txt +++ b/doc/group-names.txt @@ -131,6 +131,7 @@ swap swap files swapext XFS_IOC_SWAPEXT ioctl symlink symbolic links tape dump and restore with a tape +tempfsid temporary fsid thin thin provisioning trim FITRIM ioctl udf UDF functionality tests From patchwork Thu Feb 29 01:49:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576400 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 AEBC036113; Thu, 29 Feb 2024 01:50:39 +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=1709171441; cv=fail; b=Og/1KgIpqX6VaxMB4SRapEdScFmooY7sL3XYdfue6I/OJ4K968SFj0g9jyDNz0skfw6/Ah0FUDRz+i0LfvBEk9kvygrah1Di39u4TYv8KieQ8Vrz1gdniq4IcGLgnx1MlYTzV4qjzZP3vtpo0Tu+SBEljVzRBag0r5HQJj2e1Uc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171441; c=relaxed/simple; bh=5Ppg4QiZBqPq+8I7rjUs9pyVTAqwX0CKBqDYRphm9FA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=DyP5dXbSPJeYbrLUTHg4bNSR/ZEUQ95QrSdUlfupodxOENnhYWvaX7UC0exASzPqphgATjvqgh8e0DqWA3+4tBi0ezXJw1aDJj0nUpTR2xeXXtn41uxApiemG6SWTKqQI65AWgW0EBCdfb/ovPnFbX1zZs3iCePGsmX7zN3qPHg= 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=m0uqkTwY; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=HH0/caSm; 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="m0uqkTwY"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="HH0/caSm" 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 41SKP8ZO013132; Thu, 29 Feb 2024 01:50: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=Lx3zo9LqykSzgeuQFD+gExDimg5hc2r/bbpRc6Aksg0=; b=m0uqkTwYUV3TikWypaUKnXDDvq4He5rsTjDD7gNtVNXVs80LwJzJ4uhgFn6F7Y0nhtbH kLIDDpgtAXbkxmhQQZBlf8jcOg4SaF4YzSrIqydraJl5oXuf1OOsbGpOo2oPcOwZueYS 7VFWuA+qbU/o9qDgD2b9MyBwl1fzehezQ1oQrs3uKheRIXtGiItWnreVzWBEW96/F8MF 6lBXgvkBkC4gcpu2XdoF02+MEWVB9Yyo8NnvFlZB+VdtUwEszbSvnihPonlz0StAHeJW NrhqoXrGheEf1c+hDtuHbqA+rm/goS8uzrv9TkUqwrbrwOQADs728hizoaqJe4BSAr4C DA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf90vbx50-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:37 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41T1Z00k025481; Thu, 29 Feb 2024 01:50:35 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6wg9dfs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iAvffWJE822OWlI4n6SXHJVH4CDF2Dg/NHnmDZGJ2Joqsh7tZLNbJPlXr110dy7Ru9RFv4dDUifnVsmoD8qwfQf06hRFZQFLJ8paoS5ABrb7sUC+OVVI0z1RlhJyhuT2dvTN4+jJy3ZJExZ2hx9rt4h9tSLBfQxPiewTKIturkCME+VgdBsNtZXLdtfp29wZHkcbvLpp1xQONfZz7rtVeL7t9LopQVWw+GMoHCO67oARHJd8ZGbhvgROIiRW7Hn8jnsGlYONm5Ej9xPeP1kN5WPvVpvSdCxs8ZgDVFwdg9VJIWK4YNIuEc/275JJp014TNORuIZ4rJ2LZgiqrJC3DQ== 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=Lx3zo9LqykSzgeuQFD+gExDimg5hc2r/bbpRc6Aksg0=; b=i7BFKCGYfVbER5f9+tympaRyHvdNLGl3idixTwWvvg22woF2obRnDj5ngN5HzxTqlJLVFQ3JjzBs3QJZGApqyY/9zYWwC44l+BnYxhA/XRI7BXicbNqsOjjenaTlEaSYgiS63Z1S/qGsGLCuaYy543JFldwPkZQBM6zA+kGYLZOkH4LhbCRWC27GLhbL3c8lA69C1z7txMr3P7U2futByNiHZStvosHh/4ntwpNgMTBNAVlMQWxgmCbkNJRn0WhbhkHFtj9yUQA1RIP8baHHD4lyJGUyI3ig9hJ+Mb/7n5RoNiT0XZml4fqMldF85OIH0IrkB+y/QvaA+vgdE635wg== 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=Lx3zo9LqykSzgeuQFD+gExDimg5hc2r/bbpRc6Aksg0=; b=HH0/caSmavSfbR1VKZVMhkXEMIoNRxKdZ97B6ng9Cks6t3yna0Au0AtpQ13vEpobTPMwZg/Tw8gahs4ztOiv1Kl4lnJolPKOxkpqJJIGJljYNhKyxa11cRTwsrH1O1/y5aUj8prQYN5htPlL8RG7huzkoS3oXCT4nSXNaE/kbgI= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CO6PR10MB5618.namprd10.prod.outlook.com (2603:10b6:303:149::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Thu, 29 Feb 2024 01:50:33 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:50:33 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 03/10] btrfs: create a helper function, check_fsid(), to verify the tempfsid Date: Thu, 29 Feb 2024 07:19:20 +0530 Message-ID: <94c8655a490deebf0a917d456489d2364fae3c92.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0030.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:b8::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_|CO6PR10MB5618:EE_ X-MS-Office365-Filtering-Correlation-Id: e04da688-3341-48f7-9ec3-08dc38c8d0cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y6NYqZLVxSAfRUHrPnCo077vuAH37Pij5rQ8aTPT9lcz85H/1u1QrnQRtQ6BPU1lieuMuvPTeLo0G63GDs79jPAbVI0BLdjKdxt7ReYr6bCGzDHb5x21MLS9v+qag0uRB9dg792m2MR8wwTOMl89h/1ODsfwWkI/V2HV01Fs4gLuH+rDrCl8UnczlK6xP25hdI9VVxMlhEuOF99Mh3G0Ho/OPIhxjHfowPle0LeDCrRc9y+lBnSgXu+LzdK07KhB/4VLmZPbCV9PstAhPLQSwl3uSg5X2SWBFVQmTPxNnqmnTVjVpDgfZA8gJihucKBpombOQf21TISiabwGMzYWG9CO1zcs697jaAARWk9NyDnQ9/bozW1IYWL5+jqurzxE1XY0qYnk1UbkVrOsdZZODEQCrRznV8agc58EiL4T4k9Hb7oJ5DkU47SJvAdpjq5qLbKxMhefwWD3S1TnEbvB1rftsf6TKcT4QYmyiuheGb62Pn7IuGIA2pBxD01y4nPBZcsCpVFCpfl0oBmCuXJkBT1VAQV3gOQ3qYYQ0n02H7Gd2pJ1t0fNocu5F67GeelOGEN/Nume+77xuXVj3vIe+p407EMvFtEwhVpLjs3EPmsE6osaVc+9BULewEMdf93Yn22oXHg61KS0R0ElFAI4IQ== 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: feAjaOEqHAmViEb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fR9fSNCZTRzPTRpTy56jJChJyeRpElX1T4nXqT1UyFDPVYi8gE7kM272Et6f/+iJ0XpnmViOyhctRh0tQJ0UEZ8CK6d9S0CvOZwOxhLgkgUbQA3w/WtZGaY6+As= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e04da688-3341-48f7-9ec3-08dc38c8d0cf X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:50:33.0767 (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: MdK4fzQYv1E5pfgZ18g7acobzuHAD4VSBtoUSN9CjIVdRsoHO/TEUQ1jk+j6JuMQt+WAfU9bHrv9keo7y0qRnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5618 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-GUID: OeLNJkdXUxCJL90TvGdxn33Atzwwgeux X-Proofpoint-ORIG-GUID: OeLNJkdXUxCJL90TvGdxn33Atzwwgeux 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 --- common/btrfs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/common/btrfs b/common/btrfs index e1b29c613767..5dd0f705fd90 100644 --- a/common/btrfs +++ b/common/btrfs @@ -792,3 +792,43 @@ _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 + + _require_btrfs_fs_sysfs + _require_btrfs_fs_feature temp_fsid + _require_btrfs_fs_feature metadata_uuid + _require_btrfs_command inspect-internal dump-super + + # 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 Thu Feb 29 01:49:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576401 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 24F652E84B; Thu, 29 Feb 2024 01:50:44 +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=1709171446; cv=fail; b=sT0dbTnMjJhrlXPFL8b6S7Gj1ANoQgM5ZKEtp3/UMsCKYgrXilmBwBrxnoRoonybSqYW4mTlUDc5K8QN0PiubfOSdVtQFg+F7/rPtw80S0PnOf8C5CdRfTmi9AX/mOBGFbJmnD+2kr53riRC416eHp6LW1/vOfoOXZmxmnlEAw0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171446; c=relaxed/simple; bh=8iZ6C1Q1kvBanXq+t4ly1UUCidTL95tTgAp90O1/ZWU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=LFtElKaUqg4zbl1BjmMufoMrQquCZ+Z3sqfgvpU0cTBeOTUPeLG3gJ+e4Ave7Afdpe/xaqLuQ6NxXQOzEHlWayhpncDR5YPnFpSQkGK5s5eHdzOsWNxWoPvhyBXNvcfwY7YZVTM7kyTVi1vJroMgCjCGoQuIz0um1zV7crQUzIE= 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=YGhGmd3C; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=HJufbwfE; 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="YGhGmd3C"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="HJufbwfE" 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 41SK9Am6013086; Thu, 29 Feb 2024 01:50:43 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=wbl8l4Z0MXKae8+t1qkGI6PiKlGmmDTsF8XdL6w6O8E=; b=YGhGmd3CTnWQsIurLIpX327WYIiccHTwOj5JC5go65vUbruLlGcTEaAj9+6uQUEB02Vg BDyOvRzn95TBFA1YNliz4B0F2tqkzvSdo51ASormYLvpsM+YfdD8JX80NDWtvUHGCY/P yCGQSHF4O9RDaemRM1yjUa8qVW9RGLwVKhCqIRfx2BhtiUJKgsUsPYdCDBdBLctfW+wT NwjrIeD21xwoS7fD9YMGJu37KCJzfrm7kba3OJeToSmOgC90Ter3/iiQNEP7P5W93s4v QvQBdYDWBW3+s02oz13IuPLxtSP8FTpS1dfrgFist+twSa4v7QdFcBxtWBqgJuRKKIeE 2A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf90vbx54-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:42 +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 41T0GfUT001691; Thu, 29 Feb 2024 01:50:41 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 3wf6w9tbh1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GvEcod3L63Qm5xoYtxHGdZ+ZwNekh3u6UDBJpSZWN9jr0c1bcDHbUkaooIAboWuhOPrFS5+ppvvtjDt+5yTDx9fF3nwpsZnb6G7hLFnPTtO8XWSxVbpkgM9W88/eoUDP3eDgouL5S5YiEF0HgBihNSFeEvScYtR2BOXIoxI2CBM6AcrjiKgZaegsw9xrDaSTIXXieMMG15zW+1N0g+D64TnuPM4SouYDuX1NfYFRSN2S7kEqy3iNd5cRFLcG/tOFrQLDlPla1yYKX6fIZM7Nzwihw9I9fOz0yB+Axt2F9i6fyQlOgekFkWygDj+1TSS8uM8sbBaqS0D64xbgoPlhmw== 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=wbl8l4Z0MXKae8+t1qkGI6PiKlGmmDTsF8XdL6w6O8E=; b=jrit81EBF1Cd3RPEIqXz0LZeLQdc0G0DzEzO3lGC7ppu8dwsi67YLa35qaQlMCFrDceSZKOOMAYmCf5uQR6D69a4GRnb4vjoLElh5nuz1VRW7tm9sOtTObDyMIeYeea0KFcnC/6T9J/4r2A9HgymFNpVMM43vY1VZIogEiBHk4Hp9lVQeQdTauNPMIQiEo8yrITpW/mT6GfzHT9Ak1Mhe5nIB4zZKfjVBoyayfMnb6ncmrsh+cnrQmHXu0qI/s5aWAQ5Oa5EHLPS/MBM94OlO0ivBUlqv7u0+jquY5WA1kc/lj24wqdMuciFPe9/eliLW1LLbvXKJvknnHM31FGZ7w== 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=wbl8l4Z0MXKae8+t1qkGI6PiKlGmmDTsF8XdL6w6O8E=; b=HJufbwfEZZ25CCMhU7a+fYP7Srm1cZO8/73WuZqHEk541dIIhPexw+s9vF2d6kKTGfrduGCueWEWUqHR4g84l2+EtalE1LQcB9Yubjzv5GV/QRXeIXOij3L2wQcGlTs6bstVlnDJcEx2azag7FKLjezr4JnJvDN2vG1dcBTd8/U= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CO6PR10MB5618.namprd10.prod.outlook.com (2603:10b6:303:149::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Thu, 29 Feb 2024 01:50:39 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:50:39 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 04/10] btrfs: verify that subvolume mounts are unaffected by tempfsid Date: Thu, 29 Feb 2024 07:19:21 +0530 Message-ID: <9c7e30b26d07ef53849d780d4c5f3b8d0d88dae2.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0020.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:b8::8) 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_|CO6PR10MB5618:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b99ece9-3afe-434c-069d-08dc38c8d466 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dVBCEA/LLVqVyQZfhpiOa0EfO+j8v9yE+l/f31Cv6XHPe5nXu5RGi7zi2RYQ6VZPmFqc21GJtlHFqZx8rvVqUus4jPlqP8mEaJghVz3niSxg+VvAW0vb2/Gx8ylAG0gltJqlhX9ar3mbs8qNTY/9fdsoJeqTtsTqkuqjqXpPtTI9gZB2ncJEtr0jThRhPfLJOwWtRhmmG8JCymRGDexUnL6ss745Xiw0fdPPyeQleQ5coUeeIbAcyXBMJm4Zc5YzXNeH/Nl1kehzU8B/aJ8w9onGDt6yV0TtzxzMsFmGDsE11GT9NZjTxCzxC5pTXbErDJV2Ig/tskOG0SWRND3I11MPlvOeDtJmbWSTQd8CFtUbnMolRTAd9EN6det+0r2L6/mrbEmdHdl2a9tvkY6xAiVsZe/WmzGaRQPe/b6zo1b/OrPPT0/gH58TwyOSLdabQi3vDbVJPbXKnHsEsF44ZnOxxGHfQFkQ5m3ay7hjG767+WoHHBP71juCxiECS72Rc8LOnfzBqr9rM549jtaxBMXgm4k2Cg9Js3OQqgrXlwKLar10W/rhVVQNlMzlfZ4Wrz+jLZZ3z6YZv1S9AQAOF4/6fvV5SYiJYiivY7N/wZAGNQypDExs7psNB8ydtMl+wZ8AZu56PQ85nfs6KIcD+g== 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: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vposXZfn4pxV723DldW/Pn3XTNctBJ89XCU4yseDmirRCo0ZRwTzrj7yHhN45zeYglmQ5MMKagE4E8qCmUSHv8p1Le2BDe2nekcJq3ALyd/8op5qBB1hegTj4KbTpdzG8Pl9i/86lhCx1OrBDpud3dTlPcpdRh4MK4R7FcQAf7Q/nLmHXElPWYssFXVHx9DKvz0bHv+Kciv/ttq5pfh0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b99ece9-3afe-434c-069d-08dc38c8d466 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:50:39.0873 (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: AT+rR8sOED/Az5rA6y7eHIPHsZKkFAFgKPnsXCjLRFfbqtu9KKjawpTuPk7Ey1L2800ujnAKY3ZfMQrHCfbxkQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5618 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-GUID: gvRNydBcxfhSymCPk1OopD_S8mosQLxn X-Proofpoint-ORIG-GUID: gvRNydBcxfhSymCPk1OopD_S8mosQLxn 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 Signed-off-by: Anand Jain --- tests/btrfs/311 | 87 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/311.out | 24 +++++++++++++ 2 files changed, 111 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..7de8f0512489 --- /dev/null +++ b/tests/btrfs/311 @@ -0,0 +1,87 @@ +#! /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_scratch +_require_btrfs_fs_feature temp_fsid + +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 | _filter_scratch + + $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..4ea46eab3c72 --- /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 'SCRATCH_MNT/subvol' +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Mounting a subvol +Checksum of reflinked files +42d69d1a6d333a7ebdf64792a555e392 SCRATCH_MNT/subvol/foo +42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/311/mnt1/bar +On disk fsid: FSID +Metadata uuid: FSID +Temp fsid: FSID +Tempfsid status: 0 From patchwork Thu Feb 29 01:49:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576402 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 61170364A5; Thu, 29 Feb 2024 01:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171451; cv=fail; b=RXQAdFCk2EXWZDX4tR0WGVf9WNp8b0HmLq5vC93x6Fr7CibJu2P4cJkciLXORRrWPC/bU7Aa0f62KKheN1q6SNhuPo4I1wJrkpN+o7s7Gk0Tp5w1g7+LeKKn48/mkACmILcAbf3tbm7viep/CJynFexR392UdMIQl8tGwDrcVVg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171451; c=relaxed/simple; bh=/pZNnBx4kH3pua3tyjfmfsU4M+DpJirQo1tssCUx9/E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=LVLBXEv8dpqMysLNLJ74arjc4ya9/eLf6qCaatUqezrzFwPKWw1y6jK+cb+2p2vsPngVy0JJMUGs7xxsRIy5/UDEHw2TdcbLIfIpfHjIch0mFQIYfPzCd67OgGEfXLzmYqFPJtw7F3Z5mtmyXczJOuFLFX9KLe/NsjHOZPwFiPc= 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=Ye51VOiC; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=DDovjEdT; 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="Ye51VOiC"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="DDovjEdT" 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 41SK17YJ013144; Thu, 29 Feb 2024 01:50:48 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=R3h4BbyhqSSDCqwJSZyCjzhERA6u6LNIzouBZzSQRZg=; b=Ye51VOiCFDJepy6EZq3UjofyKf6LykIgBhVqp7WVjbF+DnjzwpCp+qnfS8MaYs+BjXHx RDX6Sdh5WCOXIvjFWbFEvwoqXxxjO50jH7v4s0QElm1meRFx2AqrTiTVsE9GagTYsUpB AH1YIIuIWxnt+yrZRtDZmAlZuk4NBga/DaCdSHTy9pFqGFpgiru3xBlxFcJCs2x2xIYc pUTBuuvNvQXpRfNBTLXq/5/U2nogomH3so8ntE0VXw3NVeWLqpnaczQ1bTsCG2vtOtO0 btCF4Lq7YDdZoU33J2sYDdaTRwG7bTwY/o8fb83ETZZMGzyx+CQfcZOxDOgjuGni+cfI mQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf90vbx56-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:47 +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 41T1UwHp015291; Thu, 29 Feb 2024 01:50:47 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2169.outbound.protection.outlook.com [104.47.56.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w9yxxe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d6uVnXJNLTFalmXOnmJGVZ+n531ZZ516zc35pHuRIpM0q+TLjM1qfjUtKCEsoSPDo2xqxFg7Z1WGaILY3IIcGk92znoBLE0HcXWL2F4+tt4rSemT//5ee9h6/WDJOSrWIzXua1ClxgpNIsRz0pOXmvYjq3iff0dwlYfSd0C0tCbfoLkvjiwqk3j5xa9TEwMTmRjQSBaarvRkIp494H7u85FMEyfMUUzE4tEEL58kyWpxqPlpECS8zprCs+UejRkMuwZikKEAcUS9sYNT/j+G04J+xVDhQR2R2HkG8+aMYRR188fvTmVZ1UNRu7wO6fZpdPgz6s1CGAH4PomJsZPlVg== 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=R3h4BbyhqSSDCqwJSZyCjzhERA6u6LNIzouBZzSQRZg=; b=cyDDqbqhqVfN5cGGj9wqevGCrgt/+u1EW8RG47gKitGsCBNzz+G9R1LVrXUyy11fd6ge4ycGN4/Wby67nkLQKYiXzowNIrYpoDrBm35/5V5NgiekLQYcLaw5yzwGq5wt85hXv5are6g2Uvg9HAD9hTz2xovgWH8PNVHhiX8yXX9kHLObgV+//nizzsTOtmNOQONTtyE1PvTNFUSZyb+O6+dkSljVOLE5N/S4kqse1HqmhEgW0DzIM/gc5mx07Q3zHW5RvkJB78221OjHpxG3WgbvpVMZiIVCzG+/nG1sayWfy6X9Ub5Ly3jPO1GWF0kDk30e0fp4X0Oa9tHu7aJdww== 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=R3h4BbyhqSSDCqwJSZyCjzhERA6u6LNIzouBZzSQRZg=; b=DDovjEdTetgXWBgVgsGAeNKgZXJpUXGEAj+MPfkqZN8iSwt3z5CtoFAmrwS2G32m1Deuslktg3GNbs9LV8XLAIBT1HQGXpwnlZU6eifjyc9ha3NXVyCdnp4aLyUurohmbS+y8zKZTinQCrjNq2MV4uTGRf8HerpYfu3fGxOUG+M= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CO6PR10MB5618.namprd10.prod.outlook.com (2603:10b6:303:149::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Thu, 29 Feb 2024 01:50:45 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:50:45 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 05/10] btrfs: check if cloned device mounts with tempfsid Date: Thu, 29 Feb 2024 07:19:22 +0530 Message-ID: <377e9a27befd2d4b7f771f082ffafe57876d7cce.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA0PR01CA0022.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:b8::7) 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_|CO6PR10MB5618:EE_ X-MS-Office365-Filtering-Correlation-Id: ef81225f-6a24-48df-38ba-08dc38c8d818 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yoa/wWALSKuCD+BANZKGh9FxtdpG/7A8sYUdTR/i07ARB5f1xL83vFpO9AZNmzHaUK8+RTEoG4v+fekI4EnRJkkt17O98aloH6DmI5por2w+vk+Y6dfsOUz7z/pMwJxVR/rTBCVQRuTtDZQxdbsbgOxmkClQ9o/czJWS2AeDoqOnfWUZauHiwJTPnlIFFc+1m/DgmDJ4S4XsdonM24lPjlnA5ufP5aERB458H5n1YbfxTM9gqjzsyGOiGTc8aPdewLLB1cDLvjJIFJRHDFASqA0buyc58YRaWMl5DBmsLACNV2H58M1Seqjo5uyza8y6HarZgZbQNV766sEDRWAbyFV1f2AodpHLX/94k8Ykrntobzv54MUVt3vzkdUWnCZLm3EcjBz0QyR1h8lcGqkhd09h90ZYfPGqCkImLBDty/ZAY5LZYl0Ls4D0Mu1Y0xu/egHeQEXzOxST2Ni85JHvZABQ2bWmP8JfK5hn7phhfXoBlB//arEi8eSec0MludzVy1CiUfu3US9iGXqTGZ24/ctpo1X89tzRCOLUhCyrABInWXTcVLPC5OS+DMHvs5rMzIc2MMvtyXB86Fl2qCT5pBN+sixDJkzpGvHj4ILoIFNAfk+q3CMLkJ+x0PtlfBDv 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: rG6Tvqk9Z975mkc/iVBuWgNH1FAHIryK+yZACV6XTd2zD7DRosjnwfng07dr8asaYtFvapHsS8f/ZqnmGTw5aaX76a8QoWfT7q0AgYC8XpJTs58ejMwHXHcWwshxWaFOAesSfvGZjslswmTFTWfduPn/+PRpqHKBozi6x+S0Y52Ka0ubuVX3uSuoNYDK72yn52nF1gJb5oaUTfCBsNbijjZnJJisp450A8QD8glMasKqd1HI2e7I/1SItykliJCUa0NoTVQZbb75X7UGPjN/iM4csbDFObxsmVdcwcWhZExVYtjYueg+cNIYVB7PTYP8NkBmqT82jLjwKjipEnQK1L1+BYG07rP0poVCjdeV7YT7/vWGyVnA0fmOFSbT4FaiiB1AA+qXjHCOQ9d/DlNR1yJjFRF7L2Uy42eCUPRZknhDuu6G5Ji/wtld9zjjIC1YiOR063pLtMRJIVB7NAZiv8vM6JJjQp+ygb+xjeayHnTZvxExFYN9waREIaenkglEMfh2ueY+ClknYXS+egeb3QL/f7MCch7oN954fRR1I73dpqsCr999fWrpLY4HmH0jsdjgSiN/7/Fz2rDjpDoBXSnhGuuwAmoSodh8kWn1Yrb/fOByOldQzZc1sJKfJ4i8R/xkusFrJIqzHnympsDfOUFURuNaupyJEKSXJvzmdzy/o9mbWJlubyvAiFaSu9wvqMVnYGfbxZEGyiYPpUudNR3pN+DLvFJoKimAoSV5RqbcXX1wCnoTJAcQo1rzC+X2/n9EgK99scl81RIMpYPh6c1x75eTPLoYx1DFI0Qi4kJndGVaC/wQDnJV7w95df4azUHxYuAWgxv4eUpSq5JRYT6rTbOImaBpe9OxTtTSK9MfssPqqa7c8Z0h079qiS9kZTI4QzxbEJpAdVKK2+cp0cZgpROCZZKXtJw7ewwrpp0F/hCd2NPv9ElD0ekWlBhs/aaNbXlweK5vCDOsqIC550OMpu+tj60T2unPNvTlqudx6Vf+Z6U8cDDsF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/N/JB9sHXubWWkrAaTyloqO5Jyq4ymOU4Ud1J/LNOTJ5FyksmzR7biJL+P2MB00xiV7Mwx0LQm8xIT3LZGVrVB1SAMOYBzWFggn34IE9fKDNY/RnVQVH/k3lrC+Syr5jFXFQ+wUC/KI4zHC6ED+oRyiJZrPq35Ul8VvLggKe5NaFn4zuA9f/8DRSNJSYf8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef81225f-6a24-48df-38ba-08dc38c8d818 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:50:45.3042 (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: XzlmZoq5GgF140e12yn29DptC+b0WehGjDbzgbDkyldOrpAeWNMHDXWilCSj1kWACss7DWuuOZl5MnXm5su3fQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6PR10MB5618 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-GUID: Ut2u00598gnwyTyC1w0Kt29ugnaTceHb X-Proofpoint-ORIG-GUID: Ut2u00598gnwyTyC1w0Kt29ugnaTceHb 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 Reviewed-by: Filipe Manana --- tests/btrfs/312 | 78 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/312.out | 19 +++++++++++ 2 files changed, 97 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..eedcf11a2308 --- /dev/null +++ b/tests/btrfs/312 @@ -0,0 +1,78 @@ +#! /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 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_scratch_dev_pool 2 +_scratch_dev_pool_get 2 +_require_btrfs_fs_feature temp_fsid + +mnt1=$TEST_DIR/$seq/mnt1 +mkdir -p $mnt1 + +create_cloned_devices() +{ + local dev1=$1 + local dev2=$2 + + 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() +{ + 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 Thu Feb 29 01:49:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576403 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 8B935364A0; Thu, 29 Feb 2024 01:50:56 +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=1709171458; cv=fail; b=JPVTkFPTBKzu1QhopGacIl72fzVMIFv0n4UkQQQ5AcLd/Fn1MXb7mMIMwDCG5x2pbVhz+R0v+2hKEHiL7oIFWthlE4eyGZhmhpm1G1qJk4qnydIyfsxhN/hztUFNG2QoNUc7kv3kdRjF00gincVCIQfZaucxVMAbwPY5N+9qaXU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171458; c=relaxed/simple; bh=qtjpiAWd7r3zjFOm6VEriebIS6Pt0SvD2kt7jygLTx8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=RlHa/CxxVWh08P4au4yvXwZowR0t9AcaxgU+UrW/d8rAsg3i49n7ttu2TaIEVs15H5LyETLlSsboZuQGu+Qidl5qKczHW8NEgUlNrBMacdKAHkZFeXspREWt2Mvrf4Vwcm+vZ+3WnZD/5ytPYCnCKjmIxLFDRUuNzGal0mJ6JPQ= 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=M4itmRKi; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=WgFfHMwx; 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="M4itmRKi"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="WgFfHMwx" 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 41SK42Nu017707; Thu, 29 Feb 2024 01:50:53 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=xwl5Pe9POUO0Vm5iZNSgZmIhbqQnvQLus571DNrqcPo=; b=M4itmRKi54nH2gee4xIr3fBaCVAXSPIJJns58I43eC0vQW4RRC9NnM8MmskqHxVCU3hV ww3MgYWxySlO7E8AMBjQuXxUQbpl4izeJktdgrte9MXUpxKl5rUW/DC7EohfiHKhLVaA 0jHpONqgl/HbnUJr7+5AmR9kqO/HPobeij7hAeeqQjVHd6Wf/zMuHePj98mCDMeoWgme PunzBOEcRkemndkaG1GENbc1REp+Bi3FVJnHrz+ABAjQxWNWKmqArjkmn1uA+typybIx ov3b0LWRmp6MDNhTAKC7IzYo7/BBz+m4CItpwqlEAKymvp8lhNjMCrJscmndFoVELrhK LQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf8gdm724-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:53 +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 41T0ZlgI019390; Thu, 29 Feb 2024 01:50:52 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 3wgbdnmen1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l2D8cTscXrZX35xzeic4y8oZXl6EIVPHtaenNOZ9+Io+wYQbg2vA9RostBXAZOgEfHFUcquBm5DSACtMXmRPDvx2CsuXHlEK0QVAOrrBhHpdDksxHelS5NnSKX6cf6ROPIsKR4Yuq+TXP4HFEMJD4XUEqODXVArucbfd0t/32XbYZR9fl3/HommUxHFFw5aOs47fb6drNUUaOsyHudNflYP6eCyufKQZqxZbaCs1wnID8R5NldZrAVb6qomKn7BurOhRKe54FNS1G2/dgVQ2XERvuxp7vxs7tf8CHUhm5lV6Eyro/k487KJ7SU9bKdxEMkbsK47M342Y8v9qWVD0Cg== 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=xwl5Pe9POUO0Vm5iZNSgZmIhbqQnvQLus571DNrqcPo=; b=Vql/H4XDRcY9/dmCOzT3pXU3Xsu9R2RjnJuagGA6be1mOIwa0Vzccqvyib37DFzjGtFkvRzLR728eU6hM8cs7YLODSiYcH4cN/B6DLZ8fAk2kjuH3PlV9jK1/SM5H0gKTfxVT5uGU6CK+ZXtUYmpxvlXr4URCkhMtlwKA+a3z3ThGVsf8KBtG6r2jnPcrgHds4doKRvJMp4sMBQzXAO90bNt8iXSuOXi7E00D3jyGSNRLDMJx9s8vhNsrPsFxKdInkUTbveAJMWY16/Xe3bRUCkQd2eNSQK/4Fny4DtO3tlBtwuhEvlggVwY5m0AfrLG8RuE1UL6SEuFhx1CTgDflg== 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=xwl5Pe9POUO0Vm5iZNSgZmIhbqQnvQLus571DNrqcPo=; b=WgFfHMwxjniEwS+M5vUjdEWJI7hYdIt+lvs3XwlC+hoifOaFUcEMKfAIbPHQPFMbRDPlH8aJhUyzt/XnoeXtA4wEjtRRpvfY8Cl8WTsFpHOVVsYKH7UpzQGw9g4ktrkJ4pXJA7EJ7G7m5zENiRQz7AcJxezEe2rYYO9EY7N1wF4= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY5PR10MB6239.namprd10.prod.outlook.com (2603:10b6:930:41::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Thu, 29 Feb 2024 01:50:51 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:50:51 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 06/10] btrfs: test case prerequisite _require_btrfs_mkfs_uuid_option Date: Thu, 29 Feb 2024 07:19:23 +0530 Message-ID: <773b7278b53dce51f6d0a797f9ffa1b3efdefe50.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA1P287CA0017.INDP287.PROD.OUTLOOK.COM (2603:1096:a00:35::36) 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_|CY5PR10MB6239:EE_ X-MS-Office365-Filtering-Correlation-Id: 45969a73-6ffd-4940-3099-08dc38c8db9e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eqgd6uKM6SRbcetcW0jyihSt8WlH7kCZLrDFArIq/ZO47F3CiQNF7wFXvYTskPX9CEVRgQhHRztGUoenQFzUnHTJVxUn7vimqlWltAke+hTid8EjcrxGoowzIledinWwDypVs0pwIK3YOTaxqX2mZc2YUMSCf8gbfriG7aVNUoh+Sy2lYQ1bsMTzyfNQIjCSAqKHghI8yZlWfFr0S7cikAj7BxWVSUVjtTvwqgzHS2iExrTIE4y/LtxSH0VCbGp5yZD9Am1VjugiDHwt33rocXPmfuTJiQ02yEmxPj8NWUyzBCyjl3gYAV6pJsnslTQISEc04T8qh1tjpF9t8wQ2No5ySa91rmEgHpHOn/U+/v/mAyR5c2zikORpmpIOidwpAXOMefQGXeAQzO1R5zyx7Ocmchdf0ec2DxAoJZ/IxMeXny5i2YvIs4K/ZfW176BnKrBNEpABUmlzMt+Lf5k8MS3QRmBKbs8k09YXhSp0B1vm6xLHXopeY+kv+GcjUhMWE4vTtcmrJaZusl0bkJlM3w5RQ3SIT5hyYrgY3Q4VtcyQPG2krGV3kxL1/nVy9z4/0XH7HckkbyYNRj2K7rW634Z+XTgHXmhIqL1qYEy6SSwtm4smVToujts3LlzdWe0+rWIuI0I6omi31kTCughF1g== 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: HyuQcG64V5HVCLPKWeoLx+D69aroMMLi0+iYByr9HqTbWCDVEsLvivIwRgcDUv3osAiIzePyPfJGX93zS6yTJ/VQnJDJ9j45EL2wyFZlBnGQ6tl95pCyvDIczfWxZVPlz5hhsX3ydlzcxU5y1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NKmP6SICc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45969a73-6ffd-4940-3099-08dc38c8db9e X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:50:50.9858 (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: FL23pwhnH9hqDIwHZ3Cs9Nu5A1lG2lSTakHFURCiSXmjSsnGN324k2RhG/BjW7uA85fo44zvISS48/bQpu1f2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6239 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 mlxscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-ORIG-GUID: WPfQOI95quOJ6VaYEM8NoPtduPW6Y7qS X-Proofpoint-GUID: WPfQOI95quOJ6VaYEM8NoPtduPW6Y7qS 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 --- common/btrfs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/btrfs b/common/btrfs index 5dd0f705fd90..fe6fc2196e68 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 Thu Feb 29 01:49:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576404 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 10C3736B0D; Thu, 29 Feb 2024 01:51:01 +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=1709171463; cv=fail; b=eryJgcrBjpTCgVwSzP6naRg3LF8E+2bir2H2zhpRCBXpStHzvsiXMDZsAFyOwNo0CEwkffJ7GBO+uBo2WE/2zBPCoT6nX+1lrsN6z/UkBBSql6ehQeW8cTJXTl3Z9ZXnP8KWsgnhwZwjtJLCh89u6Nxka8bjkxqTyps5m3vzzYg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171463; c=relaxed/simple; bh=Dm+579C7KVexMNWIl6eabPdlXwxknZFjXfkpKHSfmXk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=avR9E/ipYIOYIgEWj8uwRbmA2PMd2UglayKxOIgbkKQY9vE3A9/GEd8j6Q5nEBEB9HxAqDvmz7Jl7HABt8gSr+aHn+AwRMkQZTLAZojdUxUNlxKxzvGec80mgLdqPGmZQWS2kvSTRJxN5hY6aBJPsiFqiyYTDL+E9uMptOBJogw= 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=aUPpdA5s; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=mDoG1dWf; 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="aUPpdA5s"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="mDoG1dWf" 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 41SKItRu012815; Thu, 29 Feb 2024 01:50:59 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=YruqHZWPVJrC0A8PB8HoDBpCNCAsHT3SNxgFBMGGS10=; b=aUPpdA5sm7bSgqrQQ41vlOyLvStNVi5JzG4Aw6NHlZ6KlLBGgUJ7QEH80uFVYPmBikyz GgeK4Dt6v8vF8TdUjWgwqtHEYvkqYI4tLz9KPrR9Qbj4gw1eiJ2YRo+rR7ggVYAygrmm A2MMfK0sJ46fFMQigr/0/wVMacjHJnS2YIkW5Uf+zYuE0A/WgIzXim9RA2goMOyCphPh An7S0kucAIG+N/EpXWiDMqsS3VllwY0LuRfwtZ0puGTRnOI0pearqEbn76y8kwynmeAH ZpSW8Q52hyCXmXyq2TmIxnXBMlkMf/GxLqN+AibvHrBZCLp7QYQWFd1FUDmns+CzlSpZ CQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf784m5jf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:59 +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 41T0sjNd001682; Thu, 29 Feb 2024 01:50:58 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w9tbu5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:50:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cSWb3l0Kh0SNXtuA0iKxp2Kl39DBb5JfJ77oBJ5PCHofNI7QAT0Ff0NOJgxLxgjHlE8Mpds6toNmPBq2RiF5NDzATlOer9SXdzWKnb1n+MjItHCUtacysXOQHoLqpsQ+wqQZnebZJdgP5UbdadaEzKLyXZx4NUjP7gw/Jn0K2JmJh7hzJzWsSUis2WM01J+jV819TliJ0BWgdZprQnwc4C4II5aczux88iGLQ/sfBiAwslR5wbmOWTrec/k4RQtoCRqDwO9PCtzZdwIsQuDFn5r1BQrZD+HmM/N4xO+LiJuHklU4It8WNUC7+u0ZU79WD+bvnnb3evruKgziDl2cLQ== 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=YruqHZWPVJrC0A8PB8HoDBpCNCAsHT3SNxgFBMGGS10=; b=Jjaw/Oea7PDMsDOUXz+AOiv7C78u2+KCPKoBDopeIyUevFywEgbQ3FSnIZKbsdDDL5M/U2aScTYXGDJ5LPFzR6onfUsq+oWgpCir1FUlyRAkJIIajdf3TVSKN8vPgmasWhLYXEEdniHozX0br61F7PXXNqSm49wSsRq7bh9lchczGeAzEDWec/ndcIWIOqjNITVeUnFVJELSyUKF4Nt0oTedD1Vv+/wWsyZ5Tpql26paneDNLLSBeMwyArdigFtZt6y1PNS9KFjlP8xoSviFKWZh1tPAcCqREQlUQIU3mpHApmlRUVpZXgDl+4jvy63ADpBoRw5yw9yHp08kt9mrdQ== 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=YruqHZWPVJrC0A8PB8HoDBpCNCAsHT3SNxgFBMGGS10=; b=mDoG1dWf6THR1igCrw57e1r3ItN10BuCgjVmnfCwDhjbdtFaF77Ry9uVubjhed+sva/C0XflqbWeZKsGpMCYJ5AJwhLXk8jPXUrn97LAfvriZNOwYK9FXVIKrnV1MKIHMLsV8Xk14s/gFwmZBjPECngZkcOpbea4YPUdq803GMg= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY5PR10MB6239.namprd10.prod.outlook.com (2603:10b6:930:41::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Thu, 29 Feb 2024 01:50:56 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:50:56 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 07/10] btrfs: introduce helper for creating cloned devices with mkfs Date: Thu, 29 Feb 2024 07:19:24 +0530 Message-ID: <75f514c0b05e138c5fb03921c25a8309ce9a3c33.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA1P287CA0018.INDP287.PROD.OUTLOOK.COM (2603:1096:a00:35::27) 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_|CY5PR10MB6239:EE_ X-MS-Office365-Filtering-Correlation-Id: addcff67-faaa-4f17-c964-08dc38c8df0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qn4XYsKLsquRUrW6diIl6coDmsHxqxnwZaFGO94DiBAu/iBb39AwkncAvyWKT1JR1VAlSZ+852tW3pyNWXo24+Z60Be0UAm5lL0vAIN2rIlkbYhkFQA/wcEf0WZD0Ce6nDhB7R7esnmaQb1K2mnBWZbWjb2CvT50+3dO/YEmW4Qfwl2S7cIwrLLouqAxy36yQPlYdhUFBPeSX3yB1rXuFluwfH5jKdNYw7Tpnp8vG6yVp0IPliQAkTdO56XEGumARazcI5teg/Nqd+OrDMD4msorV4m4X1jfG0wwZwgIwWOnEU3vGIpHwez1RDs45cIc49nfsmWSVfgcGsJslhC7VfqSfm9OT+4IOLYrO3/81l2Prgx/R1DA//O4tOXAHc8RQrhDEGr7SUezQ/QnJcJiWaj9IwZ63nndPQKRX+evC5PQFORZYsn1q1KbaP14zwwIFFOhie6sJHXWBMdeIh+Oxin3+mE8Usor2kXDngzuPeBQnQh/PLR9DOLtKjV/N8kPpVf+yR3OsEeisGyJYv4MQcHKzVs5IqKiBfq/Bu+tcqHH0cqaESf1zDahg2EtC/uI52aEoIkL3jPOwgqobhqIOMxAOiaAqmIKay/CaFR7nEJVMpGI/9fSUqOcGfZQZLI5kQAa85bObNEvPaUsHSV9vg== 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: 8XouLesMN13duaM37RYTq3oKpGcStfd4Vh1c/DxwZ9ukmsJ6cZZmzEjs9zkgTjjDVdapfIHT/G+G+SMVDnNvL5nT9VyGQMbyRypdkocPHCmWrUIF7QJLrVp+nVGKVw9s2E9PPrFD71/DyIhoOT6m3bGSMOdQgLlnPDbWRPju1p/eEblGlONEvNO8SHBzG0zxPoKe4vUBKWQ34MaLXHighTp/WANnJczTsxSyssHl73cXbgil9nbPe/lOrqo8Oh+Gryr2LuWxO/T1K6Z4tKZ9rzYRo7XY7HUeZ/1W/ZUF2OWJWrgQUdut4RewAN+RSt5isZmMXCFkiHD49UsPdpIcv1uwSszquimj7gmnnwR8Yp5KKFYxwnoFQ2yUlDAuEdVxvmbotaEPtm/OLBppSyyetsdx9mXGp0R4URgpUcFfdt1lnIV+yPJ55NW7xjryIcQ9rsl/KTdOCClXe/mmh0pJOtk/mgxyYwBhnxWg3/jX4IPR9sfubDdiMw9uzEHaBqNsnBcdOhAUXSIpuNlVziwAeaNOLYC7ITdDtllW9/gAzadvKTp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1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: An+9t4EgUoIV2gytLsxRDA+a3v7flAmTgIr2tV4ujoPqWIydMJAoi1vF6H6FdJInuRtdXK4ZE/xWb/Vr8WTERdvULArL1m6hvd5kbjq6LWALM0tnMnB7vlUP0jYWkSpx4DmETn7kgMjWJTTfHnlSeGWxGU5LBOw/JLICldazi94vtZKnfARWKYYqWoxL4aT1ure6GpzbHYgiuCb5hplSVRe0b98o+h1yTPt1gK/YbtHfKgzjAC1chLbHRfnKtOKN93MgcfsLHtoIaNRbf2kORB5D5/wogR70BX7rHM8yB7iERGHmjuInnOagtKVbxVUT86wBWlSCn/ud2cUDtf8MGbSg4dxa9FDNuuBuiKl/mJZdr1/v9oDtIVgUDuR3N7DYFLQzEF3MlFeHBUVScA7LKlOIGm4SbFbXYc/SCnhXU3itfhd1VBXj+xIR88lkvTCBSaCEsoZ+YqKTeUM81w3cZJUt/GFfjt8CWB0MvEc4b1tfb4/tYWKc3Wdx7eezEJ9t5BGUwQC2yW0wXrxmvb7ytkj17S1VdIJDa4U7fvPq4IYETQl9x53f4HTgNtKglzXiFgP5W0Okaoz9YPaxkJsEIAGKfiJuy9cjdtbL34UF5hM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: addcff67-faaa-4f17-c964-08dc38c8df0f X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:50:56.7562 (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: nlydmqEb58uGgQ5FuA6CtMfqdblskzfxK2mNMHUI0OL6bSY7dI9zAg7Kf7L6vuozHje/A04+8nfQt7cDmRr7dA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6239 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-GUID: KJIfKkKjABdI7bjkgieN9OSxZLYFymfB X-Proofpoint-ORIG-GUID: KJIfKkKjABdI7bjkgieN9OSxZLYFymfB Use newer mkfs.btrfs option to generate two cloned devices, used in test cases. Signed-off-by: Anand Jain Reviewed-by: Filipe Manana --- common/btrfs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/common/btrfs b/common/btrfs index fe6fc2196e68..7141a0bb7b78 100644 --- a/common/btrfs +++ b/common/btrfs @@ -843,3 +843,26 @@ 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 + + _require_btrfs_command inspect-internal dump-super + _require_btrfs_mkfs_uuid_option + + [[ -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 +} From patchwork Thu Feb 29 01:49:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576405 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 2953337155; Thu, 29 Feb 2024 01:51: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=1709171471; cv=fail; b=UunBnmG9+UC1q8g9vVoyE2mHHVTNeQPVd08hWSy0wTON6mQ3fQDZR8w997qj8GY2l9+6/1x0abJsQoMDnlLMpXLzFW0lMAyto086Aq86y+4BuQlFiJnW949HNrJM1gBWMdOs6vV+uhlNfIo43J+ge8sE4Ct9ieCzwTs2wFajECc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171471; c=relaxed/simple; bh=EDrBnfzCSjNLK9BFR5Lgsd/3M04h9MgGiFh2XkC7W3E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=KEvaHmlYJAgQDXWeocz0LdNfHVzNRXeLjvfpLEyWD40bLqRGlUZyQIjYn7hW49WDvqJPAjCdNCR0Y5vfpqNMzh1+0nShI8wMMYUFjb0nZtgPBQcaLKbVS4NKN7jvfgpqKQYf5uSNiyOUxSq7iZsg+h/JHzpNYzCGkC1f2ogh3x4= 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=O9UqZ6p+; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=pLUqZWzP; 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="O9UqZ6p+"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="pLUqZWzP" 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 41SLJjWE016491; Thu, 29 Feb 2024 01:51:05 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=VierwXjWT0IYdahEerV/dH1etyBy/Q8DniUIZbaet+Q=; b=O9UqZ6p+p3WA0RleNJ07H1E9B7K0XlBymbR4MRG2dmje/0v640i4W8wkNfDZRK/2eWVQ yEN6WUiyBhRVFuCAIbMCaZxbuOOYdBVUUndvQs9OXKA1jGOpvH2WFS16p1nHS8j1Ql8h Gb6p5GWHFh1N2wQ0lkQPJKOz+weIaKy0OVrIV1ZuzSLx0SA65QyAG9SWM6CVksRfpMYB v/MACYbjxfyTts2bsrSIb56RZ/VcNf02bRTSx2ByqCKg2QL/2uk8Z9N46iiNXll6yz3T CodRrYb6ao6s9MzvKMBgV/j42qWQZgYDu3OzXZtLJgM9HBT5PsBk0M5nXUr8W4HItodi nw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf82ubm83-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:51:05 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41T0etME022403; Thu, 29 Feb 2024 01:51:04 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6wa4fyc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:51:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UCJvZYdtvUn1lGInVhimylEjm75QknmFpoz/cqNR3E18hTh1/vr9PHn5Dtp6ceySY95fa4pUXqGkvLOMvdTWGHsiH5YXp5PjRRw7ETgcDyw3yHM2I4o0lFH9xy5zBoho+m86LW0S22h6VeiwD4KBx1bDmaKW7QXyAiS+0gxI7WWnu+hzxf/wEkjyXVEOy8rc6Amc6cqDMu3Pnu8K3HOR3izb1vNvEQ6qH/f6wB86nwv+br0yFYLDtq0vQ+jg9Lxq0c4KCOX4IzdTxboaPYaLUumUFMnHikw3tOdzplUOEPQIUpL47hdJo9dw+n416lL8gcYdfXOlowTnqcQzwwQN9A== 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=VierwXjWT0IYdahEerV/dH1etyBy/Q8DniUIZbaet+Q=; b=Gg00m2B9JiRs32/QT/M0tu16uE+TRaXcGfy7S3OK+YNlLG7tHkB37bDEsF9AdfCtlL2DHbsFf0+e8yQEZFFCaiWLwknIO7h1wx7FH5wT1N+v/hLbXGYmm++YVMPyjBe+6cinjxDvHL671MULPMMpxWw8Ssv4VTkcjdKKDunmNbFWOXi9JJPVf9s1PwiH0F95Jxx1JWY04zBKpYt6gp8xtNLyw/1DHni6iRjJFo6G1hcsItXe/D8kNH5p+aV2a/z0gJhwye9m5gZWvCmqVjI4K8V9/NntBiTnwMsjBlDCBea+B6w0grcdy3qQuSglMumU/qsVKVUPaokSRbIl3iu/OQ== 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=VierwXjWT0IYdahEerV/dH1etyBy/Q8DniUIZbaet+Q=; b=pLUqZWzPdhwflnMQlx67Yfad0x5lq56cU8uQVOaK5Kjfpkc+fP/moTFZv4kyeN82Q4fQIXqY4IbG5rugcmdrYga1XHn/4AYA2LYrBb47JVFoz/GjHkKPmYoKONR/nnQfaZ+n98s7n7TStEFj0nvpI8ipCmQV/iGXAa31LhLA27E= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY5PR10MB6239.namprd10.prod.outlook.com (2603:10b6:930:41::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Thu, 29 Feb 2024 01:51:02 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:51:02 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 08/10] btrfs: verify tempfsid clones using mkfs Date: Thu, 29 Feb 2024 07:19:25 +0530 Message-ID: <343786d75315f45e2bdd8cfb94d5bbf520f3df94.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA1P287CA0001.INDP287.PROD.OUTLOOK.COM (2603:1096:a00:35::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_|CY5PR10MB6239:EE_ X-MS-Office365-Filtering-Correlation-Id: 15709fdc-fdf3-45ee-8f02-08dc38c8e263 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vK/b0Q901gkNzGy60mCbSLJNRNFt4BsIf5ig6553WbmbtzYG4Zx6rhSji1Zt7PTfppjLiJqINK/Ao/iRwyT34plF+ryYUIAmvyz7E04490mPhBZguVzuE2GQgGK/YDJz7zQ74AwsOnoxc9X8Es2DtsgaK24BRxhl2Kl5ZX8BEMItGzhwy5skpbx0MsPY83p5em2Q5qRwwaXfaa3MD6q2/GOTjw4xOSDo5JnWsjcMLWjqs2Sv2DkpPQDhCtXcj0AXPrVgEjlZoiqVs8Hvb8XjnNQGqreBz96hG3R+lOAPoDVScr/7n/k2OJJE1g45+sAJJI/9Wed9/iQwiE0zP3b6AouI83ZqboQlSYRNvIRiXwLEjPkpxo4JrjJWDsj22t9znJGX5v1IX9Hgai0FEyFOJhp1IxiHHXESJy7O465v3Qyefjt/HWV72Rax8hL+GRZ81UjQ0Civ25rWT/OsBcyWVwTRwsfTYb0Si2b8BwupsTdPB801yLiv7uADIy0es+sCbspqvDRNJMm3/j5X59OZ53MdUxyM1rvVtq56sgGgPqzo1ukgZuuXeevhQ9FVzOod1fLLAY5A4hPg3gUCjEWIaB0OMx1uUu/S8LSF5BbB/hdkFJAXfBUVYgmqZ9L9B0R/ad1Q2hZUEFpeBOrhAgqNEg== 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: LsGc3d5cgEfPZQExXiK6zccta/OcIvSXQGf4iDAnuHczgxqkzliC6BPha/JRnr0BnCoUe/+ojZ8O/O3cLXEG88Du5JFAIWfCeuE4khERtoX1qLxQ7vn41IO1Yx9dSVBSiDfqpLuNiGVDo0N3rW4d/AR4JyQnLgguG1Htvdfs7KV3IGhOGin3uqt45Nnh4iGoZEwb8DFKEPYx0J0aJwjud3d3zk2wfWLSWUwmYqEWlY42NdY+6eiQeDTVdWv5itsKUburHGErr8b4aTAKzndHlt9rh4Jc/v0e3MlcTX1VTaX+gf571Eh6OB65WE5Q49GlZKK9n5d942ZjOq5ZBRanXBvAqxa0U52uGFYZuoSbDVvKJmsMguJNgD4cST0QfchlgaID8ecGNmXVZM3z8QyQQ7yiI/L0ybW1Vv6iTQXWJT2pnb9CNrFdQi//JZl1PKfc9E568efLC4FRbEtFPHFygiYN1csWuEKgrZZ8mEIqMvk/xZMbciGRR/YkVzs4hrGhXMkLwYSdYBkec2l7/kFV0XzRJxhiFvALy1zgK/ExGUQUq5uRaBN5aOB/snLMAXhS0esXRznkrlIAToo5ejXTfWdFf/vzsKmAgk+x070Xhf5z/GIAiBtas+BBGnxQduVVWhh+TrPuT7QMQ+m6vxA4y/URztQal70DNarALEjaamJX06XyV8Sfbnev61Hb+19TcS3r6ip22zgKWKpE0h3YEzp3wi4OMbjBADMlhRUDmUwJGGvtcIlm/ncihq4DrYKaYyJI4hGheShG1qZrvIsv7e1JMjbIoyqpQXx7J2EhPQqUzZWaw83YVtbzSTqxQKa0+ysyBzYNjcXRN1HStiKCaUvrKab5FjJxOOjM6NJ9TGn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yAjO6Oi7gAvk4D8RGYsa/ZCsQm8X0lWXOXj8ItgvOjS3k/8zbQHLIwmRjIhFB1E6LNmDwriFOINoN2V9ckObErOdmF/y3Cm2KinDIwoZi5MHHIX864VoX92TW7jo2zr/pnk0JKNOeNhuQlRu+tkjYtzMN/xHFU4oQ3um0xsI3rl7iaMXb1qvRTy5HVGsGSZl3Hs+U1rO/ncVD0FFgZJENVqTQ+meVOFCUl5J81bNoXxVAa+trz0nehSYtcxdgqkb3L+6xS4KYfE3JOCK+Pna0LL3SyhWrpuFXE10dA8L7TyOIGTqZWaKiAuKIbQR+ekO354OjXYRwkwuI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15709fdc-fdf3-45ee-8f02-08dc38c8e263 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:51:02.7921 (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: Ls7YzXhEtI6VQhFrRE/EsmI0BaULe0O0C06t/IicqmCtILP981Wh6xxwGTDie6is0GlAEP0w5y8mB8uavPborg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6239 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-GUID: pB5XJUY-ibaJHcczV2YYj466U-AdRhtP X-Proofpoint-ORIG-GUID: pB5XJUY-ibaJHcczV2YYj466U-AdRhtP Create appearing to be a clone using the mkfs.btrfs option and test if the tempfsid is active. Signed-off-by: Anand Jain Reviewed-by: Filipe Manana --- tests/btrfs/313 | 52 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/313.out | 16 ++++++++++++++ 2 files changed, 68 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..5b8062f4f71a --- /dev/null +++ b/tests/btrfs/313 @@ -0,0 +1,52 @@ +#! /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_scratch_dev_pool 2 +_require_btrfs_fs_feature temp_fsid + +_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 Thu Feb 29 01:49:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576406 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 E1B5A374D3; Thu, 29 Feb 2024 01:51:14 +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=1709171476; cv=fail; b=DVqEIj+PjrUqcuIj8b5rm+cNZm7HrgK/xBrVy156WS+3T24nAUjvD46yIJ3P5Xf+Mh/4oeon7+DPdd8k1XlHcBz5I3yNmKdHUeKxJUJgR7GP8mu/PZlJh41euftsL04YvAntja13hLPArriI7U7497urvw2BQAHzzEXW/skcOs0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171476; c=relaxed/simple; bh=kxX2EdcycW/IxGQgHyGj4mVA0n28OHEZ+y/ZN5BfLz8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=OZBQTTQVNV7bBQVbckg0k9bxVW3A5S+waPIDO6oD0XJV51ctyqqQGdLziLyGV0dFWtnL4aW4mOQC+EtGNhDovkIUKfq41zRBU1JMmbr90lNS+UWIMO9ImDOGCTsr/536xZUzorwz9FE9AOW6gWXExTOkKVvOQeWfbROevmOYCpQ= 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=GIdtsDMU; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Vu0Jlb0L; 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="GIdtsDMU"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Vu0Jlb0L" 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 41SLGSPp016470; Thu, 29 Feb 2024 01:51:12 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=oa4mhEhbesYuJEaYhpui/gMZPuGxJwkSWrvfwo7PT54=; b=GIdtsDMUqmAb/78OOscX1j+tSyvPJkxFFiMyY1XLoPiEj1BVF+ThxIXuHrnuaBdFcsJ1 8KEF67OysxM912FgXiVpmSfLI2tEz6Pk0orCHv5O2JYB4iSr5VSvn5Dc+5Llxltxhap6 s5JuPp2knYfQ26p7w2vR9kzGHJnd0TBF5wEwCedIy5Q3ZRQCfVrb/BhbX2LmP4noidTV pYHMhiZUlsUbsqSj3giY6xIb0b77YuDIt4oRqioU9UV2AfcCgbcRgVd9GwrQQvBtQURN kJ8ItsKpSvnvjS/vQLijoWiLUGcPiFpdnyeaX4vA97cwaXqq5F+6Dle7+7ZljJTP1EdB Yg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf82ubm86-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:51:11 +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 41T0UxPI015351; Thu, 29 Feb 2024 01:51:10 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w9yybd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:51:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SDWW+yGbMFFZH4wiJqyNZQUMpOgR79H9gjwY1pRqqvhQ8D8ptSrIhRyWjHi0fw/67IgEuBPSU3GW/BPN3GNUEqwd6En5k1ubG5o1LHfkhT4AxlyZ9pVVd1++mHq/A5gs9LWA3+mOHiG2CYflJn1/CjmMDnApovHoSLWkIvH70wIzonDheIypcuFpDmWyyBTyvpoN8JSawILlgr0k31ZosPP5Lwg8zOmOg8AdbtpsFDyRpcz6cvUhLOY5KZ+DX7534ctf1i48h5avoOz3Y3xX9jdIcCSHgikLKu5q1guU4tpyYe0Dk6bXN9fQwz98+uBh9OPTE+D4ZgjE6WD/i2WOZQ== 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=oa4mhEhbesYuJEaYhpui/gMZPuGxJwkSWrvfwo7PT54=; b=ct0GkfkuRmn4GF4891Hwa3+Iulp4xz4rWEHZZLcoBXR6PVnWHXSVMdXsj2rouy8NjZ4iz1yVXoRcPthS7Wy2BotsTldyBKxKKT6XW5OdUlv5KQW2C4tJIem8t0Oc7reI+F+6a91W0CFVbxzExEVe4q+kHRxMlUnnF2efaeeDux/kXiJLz1v5rKQYRtAFE+JAqd+Av+BCrPeUrCx5GxgY/iS/j8kExcZPwYXbuhYcMw9PGWRvuWs3LhvQ9OufP92KKSdFr0XNxwHFOoqfWNJEymN4ddNKWbA47GqwRYVs0KfsRT4zKEbUK8PJK7CKiQf5uT2oZExdgIC0vYyttW74uw== 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=oa4mhEhbesYuJEaYhpui/gMZPuGxJwkSWrvfwo7PT54=; b=Vu0Jlb0LCielwc3zra0RvMSlmCSbKlZuDRpbDy3lwq5OBlIWMK2qRuAcLTUBZgJJEEOLg481qa/X8fRzaAp1gxggqXrBy7u9gCMGE3Uuqm7KYOyTKxZB5NY8oXz6qo+F2wHyA3uQzP+GIlRsdZjhY/lSPD1ND8JT3XucAqmlCX8= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY5PR10MB6239.namprd10.prod.outlook.com (2603:10b6:930:41::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Thu, 29 Feb 2024 01:51:08 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:51:08 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 09/10] btrfs: validate send-receive operation with tempfsid. Date: Thu, 29 Feb 2024 07:19:26 +0530 Message-ID: <3fbe8aba0a33574e4932dc2e1f3c8fc9f39be56c.1709162170.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA1PR01CA0179.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:d::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_|CY5PR10MB6239:EE_ X-MS-Office365-Filtering-Correlation-Id: 90b5b5d7-2b01-43d1-f5cc-08dc38c8e621 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QbogqrNTujIEPZh4eiRL8artkrSG3VlN71tqDGcSeTEHvlQPARjWSipgR3lm71RJr2Mnj2y1mpw4Z1NSpKYEwFI3H5D0flsfU5eVJCOw1bIgM0jH/Dy76wCA785+Ak9KnuOe4iT4kPUs0uSGxY+bAbgRtBo/ZMdbm7tgBQqAnZex4lQFVywRz7WglcAtTYkwUOLZQgZkujKWmzus8wlue2Y9LOvwYmejzQyDFS885OS0V8H8wPJxeazHRmQLNCEiPiTkZbp5g1YZiKpwEmU8FZ/VJ0BgPWr2rRq1kwHffyJm60AscZvxUV+G60O1RFPJ6FDAcYiOl0BW7RpRENKYbAe3MAbleAeU9TcLWDC+riPC0kM4kcMP92X65YR7rWH1AaIfQoBK/ei2UDcLSNGqulYfxUcHrddQjWOmzF6VD9QmbI6326OafDSi1arvoCyCeh+9Rw5a3PLaT9LUnUfFKnhGi5NTNJfSVHkWM6l+f9ln8AU4YMrnU4EnUz3QdIoKP6+ST/i+tCOYx6uBsLbaO6P76rtkz7JQwcl1WsbttsfAPDDjPK4yfZeXYyVSgPVPnHhQn085W0Xaa0Mc/CdDuFzDkXCs1cykWfieeZZu4/Z61gstgZtPODA0/GsyIi8CscjLle63MMWi7Q1eAoxSrQ== 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: w6ch6jSb2tMaS0xMCVJ2M/cTysekHAGfYZrtzqrzObxZypIHG5nLJPon7/cn81/1cSGTz0NxUkPk1BnJip6ZWmIS6shZv62eNpsD+hiz7iE7SDw1mPZQR6tpv/k6HWJ1zM5aQ5CgVsREXV5pQxpKqT0FgUqGe7mfCQMGhkao5rlN/Uer2oiFL5r0O2D3CWawZAotrW+4aF4Xgk+NkdxPcRoSljeO5HGjkA9InluNNUJXAJuhRejTe7drlSsiMnKwRNxub0icV7kMrcumnSIoNL47FOAtgpBzEoGP0AH7BRN3tpoDFa9nLBl0PgET5tBq4OLWirMKfRyw3uh+7PNcTtR2I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GGPPK9+DgB5BgpFVrCUcWX1+eEPEXRgCORyOOzGqvZCCaM8CaPoB02UXPb47dnB/ogurGY28iP3OE4S+o+kCO5L9A9mmkGXHCnhM1A54j4SH3icFU7t6Xu12g4BMHhgEOgqm64FeLieohbuWL6FN0sniLZdRwL+T1tdUW96hCV711k2+7w5pyV8 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: I4DppVSxicSC5qQghvPfawyFcTn/7J652g4dCQUnkWHGdOsv6RDyW0G06HXK0iRvg65Rv4AMYlp6Zn1lbEsC/5VzgGPVJy2hb8roITChPfqrwfzZi0q+pkarzUE/MRjOLrLc7hbtg5h2mwEQTL5KeBLBguTZhy9YOW72Os4n2PfwTJcZtm7vPVDf8heKZU3fY2GbkWLJ6UiIbNQGR2B5fDABU+WK0JT/NgtOMglaURedDwTl5fgqXAFKCkqbgmHTjdonMJ+fEG+z8OVglJeWznQbJQjhnXx9v0SgtGFKLLkRy8P/Wv/hNkvXmOCB9AuJGryaD8X3Su5UNCd+ncDHpxXb73dNA94zq6B7Tl0FVaZFS/IVkvQs2ws3XiwcuyT6o6n0R97TvP8kGd6wpJf3+nn3NLFEbqhYUtbv++zFcDEP/HH3htQBUR/6n2GZ48spciD5EDiII4SomxXUXSaCjldadn+jDkf1fsg6BBKI9Ui34XTxSCJSn0fKaUd4LgdPw6lwZvXnG8Emk3N9BhbCBLvRV4tCuQPNy5uIuW2ILudpervW9uf5RNUPXhCeRDXD0hHUVnY+tAunGZxjbnAmGMC9tlCHxkvgg/qc5/nQcB8= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 90b5b5d7-2b01-43d1-f5cc-08dc38c8e621 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:51:08.8334 (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: eaOGZack02i4iLU3EZdeu+ZS4e37x2eBd093OXTEva8/cgsD60on9I06+KhiOiKFlKgH8kKnGK+jCbb2P/1f0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6239 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 phishscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-GUID: YhacRWJXuw0N_5cQxdps6MDWhP80x89A X-Proofpoint-ORIG-GUID: YhacRWJXuw0N_5cQxdps6MDWhP80x89A 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 Reviewed-by: Filipe Manana --- tests/btrfs/314 | 78 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/314.out | 23 +++++++++++++ 2 files changed, 101 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..887cb69eb79c --- /dev/null +++ b/tests/btrfs/314 @@ -0,0 +1,78 @@ +#! /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_scratch_dev_pool 2 +_require_btrfs_fs_feature temp_fsid + +_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 Thu Feb 29 01:49:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13576407 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 8EFB8376E5; Thu, 29 Feb 2024 01:51:20 +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=1709171482; cv=fail; b=bfx9zxg5qG8EsT+0kY9D4ihk9d9aKwfT3uxrqxabcsRU7iK1GI6lEE1gxlDPLR2YeFdnHyMejboa4iukSIMZKC/QyYKjrTvO9VpuUFTt4Z5Kqqhq5rsPOsXFD0oKyjW5XCpS0S1ScksOk76hEcGss+wJCss/o7P0woHtaT+NuFs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709171482; c=relaxed/simple; bh=H8P05pTJpEr9EJ4neTMrXkg6cn3EbvrIFPECcH5SmT0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=tGkd4CpHyc09DDF2CDYHvtuunlihUGxj/20Oo3zatbqGPgm++LmBEJhGDWmcZbTNPLbj+nyQWkLs4hjLC9gDDqIUe7k2is/8n2i5uN8n1PABJqcrR0f0zb4eeLVgjlRgpso9cEQDmgww6EDKES5eRs6j45jl1ohmnlWRMtAgXQ4= 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=bVMcPDy8; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Ako5U4da; 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="bVMcPDy8"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Ako5U4da" 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 41SKItRw012815; Thu, 29 Feb 2024 01:51:17 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=OTcfKAj8wCaLnmKpnfi61eLdeMWXzRGmWmU8TBAW2mE=; b=bVMcPDy8YZsPlyc1weIJjT4SpC8u5Egj6Xx/mS6H/rwU4nbhfIVNc72lbVh4G04YEwXJ F/Y/fRZL7f1VUZ05a9jVVy8jw+doDN/6qwCr03obvuaVaRFGqrAAA2csaARZbFscNI4Z F1MngpXpyy885hxfLgwaczFWBUFisIxY5KbnnZNXEXOH7g+6DDvoDKPb8mYobWlCSTAo 4zWJfNcAm4YJhXQbMdYQoS7X8NWMlqJquZVk6p+ywcV4QUurUUBXuOX/ZH/5+7yrq9x7 gtBTKwvjLxVhDkQ1Ehq56r/Wf7CBHK+mS7UcRFxp9arjJPHB4Nse+1oNJXx7T+F1qTCZ EA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3wf784m5jy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:51:17 +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 41T0vGwV001669; Thu, 29 Feb 2024 01:51:17 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3wf6w9tc0x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Feb 2024 01:51:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bB+dU3eM78sdyngO9q/WMWsdxa1GejQA7IyAvDUiLf0q8nsBp/j73FfY53eS4FXVz5LLKUigQCbIymUsbO5KWP526Wz23PDymdno36351gRq2LIOnYv8xrHCQ+73KbUKWWMo/wZbxpEANLGnWZN9LfLXk8AN9adQRvr/8pFdXsQRk+TrY4IZNYXYjsZzqW3c/v+Se3wBbBh+ZGuEAUg0EOs6lm1KruSm07Fb1YfveItgvC76a5CtkF6oI1/xVzn7DhL0Bk57SN8UAazHb09HTexZCRLaE1JVDlvuY2x2BTT3rpf9oH7yzPNm8+Qf35v9zl1TuPl78uoHp/Zjs7R48A== 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=OTcfKAj8wCaLnmKpnfi61eLdeMWXzRGmWmU8TBAW2mE=; b=QzqIb7iiqHAzVv2TW4VnnXlGExRGeCwu8L5U6tCe6Snpmb0M9bqJ/Da+Frw0bDQ09jgXmhUSAIGw1MTN5m4/ucPDeg/FRIWltrAo2EF0xPh1mlVnlc7XTX1mjdj+JXaH11QFCTTz6vuwFQAE2IIyJGJjuTJiLSI9Iwisqblf16orTc67+FY+U5s7O5zvYhvh9tWy0QWFox4r7st3UV4mXyA/s7DhrA+r7lA8fWkkkhIoBefXBMP+/0eKvM7klfo9pRhDouAhWZsVlKxrNrLztSrI4rflUHTOYh8Xpd+KJn+qSnfM5JXi4pjOj0+zjp6SatNNOD5VB2OMK4aOHQcViw== 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=OTcfKAj8wCaLnmKpnfi61eLdeMWXzRGmWmU8TBAW2mE=; b=Ako5U4davEMXJ5G0QHfOkEx49gSiNd77OytUsH9y5N4iab28xL1AMG4MeE4ivjykTqZ63t8XNEi1n9vLtTOoJG7zUMITPwWovprzSTUqz459Glv0mKnNffc7V259QkO7kO4v4AE6w8X3GtEwv/HKz8nPcM2rSWZkoRso3wAm2Lg= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY5PR10MB6239.namprd10.prod.outlook.com (2603:10b6:930:41::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Thu, 29 Feb 2024 01:51:14 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%6]) with mapi id 15.20.7316.032; Thu, 29 Feb 2024 01:51:14 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v4 10/10] btrfs: test tempfsid with device add, seed, and balance Date: Thu, 29 Feb 2024 07:19:27 +0530 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA1PR01CA0180.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:d::18) 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_|CY5PR10MB6239:EE_ X-MS-Office365-Filtering-Correlation-Id: 43e75dfd-acb7-4c2e-c8ae-08dc38c8e9af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pNL2XM6HlZlKQGQAYbhSz8QJT2ivojuc1ACxPr2QPfNak8+raAYp3lRkLlpGOxm1G4gu0oTHq1VJdZ/cuu+O0TFhdpjVose+kun1gjENUw/g089SvM2obXvkd507i3OXtnR8sulUyxJpXsAQjg5mE9ef4zqt49lH+X4uMOXzTCJGaoP14qKbIboxsmlGZYgKLGIpcmYPYWn1ruQpXDTSH0S4BvAhncVBKjjHsM+6saKStANiMSwA/HO2bbM0vZtXgSiGbTGmHyLaUEV4qtkHGgLxTmmb8yaPAzXLSQtRv+W6SSe7azKbZeedTyFYjq+qFSaawPqGk55J8mQxXDOMXaKdL986j4tDMq9fuXTtuQGIUQ+I4IedpLiOcT1Da/FXM90uQvRV4t+Yk/9+rqNV1mHSLB+iX1Wzv5+xLteYU72R9bGRKDfNCqZLdWg1CNSmBjON/+GHGmDBazoWTgprNWeJ16j/IjSQMSWMucdUqSsx+YIHGkD6Y5b+OjEWGfkBY7Jc7OxEfKseMEbi5ukVSnyUvpVl/gr7DkGA8uqC3C0jVRjEwHi55uX4WUQBWc+Jj3liElry+qmhGMQbX29aeVjk+vQxKA2jHrNQBmND031iq9miPD076A5JR8zB7TrT 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: eKnWBxW7W+4u2kWoO652l40MmRLGymNvhS6hCOdZC4YJT/2SqbbmS/Bqhko6g51RmQVWAiWtsDkWIOZ9rkcBe71YLUieTl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0zkD4xhMsGK8jjLAGiha3MyviVBQsYn/GgXpLumG5F9MG2j+YVjMZGyWA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43e75dfd-acb7-4c2e-c8ae-08dc38c8e9af X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 01:51:14.8114 (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: ApWOjkcElb3Fhog8gn/NQ05nRdV+aJqILgcw3Hizf2xCsvFwpW9I9UqMEhUPLQEcSjh3N8WCk54JB3AhsvOxUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR10MB6239 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-28_08,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402290013 X-Proofpoint-GUID: mBvEUBCttnPQDmmfbV0XmrlZ0hjCFhCK X-Proofpoint-ORIG-GUID: mBvEUBCttnPQDmmfbV0XmrlZ0hjCFhCK Make sure that basic functions such as seeding and device add fail, while balance runs successfully with tempfsid. Signed-off-by: Anand Jain Reviewed-by: Filipe Manana --- tests/btrfs/315 | 91 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/315.out | 10 +++++ 2 files changed, 101 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..7e5c74df4316 --- /dev/null +++ b/tests/btrfs/315 @@ -0,0 +1,91 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Oracle. All Rights Reserved. +# +# FS QA Test 315 +# +# Verify if the seed and device add to a tempfsid filesystem fails +# and balance devices is successful. +# +. ./common/preamble +_begin_fstest auto quick volume seed balance 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_scratch_dev_pool 3 +_require_btrfs_fs_feature temp_fsid + +_scratch_dev_pool_get 3 + +# mount point for the tempfsid device +tempfsid_mnt=$TEST_DIR/$seq/tempfsid_mnt + +_filter_mount_error() +{ + # There are two different errors that occur at the output when + # mounting fails; as shown below, pick out the common part. And, + # remove the dmesg line. + + # mount: : mount(2) system call failed: File exists. + + # mount: : fsconfig system call failed: File exists. + # dmesg(1) may have more information after failed mount system call. + + grep -v dmesg | _filter_test_dir | sed -e "s/mount(2)\|fsconfig//g" +} + +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_mount_error +} + +device_add_must_fail() +{ + echo ---- $FUNCNAME ---- + + mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} + _scratch_mount + _mount ${SCRATCH_DEV_NAME[1]} ${tempfsid_mnt} + + $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/foo | \ + _filter_xfs_io + +$BTRFS_UTIL_PROG device add -f ${SCRATCH_DEV_NAME[2]} ${tempfsid_mnt} 2>&1 | \ + grep -v "Performing full device TRIM" | _filter_scratch_pool + + 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..3ea7a35ab040 --- /dev/null +++ b/tests/btrfs/315.out @@ -0,0 +1,10 @@ +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: system call failed: File exists. +---- device_add_must_fail ---- +wrote 9000/9000 bytes at offset 0 +XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +ERROR: error adding device 'SCRATCH_DEV': Invalid argument +Balance must be successful +Done, had to relocate 3 out of 3 chunks