From patchwork Fri Mar 22 11:16:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13599978 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 96D103EA91; Fri, 22 Mar 2024 11:17:23 +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=1711106247; cv=fail; b=n3IX3a/aKtna8Ju/DUJ1aDZQgkEI0gKkUMF2EIgL3qW0svVRABPXkvHb9XQ2usz7qJtCFtzUUeMEwikOZ44OVi6nvepgw3VoqfpXR4PTwcfj1NPxPsRlWqBM3ACnS5LhJmoipIXIF0qCqrMMP0Cu1NW2746fKZqpOjYcNrquuJk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711106247; c=relaxed/simple; bh=NUrICeyLo575w71WZ84DhRB3YXOuBnsvyjjCtIpvj5c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=XxT6J2cGGCQEpZ9RiSav0GhO2cHc7xJN+05JTKcrwsRE4rHuLtQgyCk2XqmM1m5++/sVXsW/AIiwdVFv6SP0RF0oai/L7c1BkNJyVlniKvUIMoSOzR8nOemzkhM/1I6EeT1cIML9e5htuQQjOQND0Db6V6+oMTxsym3/zsvAuEU= 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=FR6DF3OS; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=aUL9CCCZ; 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="FR6DF3OS"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="aUL9CCCZ" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 42M7YfiW000995; Fri, 22 Mar 2024 11:17:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=SaCOMV0gK0DND1tUXoSdIfuYS6xjGWyQKObFXXZD11M=; b=FR6DF3OS55Wg9FmlzQNTJM4AlKPVFh1W5LCJRlxFFX+iBYAMJD0QDSpEdM81DSsovPcQ Y0YS4rXPRNy6UJP6VlvCL/TAuuf4rvazv3bNiuOgL8uI0tAz+Z0eMtZR+DQPWFR0i1zR GAk/J5MtYPF/CrxHp+VnyqYHuOkW/9pt275OgJms4nX1juAXZlrR3JHv41tYzsr61DAa 2txu+8aGCMjPDcRkQShpTjNXd7LspgF+7yUnPtNjkFAdcFe+KJS5V4m+xJFDdQSpnjlh 7bE2X5dS0M9HVnmgHm8gLX16yBKpFhdmc2FCmAdMR5STqltsNO34GSvD3tf1IyjalkKC 3A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3x0wvpgukw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Mar 2024 11:17:18 +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 42MBDZlV014972; Fri, 22 Mar 2024 11:17:17 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3x0wvk42uv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Mar 2024 11:17:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hxn7ALGnhC447Y/QN8Bwmute3ftZTdCJLc3xWXYP5kke8i+ihwr1CloDmlZoZF6eMgA99ahVWByhAoHXFee/pBovrTsfCUa7VzOzpGKb3htaQaeSaIUC8jIavtDsyTEix3JSYLuvzw8HCWNIIH79KDnsVKjecvGvcI42Q478gtRAh1tGs5n2iG28JjBD5OHtgDhjs5YI/NXJE+WdhJ1hvs6wISoWXyS0VrhBxkiiTmusvOSl6zmggcE1wMe1IbDSrn/Z2VHi6wM9M7f95OVvMbYhpa+mHK9kQ+4AIDRPsthrjT+tVODp4mMr7CmI3dseuyeQ/jmWnkUGxQtlUHEY8A== 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=SaCOMV0gK0DND1tUXoSdIfuYS6xjGWyQKObFXXZD11M=; b=edUbe5QYDtMHxT08UATvMVjzkEd/BhL1NDZtSO4PY6pSxmXPwnRbaytOuNDVmCT14jc0vO8bfxDlSamA27ZQ1NRbm+Fbb5JhKZmViZ6uyOoL1bGv/7EVIGWOHqGr2yeZkS1mi4I82fIlUXibzoMaMrSaBpzEwr5K+YID5MrcnlJptoFZa/r7lstuO4Sr+MaAV/Js/Vi7dvubUQWx4rtjn+/TV9CXk9YirKHruBlWQW4tqeq++mA9chVcRepio9EwFgwDKzEGKNKaux7rKKnELxxAlDYpAG/kFgMcjBKkAJil4o7Agu0vkjlahv0VvVEqUUU1Vg0pUMI1buXCPQIi3g== 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=SaCOMV0gK0DND1tUXoSdIfuYS6xjGWyQKObFXXZD11M=; b=aUL9CCCZbGEigE0sODQYLenDhQDV/dD5IhAl4R3Q52lhzWYxYtOBa5Sdfnf8K6JCw6O7/AAkl1wBlWuqBUPTVqZvUeIpF4U9+5SwxDzn4boYUMAJVemAWRL9RKaxiBes5n68mbXOzc3EXHUIGqAgMWfUiX8gB+WRHsP2ikZJ5K0= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SJ0PR10MB6424.namprd10.prod.outlook.com (2603:10b6:a03:44e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.30; Fri, 22 Mar 2024 11:17:15 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%7]) with mapi id 15.20.7409.023; Fri, 22 Mar 2024 11:17:15 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v2 1/3] common/btrfs: refactor _require_btrfs_corrupt_block to check option Date: Fri, 22 Mar 2024 16:46:39 +0530 Message-ID: <206f5635cffc0c923afd1a297058fa406bd8e43a.1711097698.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: BM1P287CA0001.INDP287.PROD.OUTLOOK.COM (2603:1096:b00:40::21) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SJ0PR10MB6424:EE_ X-MS-Office365-Filtering-Correlation-Id: a30a5378-0454-407b-b570-08dc4a61a0fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tvd9UXoWvM7MOM2JwKdhqrS48XLNK4wz2BkOtf247hUqYtQ0fg7XwSR3epR6micooE813uvkg4x+Mez8ChueR4m/msthOkbKIYUMFKzvvchL6O4NFlRmaIIN8kJIGtnEFeTLr7Z6ejRt7A/2my/QevmDKriFVaquuNdH0BfyU2B1S2aUHpE7Qmc5WvWHGPIVxZfQVVHl3Mh4QK2tPQZpPMT8L215Iv/KgZQlAgDC6JdCGwXLBKpGQ84vc4IfobiGo01jajQrKUTdC8uIZeDxQ5Qe3clKbDllLpYKzRQPfdN1fG87s/okwY3TiJRMiwW2n3KghEk2TzhayWUiLVY9StfzugDOt4M4AXfNXiEhxYfQpy1lKgWCFUoBnoDr1LxPjUCOsVFdTrg5bNTqPDrKbISizVN++ow4Unu4R7GckGuDDRBHbozLIUC37rbHhesiD6nIP7qmiCs032ITnQkANx9TgmZF7H/kE9OhM/vpygVwtxPugLYG3Ixj/a/tGYNjfbr4LYM59y0PwbK7wkPltLK344UgW6J89KYGmDvOPI7hYDMfP1lUqj3S1t8i9RHY6NKJ3mmWd/54EzgfjMMGCO2gc70CsliHu5BPgPyIv5ssKbJEygdTuVsiu25ApV+S2Y4gvlXCoZyJlD03XM0iHw== 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Z/EUxTr+UyFyMPSoLn4+95nF1lE/0fFdRtedZz2GboGR9s3eCtgxknKdZG6HeLM5SRXH0mR8gnaPEe2DYfnT8S1IYtZRF3w3tmHZtQBXCqUXwDn71Ds2AhHa0qDsOZ1vrq5jOOA7a7WG7UtMO9smdfTGdd1hpM9u2RK9c3+TApdjxi6SeKOWrw8DVn8w2Z7H3aZGl71x0Y5mKmRUv4cRwgGGcw9IcZIRRkQ/N1pKPj8ekX9+RL6kBup+HudglCtf1+akfz01qMXjGFznltW3jBDcqvRWY0HhczGheHbgNPIyLtMXro9Q/9z7EB5JOlVKlZvpqFZDcZ2RhXIHMD4vnUHrXut9B5d1NFlIoMR8rh+uECRruWNTNftbr6fzJw0urSZctrt35NQIZ9CIk5fvy1Eoo/TJ6ojPm/zK4DKnDphAYS5EOprg8vqrL/sbAA5isLUNK0ICEgfsiJe9xWP2zoUi2dnAQ4ejajSkfM6xxy8r+mq7yotsPSXhRP1OzKoKEB0DLqSMjCnAdStViCdQTCSNHIRUjFl1OtkI7eXntbFJO1t+IWm351wj0G0x4t1iUMtAw6glf847I1sx+3PxX5Odwrgwj2BnoV7U6kKnJ+aLoz/1u+h84q2+ssNVq8wbgMyqVxGujzJv6taFqmGbHQfXxMP77G4jGkMFmhO8CJgdPtdmUwyx60W+w42E7BeJbSwNNrRGeZAs/HJi10RVTNYKa2W1LA+STvsXPFYqUiSOekn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uU+4/V8oj+aLmtKEDydc7qXYMybMiQpYZmvn2mrXegERI8tT2CHehD2Pc4ccMJTiTRnyrHTRcodTulU6c3wOe1D9y/LrnoEw7ZmUYqFQFvdW3Tv1V2zlta3F12SBsSQURVjk0ueaQE1rTsWRwJpGGqCTGmnPWtOqbMdJubjdKWjfFrp6Y/o7LtI6wsvJILpo/N4cEa8jPhmXmg8GMEz3/v5mOQ4O2+AQeOuCNwD+ts8B7fi+Xp3cKK/kIVgthSdyXVzTwipn+xzWDfecyYKGyCSILUlnbj0MeCOu/HqnY/w7q7aMe2kFqUuos2SCXFNQ58atSMHV7EZAainLnwZUiZBlr6M2FWguXQesxz7ucf0m1YE3kCnws5sGNvnmGFxOTdHMbbw+aEbV85Y9apyNlTbl9xHEfhaUPdDzQgS2FFUFKN4LC8HksEj/lkl1fjpfqImvlVJEbAUL9MA46bCarqjRjFs4FUlGIrLpJXnEJfz94lkbeJm95shHHQXB6FriP2+xX2f7eA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a30a5378-0454-407b-b570-08dc4a61a0fa X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 11:17:15.5393 (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: 1uz7TJwLgkEX8WlGDy1Vk+AMYxax5nuk5GUnWM374H3JVfqxxh/S9AyEGspj9YtjvYBfApLQe8XcOz7wYlmD4w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB6424 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-03-22_07,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2403210000 definitions=main-2403220080 X-Proofpoint-GUID: l3JBFGPPAKgNXOJTemgQMOS-HZ-JcuL_ X-Proofpoint-ORIG-GUID: l3JBFGPPAKgNXOJTemgQMOS-HZ-JcuL_ The -v and -o short options in btrfs-corrupt-block were introduced and replaced with the long options --value and --offset in the same btrfs-progs release 5.19 by the following commits: b2ada0594116 ("btrfs-progs: corrupt-block: corrupt generic item data") 22ffee3c6cf2 ("btrfs-progs: corrupt-block: use only long options for value and offset") We hope that if these commits are backported, they are both backported at the same time. Use only the long options of btrfs-corrupt-block in the test cases. Also, check if btrfs-corrupt-block has the options --value and --offset. Signed-off-by: Anand Jain Reviewed-by: Zorro Lang --- common/btrfs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/common/btrfs b/common/btrfs index ae13fb55cbc6..a8340fdd4748 100644 --- a/common/btrfs +++ b/common/btrfs @@ -659,7 +659,22 @@ _btrfs_buffered_read_on_mirror() _require_btrfs_corrupt_block() { + # An optional arg1 argument to also check the option. + local opt=$1 + local ret + _require_command "$BTRFS_CORRUPT_BLOCK_PROG" btrfs-corrupt-block + + if [ -z "$opt" ]; then + return + fi + + $BTRFS_CORRUPT_BLOCK_PROG -h 2>&1 | grep -q -- " --$opt " + ret=$? + + if [ $ret != 0 ]; then + _notrun "Require $BTRFS_CORRUPT_BLOCK_PROG option --$opt" + fi } _require_btrfs_send_version() From patchwork Fri Mar 22 11:16:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13599979 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 476AE3AC2B; Fri, 22 Mar 2024 11:17:25 +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=1711106247; cv=fail; b=CeZu+4xMs72SErHrlqFWufZLgCooUphzZlfGZSPfcqSWtJtR7YaBSN4qNXNatVrCMZ28pAJjcfpEZFogyAmAfzZYH5U37zVzTl1VzqWJ5FDyyYK5rHUmDI+rmSdIGQ9fomdu3f0Rkiwi3s5Zm/ZXHadYQhwmkkNG0vbxeDP4Tac= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711106247; c=relaxed/simple; bh=QCg7fK5USOKYS18AVDAnTz/8SxtuHIVO61pNJrN17u8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=t+9jqPPwXjnqgsPUtui3X5Hvd6NgoalPVDg/pJXQBqDIABcTfsy5quRjHymnxCangMBKIjT5pSMaFSDh3WQ3kGXQOInnX935kd9Uaf14jjCJrblXQKfHEYGVVa8MHtlnHgGknPgGS+/ECrDrR/XfC0usn+RVEcoLO8uPuSEfNkw= 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=SZahmD7K; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=gqw7Ru37; 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="SZahmD7K"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="gqw7Ru37" 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 42M7Y7Yp004068; Fri, 22 Mar 2024 11:17:22 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=sMJqwt/NTCxm+cvenhV5b1dOylppWQiBcLO/b361TNA=; b=SZahmD7KFKqGNYbkNCYt3yrYduwraCxRgnOkbVjLclKiTYcTlgQVjoWgnKmEqMfUBgr2 HKuWGK/lKE5Che5jN52FClUqbK2YPCuhhdInGFqhxJagqyjW4BXkuy5glheuKc0vzpa5 hbKZNx4a8Qpe+FSQ5YkvHJJQpRZzv1Y0Zy1KKwS+G2LgjsjoIUbTxzTSINrYWf9JBOAj dSg3Bh4Ny2jIzl8kaj4kr4l9jX6yu1+iIAYFr1JaUsdU4gxdPhi/5UmZ9QVtw3Ovcu/u VX028oV1zckeo07si1il6W3iUHfIaUrqBkJow4ONbiD5vv+JW8v6+ErrQw4k/emlfj+c 8A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3x0wvk8vs8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Mar 2024 11:17:22 +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 42MAurEe020218; Fri, 22 Mar 2024 11:17:22 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2041.outbound.protection.outlook.com [104.47.73.41]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3x0wvfc9u8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Mar 2024 11:17:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aBO9PTm3zP/A15LuvpdJdSgblckzYemE8Y6C2PS1CDAhJ4QBJA+h9EZ43N0LN9r+YQTc8EBJCRQUDFEF1vbD/ekM3RFJCF0RqS6KMTatib2+ow8jahD21MMBkD9hSu1aJlCk6NysdbJHIO3p1p1yMMDSlMVOkXdGtdi5m4ajvAC/B+1YYjX0xMk70O42kc+B38iqxZ8cOUfxdyAiLFF520EVZ+BFCjGI+0EjpuoH3Nr/XQDm5lc5ee0rXqHmAD3FsJv7jN0cNuJEgT9KDiCjAqLoEjyuJFP06qBh72/TJ7sD5fWIXcrw2DvcMLv1wr96LD95oYvPEvPMIOQk8MejWA== 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=sMJqwt/NTCxm+cvenhV5b1dOylppWQiBcLO/b361TNA=; b=aTSy7aJSWUouVBSXZJTcul33l71WJK0nrKE+umHtd7szOyeVHj4gCqhqrXIYFZ/1KNkqLy65NWal0xweSJbJBjP8LdoC7okUyFWvpZgHoP8i/lCbgtobretbODYg3BzqfY6yS7/7dm4qwXZv9LrMFRaSM9ss6+OfbrT3ZsLrbzattodfMbAuT6+KvphL9EwSy0Q4Qj4LlWqDUyCZD/bdsNZ4FuCebIzrxabqNcMFw4vEUh1Pt1GaAVyazHJXBgcVc1Jh4N9YWcfL7Yd/WzDwjzRaTYM+jggKXwYQBayV49+Q4vFL2gAIRdBh5KWsHNnq4rfCOVyCNKEpukiigZHgiA== 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=sMJqwt/NTCxm+cvenhV5b1dOylppWQiBcLO/b361TNA=; b=gqw7Ru37+wGvZWkCxDCvDvQVKxr0ZwX+y3jAhS1+CmX5QiLMEtloDL7RzGim5n9OYMgFnI22DpiFNluKiRWbUyYWM/Q6DiQ5O0QWc1tVSI/ESkWQE7NYbKdF/RZdBeNftWMgX3TAq6C8Gs21G9fn4l7QZOgQ5k8b96kaMXU2H7c= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SJ0PR10MB6424.namprd10.prod.outlook.com (2603:10b6:a03:44e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.30; Fri, 22 Mar 2024 11:17:20 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%7]) with mapi id 15.20.7409.023; Fri, 22 Mar 2024 11:17:20 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v2 2/3] btrfs/290: fix btrfs_corrupt_block options Date: Fri, 22 Mar 2024 16:46:40 +0530 Message-ID: <4a6cada1ad70ca1f9cbb825d763364b71ac35514.1711097698.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA1PR01CA0174.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:d::12) 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_|SJ0PR10MB6424:EE_ X-MS-Office365-Filtering-Correlation-Id: 59f6ee47-6217-45f6-562f-08dc4a61a3d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: E/mj3fVpQ2ASIR8GJisNtalIF+sN4e2mfmtaMf/h7fGyI7fgYQhB7anbS3iT1nCWHFk5pVsUV7TzOYFepLKBCpp7AExEsTHydMM/i2bI1oH8ZZCh5Vyt2lu8zm6F1VmBIJPfhaXZ+mQjJFlVR3kjE7g+Ok3ExqMXM66zR1Aqm9EXb6VeNlQYdscV4BXVK2AUJcdeF04KbC40JCucAVPFuB0H+VNcBMR3mRInCTj3o7u/ctC6MeQLcqEhbhrsh7wcZ4FogoaiMCHEhT1Bzw3Qi4F3ej6B3xrD6I7M3eHdQvfM8mEVfIzPEawd3jZV2gpIlYXrHBH/EYrp5jeX7spszfTyl41sn267rfprT2oe6W6rtm0iRNBYqAuID33qg2ZSm6epqo7A9IEE4A3JWPyLj7htF0u2ML7eTdWW+MCvAg2kvhGCrF8p47JOE/vHd+A8Kb3NaEST/FBEKjSRxsDODfYWVhFE3yVNxhHW0SKVCmq2Qzgp+Maq0Luja3eXwuE31C7zpZjl+hoAalVS8Gfnl1ozZtt8OiIgDvlr1o8jay8Jw68MAY021rsNRwpGiBHV/v4KFN0TZS47853MNzTrMpXivPSkHOzl736t0yyc19uFI+uFK4yHFUsgDasXmMJmRcnvts9Pcb4yec93Iy58gM7I8j38a3ie1L9JeDi4Dqc= 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nsfogXpRqWHHbKc9W1DWEBgaqQ7DWzoN8h94jT/z9vlOOrnqIRFTiRG6FKuWXJrXe7qP29SENgB9FjYqDT9bIF9d8GSxLXk5pbxyO1uv5OwHnFY0FX+K1ObLk0XGi2SM7hhcWBd6wgzJrowDB875Sx4xJOvHU4xTLSjSbcOzYsaZpVpbM0x5/uVZ6/dPBxB2/iVdeBphDny2pG4nb3CX4dp8z6NnbxGc9U/AY4ml27S6pNtFR9b4Gn0sARShGJp5GJyImMq2XOoGLhu8aaDnZgOzXYH1QDtgdZkxREI3h33JU10/T4b/iJVjGGdfHqHKic1xuvd9kHD6NR8EMYDiUWiZCGO+noLg1RHihfm5dg9rKzDc5m8DVNNA1HMpTGi1MXWdZq/D9p8TdmzC+1VoG72z6nhj2yPNfFTy/87T7s1RMIOb8KUUDc8BT+C3dWDNjvtBQcEeANtWW98ARDeBDECmVfnGviC7436o68vUeAtvtT+wwFVV0pFs7SH2RRamvlOZey6oyBWObzb0LxiKdam78OPUAuopeMm5d3Sa/eDh8sL2ZXnt5IvsQzsTeqVjJ51h7yuk1TcdNW++ZIUHy+ik8UTse4xVx4fvnZ/u952lCeBNNRvqCbF6hE+zHslz1qbbRtZAhhmnWlw3a9VgFa2+SwfF8cP5y8QB66PMA+fTnNOhNzFQiuDZMKUxdafiTuxzTnIbDPlHANhOP3v6Ukn05VIgtDcUWlVJ4tVi0K34x92lS+bGEfGZx+69hOeMJ9t1C4YkHioxUKK3k0K7KWiZpxOuDzRSOYDAw1TTRkO1yBCYDoXYnELRfUJFqtwjYDGgQ76K5XShaGryYWprwWhPalC+xgXquV/VbYFETkK6J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T/Hey88Uf2xKpA9dQKQH7GJ7imCveQDe91v6atOQFTOH+Ptgl2+2WPIFn/u1I0f4Mcz0KTO0Q51az4bTLVRnldST4zLaWhRhDvjuOmzcE6Cb7B7u7RWviDIu6vf4jvpV6UX1ViBSMPgsYcP2w1kQ8tpvvP8RdeE4TfWaqVdt0YW9VCEDEJRojwPdw6YMK2fdOGs1FatA1jbgzM92l+Irx0K3f3169jG4htAfcsQjeyt5XLwLyI4yTfOzNbAXoYKaBtmAxJvrTqx9Bjw+gsur756C72oaEOxGf+/BCtByV+Ti2kBfHqC/7xkI6j1+AgtUEo/VLhZA/sqGW8Dd8VvICOL8uRaLs0HI3Kxi3mLojdM93o9rEHdMMVMs0qa7fWGWmTo6OaKMI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59f6ee47-6217-45f6-562f-08dc4a61a3d2 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 11:17:20.1851 (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: 3x06D6gKOQHwwsxk8GIQKGcJM/joMbg52DPsUKwb4J9yR0xU/c876eYmWxyzYr5lDrOU2hO4EG/WQTjv8n4mSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB6424 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-03-22_07,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2403210000 definitions=main-2403220080 X-Proofpoint-GUID: uL9XmJrMPAEYY4lFU9c9dtiOqpHUPdqS X-Proofpoint-ORIG-GUID: uL9XmJrMPAEYY4lFU9c9dtiOqpHUPdqS Checks if the running btrfs-corrupt-block also has the options value and offset. Remove btrfs-corrupt-block command's STDOUT and STDERR output redirection to /dev/null. Without this, debugging wasn't possible. I also noticed that command is quiet when successfull, so no redirect to $seqres.full is required. Signed-off-by: Anand Jain Reviewed-by: Zorro Lang --- tests/btrfs/290 | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/btrfs/290 b/tests/btrfs/290 index 61e741faeb45..281333b200f9 100755 --- a/tests/btrfs/290 +++ b/tests/btrfs/290 @@ -31,7 +31,8 @@ _require_odirect _require_xfs_io_command "falloc" _require_xfs_io_command "pread" _require_xfs_io_command "pwrite" -_require_btrfs_corrupt_block +_require_btrfs_corrupt_block "value" +_require_btrfs_corrupt_block "offset" _disable_fsverity_signatures get_ino() { @@ -58,7 +59,7 @@ corrupt_inline() { _scratch_unmount # inline data starts at disk_bytenr # overwrite the first u64 with random bogus junk - $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 0 -f disk_bytenr $SCRATCH_DEV > /dev/null 2>&1 + $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 0 -f disk_bytenr $SCRATCH_DEV _scratch_mount validate $f } @@ -72,7 +73,7 @@ corrupt_prealloc_to_reg() { _scratch_unmount # ensure non-zero at the pre-allocated region on disk # set extent type from prealloc (2) to reg (1) - $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 0 -f type -v 1 $SCRATCH_DEV >/dev/null 2>&1 + $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 0 -f type --value 1 $SCRATCH_DEV _scratch_mount # now that it's a regular file, reading actually looks at the previously # preallocated region, so ensure that has non-zero contents. @@ -88,7 +89,7 @@ corrupt_reg_to_prealloc() { _fsv_enable $f _scratch_unmount # set type from reg (1) to prealloc (2) - $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 0 -f type -v 2 $SCRATCH_DEV >/dev/null 2>&1 + $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 0 -f type --value 2 $SCRATCH_DEV _scratch_mount validate $f } @@ -104,7 +105,8 @@ corrupt_punch_hole() { _fsv_enable $f _scratch_unmount # change disk_bytenr to 0, representing a hole - $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 4096 -f disk_bytenr -v 0 $SCRATCH_DEV > /dev/null 2>&1 + $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 4096 -f disk_bytenr --value 0 \ + $SCRATCH_DEV _scratch_mount validate $f } @@ -118,7 +120,8 @@ corrupt_plug_hole() { _fsv_enable $f _scratch_unmount # change disk_bytenr to some value, plugging the hole - $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 4096 -f disk_bytenr -v 13639680 $SCRATCH_DEV > /dev/null 2>&1 + $BTRFS_CORRUPT_BLOCK_PROG -i $ino -x 4096 -f disk_bytenr \ + --value 13639680 $SCRATCH_DEV _scratch_mount validate $f } @@ -132,7 +135,8 @@ corrupt_verity_descriptor() { _scratch_unmount # key for the descriptor item is , # 88 is X. So we write 5 Xs to the start of the descriptor - $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,36,1 -v 88 -o 0 -b 5 $SCRATCH_DEV > /dev/null 2>&1 + $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,36,1 --value 88 --offset 0 -b 5 \ + $SCRATCH_DEV _scratch_mount validate $f } @@ -144,7 +148,8 @@ corrupt_root_hash() { local ino=$(get_ino $f) _fsv_enable $f _scratch_unmount - $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,36,1 -v 88 -o 16 -b 1 $SCRATCH_DEV > /dev/null 2>&1 + $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,36,1 --value 88 --offset 16 -b 1 \ + $SCRATCH_DEV _scratch_mount validate $f } @@ -159,7 +164,8 @@ corrupt_merkle_tree() { # key for the descriptor item is , # 88 is X. So we write 5 Xs to somewhere in the middle of the first # merkle item - $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 -v 88 -o 100 -b 5 $SCRATCH_DEV > /dev/null 2>&1 + $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 --value 88 --offset 100 \ + -b 5 $SCRATCH_DEV _scratch_mount validate $f } From patchwork Fri Mar 22 11:16:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13599980 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 AA0F03AC2B; Fri, 22 Mar 2024 11:17:31 +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=1711106253; cv=fail; b=hDILThJZo9YBZpkqhBZY/tZRPWYqlxCi9qwOzKb1nWQiOTmiIRmMCGTsogWUIAnecY2BhFsvUOgoTXeRPtJ80znfjaQ4Wd3kJw5UbKt1ssyoWPVUCnRHEKtGvFr4qqzSJRFTWNtB568u3HVOZLWs1XxJWlGYK7p5PtmNFYoNmz0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711106253; c=relaxed/simple; bh=ug90Wn2ONUhpOtz/+69/Z7g4TEc/ntKRropD0bcTsFc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=OKUGD44omCpgR9k0JoB1SrGh3RK7+94RqMPTrDeI0DEn/BImDkT8fA+I6zfSQ5rWOSeXJRix6zHbKdOVqTcJzKd0cjoxMVut1eTXWnB9cngzLYvR8Zaw1uLZPZDVFvsZ0DlfOzXpM38rznKme2uEL5sPAC7WAkZDcBWA3GaMl08= 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=POoMHY23; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=kX9pMa50; 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="POoMHY23"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="kX9pMa50" 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 42M7Y7X8004067; Fri, 22 Mar 2024 11:17:28 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=ZaWKz62t/seM2nLE+JkHIhp2cjWXl8wiwr5UsrnCzJg=; b=POoMHY23a5Ce/V8RePzE1ntMdjqjsadnwpQ7sVi+hKmQnDpoq9t22/CHKxNmf5CLXvxW wU+QuQy4rVm1oZtGbURCwTHR4DrADNdSd/tzi3lOXJ7ehIjZRTWSheq+W1+ekmrVUhn3 0xiCbcnX3K/Lodpc8kgz0Lb016k5NMILJcW/XA4ZMyOllVTzAuPEyfJrXDxK/nZ66WlP OWuEncnUeEf0VcxeZxqeEJNE8YCiET16cNcZJQd7FMLBYHD/J5QnH4NzDtIjBNCC0peI ConE1gy5LcdNSnb4kqEy1WNQZw3t4/wxZDmPa6spH99pV5PvqDekmPS2/nZITOR85QQg jQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3x0wvk8vsj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Mar 2024 11:17:28 +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 42M9APAC014978; Fri, 22 Mar 2024 11:17:28 GMT Received: from nam04-dm6-obe.outbound.protection.outlook.com (mail-dm6nam04lp2040.outbound.protection.outlook.com [104.47.73.40]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3x0wvk430n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Mar 2024 11:17:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mN4yv0BdgFre4Pu1x1MhhJRP67a6decEZQjr2BscQ2WSC+UDGHZqDsxQraQ6kYaD8nTl9iqUzV/2oiKEfU2hlJnPt+5rdz5Ixjd5lFgXLADeLbQimr29bPjQcEZJWZ5ekdjoSo5V333Itxg4tQLXmaKWtlIW0v9kzVA4wiq/vTInraLbtAwqxw7YhBdjstMIhFDgzf4ejMPJcVNosergJNNnOUJDUxr1yoKE6FisbszMRcW+LmlPOPhrghssmubMFuaAdSwx5ul9MBhB63VteOxLslS2kU7jxam3yhE4sfEXHYUlmpUxBkOfmm7rAGlLZebOXSHmuWSNs78pq5S5vg== 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=ZaWKz62t/seM2nLE+JkHIhp2cjWXl8wiwr5UsrnCzJg=; b=akSSgzGks313+/4R2Kqyh7RKeu3EUFolreYmyGowlsGUjhMXNoDjan6waxiUXpx/fgygPdUkc0kCI4aXcli67NWMYnRfx0vQZLTQYGoBUfuKj6J12r7c9dObAWTMLoxRF2NYImSv9w2SALxI0AVgX0RgkTVqL/qQxbcKmgfF72cxdJowXGxHiUOY461F+8soO/Q48V2rbM7ut0ed+s3+apqbUaoSSHlGFFfyfYTWsRDp7CrchHA3jm4McXTSjBOXE+dKUeviXyh4JHupfOL6UNdepoY4iJor54QnvWAg8iFaY+YkJKcjUQjk9a56mITKd7UQqWOhp6wXkGPdf4lkfw== 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=ZaWKz62t/seM2nLE+JkHIhp2cjWXl8wiwr5UsrnCzJg=; b=kX9pMa50C75pQ9HbNSYMJViDmfEhZzGljaAz70KfB+1WzAT1DMHD2/kNOFKatyCu2f50ut+peK+58nHIo73XxMLDpeBdNeI2Q2lR/qUSBi/0UAVuMSzOGnaK13S5rTvnv+JOSeiW4lvRmohRSeKsu4oWZj/6w/GAn155aJsC5Qc= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SJ0PR10MB6424.namprd10.prod.outlook.com (2603:10b6:a03:44e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.30; Fri, 22 Mar 2024 11:17:26 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::814:3d5c:443b:17b%7]) with mapi id 15.20.7409.023; Fri, 22 Mar 2024 11:17:26 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, fdmanana@kernel.org Subject: [PATCH v2 3/3] common/verity: fix btrfs-corrupt-block -v option Date: Fri, 22 Mar 2024 16:46:41 +0530 Message-ID: X-Mailer: git-send-email 2.42.0 In-Reply-To: References: X-ClientProxiedBy: MA1PR01CA0158.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:71::28) 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_|SJ0PR10MB6424:EE_ X-MS-Office365-Filtering-Correlation-Id: 6497fe5f-e2fc-48d8-0908-08dc4a61a75f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4BTVAuXmJ6YOLNp1iw1yNFopwlQ7kXzvVjlsgbz5yAtyhE/cZPGl8F0JtGGuKsed/zjqWxdWuMQwXS/xapmKUqI2ZSiE7RD7O4gNKM3mSvUn0svvqQbFZwZeVeRhz5SfAH/q1WGbavXuN73NDjMyzECIP/TtqZHbeGzXnfjTP3b0Xb2gR0lchQdTOFAsgpIboaq+UN4qM/oTGZsStgylIbfqx0ygfse7uOws68V2PIGJ8bjVFz/R1OBGNnA16XXzg1WExXLJqUau3r6+8Wj79yCzT7Z/1WsQyv80nu6Z/z3n1lbUo7pjU4I6vN0BhcYVMLxsNAPUtMb2V9DZUrrUdN8RNRcRENpPKDsY5tGKoAn2OSCv4wvS1r+xnCPMDbXBTOQUEQCe/7eiccNCF7IDuBdqPylKOpDzXEnigtJDlwloNi4dhXg+FmnG3jYDVL5jy+0Rfw79gEF2QGs0pvgP/4EGurFQkfB/VZCLC7/cZgQCiPs7ZIFO4cRIAOV6Ux8MTy8r4QUmErSz7FuR0TWbjFOhZ8yzF2N716zxlRcRztXSqfNrJ7qbnTetShNGq682U0mr/awEfp1LkXWnEiQ9TPv2PlOEag0TH5kSPKfyzCUkYbzjPEPH8u355IFjDGkWV/ZFEMS8EgMva0PhkfCYQtEJyTMlJs8mflaOUVkrOWo= 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qklJw6ZhlMtMcRqtITC+4E1HFfFwPSTdJ5wqZx22zZZ8qneOjabqpwPs46QS9Q8i6v9rgxQfeaPmAmYKumXSzoK3lkBqyn3ofG/JTVZhIgljuW7S7fPHwrcTCTrFqDix1h67xSPfBlJwrmwcRjYbtnqxR88Dm+pN1nn4Bt+R9a5kORgh39ZVB6fVg7vvvyIqwMn3b2kCiCm9mshPwAX0MsH6CkvHwHruB2CBzFnUEUhYuENvQzZ9I10wxmH/XVKfmt+RkZNJpVETlIFcpr26OXt/Zr34ea+qSsLF6CjXmVj7EXXPq00fFr/fecylMaILCbrk3iA0mzHuwy+tKnTo/a0D6s5QuZwwZ8UpTrFdIc1x5H2eaTIjo6wz4RxhK6tAs48eqA2qPxDvM0hjoRcbAhikAeaFEagGIOrpMGgYyLnVBeU2gEv3Rv0QyAkJILIW6I1HQtSgOhfb1OkOVEw3sMv6Ka21Tz9PzMheGfnRQtlVePwz3ngqPO4ZAK6thUAv4sGJJ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w+3ZSkXgGjQh1DtEi7wTzUyEeSTqTeSTk949xNSkfejojmNHodmoHHA1Y7GNRHmf7BN3 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 45KPX2ycYhYv3sYc7C7tHOe4ynySX//7z1zkINuVBcCSHHMbCGcIocLJQyDrQ+Z6H7fYfy3SxRGBEy4CfLTrxrzAz2J7BmrTmSDEho0jsIK7ivhU8hoeADcwSAP5/M7HBEnuMW40cqUDdJ7kw7abgXX8ML/yZWNvRUgCtSbR6u3WuVsGo318NzJ1hxwTJzZX3EXRbFF7KDfo9jfqMJCbOgdY5Du4O0nqtxmYSIVwHe3qzHMbYy3NvP3p4/D1UweHjC3XVvyDOleuKbnbDU3BkyGE9ZI5U38P3ezie+G6oWCkr6FnIaldker4BUt4KpNioeNLdwrzdaVEH33f1VWxWSysthFvn1yOCBV0RWzMY9VRBnxVVKRVUB6dSnTBlPNWUbvE8AqtDdCgbl0BAvJSuWkH7WPaRANSLZPYXsWLnUug3a/sVzee7oJFwBNu7XpLuSvKg/ZSQOOrLrj4MU9h8oqkDpoWU4GnHyEqF6JbslH0EUmILtxkTS1RJOoUnGXBCzdiiRTL/C8OUWAyMvBuszqzboMU0irjAQs/wSxKweRGYiePfLaLZ0nlc84npLoqCATPDyfKA9X6vzBhiyvjY0gwe7b420c3UAZGHnEatk4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6497fe5f-e2fc-48d8-0908-08dc4a61a75f X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 11:17:26.1145 (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: 00+g14U8gLUtnSVK0bnpmaY2jwriwj8nnao3Vc1+wYCNB41lxUOxDfda1sUWAp0ffmYL7nogAwny99BuTp7SiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB6424 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-03-22_07,2024-03-21_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2403210000 definitions=main-2403220080 X-Proofpoint-GUID: Ki6385uFnDY7nispPv4gizfq_csprtGC X-Proofpoint-ORIG-GUID: Ki6385uFnDY7nispPv4gizfq_csprtGC The btrfs-corrupt-block -v has been replaced with --value so fix it. _fsv_scratch_corrupt_merkle_tree() uses the btrfs-corrupt-block --value option, so add the "value" prerequisite in the function _require_fsverity_corruption. Signed-off-by: Anand Jain Reviewed-by: Zorro Lang --- common/verity | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/verity b/common/verity index 03d175ce1b7a..59b67e12010a 100644 --- a/common/verity +++ b/common/verity @@ -191,7 +191,7 @@ _require_fsverity_corruption() { _require_xfs_io_command "fiemap" if [ $FSTYP == "btrfs" ]; then - _require_btrfs_corrupt_block + _require_btrfs_corrupt_block "value" fi } @@ -402,7 +402,8 @@ _fsv_scratch_corrupt_merkle_tree() # in the default filesystem tree (-r 5) and corrupt one byte (-b 1) at # $offset (-o $offset) with the ascii representation of the byte we read # (-v $ascii) - $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 -v $ascii -o $offset -b 1 $SCRATCH_DEV + $BTRFS_CORRUPT_BLOCK_PROG -r 5 -I $ino,37,0 \ + --value $ascii --offset $offset -b 1 $SCRATCH_DEV (( offset += 1 )) done _scratch_mount