From patchwork Wed Dec 18 19:17:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catherine Hoang X-Patchwork-Id: 13914078 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 C912D15749C; Wed, 18 Dec 2024 19:18:02 +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=1734549484; cv=fail; b=AS7JniNCBC0+5CKFEqwsu1twoxnBs2s5nEIM1IppgeuuXAsv90gldmITdy7nlTL1L2qbxa5Lr0x+CRI1Uee81p3Eyfke8cI3ku5gsWHdqaQejvDF14OTmYJn91yvXgTXXB6LydElZCVMw/9hrmnPIvw74yQk9QXaX7sUCQxhPFM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734549484; c=relaxed/simple; bh=TXd4bl8cugnlVSyzTtz0HvhSDT2SkrXNW1t/Njl8vLw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=c1k0IcgmiYDDh590XM6+hJpOChrIPBFr/3DbPDEvJv1I//GDGOwSgC/vCoOwPL6BgIb5e1U4maFVNlDSyljovpkQCQs+ALJFUfPN0+QOrEtA1c4LDHcYhJ4gQi8EqVG0P3lsY9GWrPpmA0qb1XgFWOGimHi+s4jIayK7cj8Klo0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject 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=O7zi5Aq4; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=pIobLkDQ; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject 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="O7zi5Aq4"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="pIobLkDQ" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BIHQlkl012926; Wed, 18 Dec 2024 19:18:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=M5hqBXp1VP9dRMkW/mIo7rnXW5ncHroe+FsN84CMAfQ=; b= O7zi5Aq46NXbqLB7Q7DAjW8DNsL1wMPBDmoSGgHJLp3j6gFni0aIYy+9q/Ss9KM7 J6grqSAf2RpS/HydaYQzcdPkSTSYcyHLnqDlq0E5eKnbrE+DmJR2we6lOlsJmY0D T0alV30wutW/jR0rDUUzhdWiXVlIBncI6ej7yxxdPucRPksGJ/gCtsKr2XX/ebUX SBVjnXJcQSzPdbeJWUVQgpSlrkY2PkKRLkZbElVuXFE0+IwNeTK/E1OqKhV3en66 eJYcd59DDiyUeVTNw8voj/me7tYrY09/Bj+FArL0XH+Po08uXyNijGZdMdjgFoRl 8WVckOQxAhpAxgX6ZqkI0A== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 43h0xb1fjt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:18:01 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4BIHUWou000589; Wed, 18 Dec 2024 19:18:01 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 43h0fad5nt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Dec 2024 19:18:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cvFKOPUXyavFrzf3QbAP2TuHvMvQWPIGBT4gl4AznOudm1wU9O0kuaLxgW6f05tG1iZ8wWLfuEKJNgZdJHs0ium8ADJya/7/mJCEO9/rs0kOpqXIZgt1OVWIUouxMR13oLIKC0XIHv1d3epcozfpqbAFVQwBS5bW4ipr3YScEUKZRZJVh1308gW1DApJYOFqFtPrVGNNXjYmaXITSfRKbfxEy/XZFKTMgg+YvpTGcN/3YXE88+1v6fbMQ/H8kqIzraEwgwTGUzTDERwW2dfivVjjy1BQmA5rj67hEgmfPkAtkCWTnXDxSVzoQQOhEFLBo5Sox2mMNQppcjci4dB6dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=M5hqBXp1VP9dRMkW/mIo7rnXW5ncHroe+FsN84CMAfQ=; b=tQxK0/hxEE+tIu6OMqcvbSL1ITrmIls2bit9KENVp99BJuuT3Bb1g3aJMo/DNPdBE1hktCPXcJSBIdf+VESxlROh7u76ySWJ/n8Hm4N+kv8eot3F78vMpgNu/I079sBti4//VkmYbUV7qSdiREM+LiR13+aF/1douMTfzUvIagTH7kmYFUFd7LFGY+/r5htaA4iLe9UM2Hcb6yOqcapnwRPE+AMvq6+AWAov8JO93Xl6uhBLLwG98yhoEnUjpHj+7dZyKPNtjyvEmdGaahVvceUyGPO39Ok4eglF5Lc1YA4WutNfykeuZAPi2cxXt6fq3J7WGB59qWqKpWPj8WLJuQ== 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=M5hqBXp1VP9dRMkW/mIo7rnXW5ncHroe+FsN84CMAfQ=; b=pIobLkDQ9MtSf7FIkZA4HjrbZOMJ0Yw5/NVNcQln++EGEaMFFucLaF49bovRjPuT/I/JkCaTF6elf6slBgGqR57lcuzLPqbs7MsBAPC6xli6r6yaghSRV5yHvuWvMVwgM7A5DyjI8bXAaumkHRgW3N/9nK7H6j+GrSfA29MBhjk= Received: from BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) by CYYPR10MB7673.namprd10.prod.outlook.com (2603:10b6:930:cb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.12; Wed, 18 Dec 2024 19:17:54 +0000 Received: from BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142]) by BLAPR10MB5316.namprd10.prod.outlook.com ([fe80::a63b:c94b:7ed8:4142%6]) with mapi id 15.20.8272.013; Wed, 18 Dec 2024 19:17:54 +0000 From: Catherine Hoang To: stable@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH 6.6 15/17] xfs: use XFS_BUF_DADDR_NULL for daddrs in getfsmap code Date: Wed, 18 Dec 2024 11:17:23 -0800 Message-Id: <20241218191725.63098-16-catherine.hoang@oracle.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20241218191725.63098-1-catherine.hoang@oracle.com> References: <20241218191725.63098-1-catherine.hoang@oracle.com> X-ClientProxiedBy: BYAPR05CA0016.namprd05.prod.outlook.com (2603:10b6:a03:c0::29) To BLAPR10MB5316.namprd10.prod.outlook.com (2603:10b6:208:326::6) Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BLAPR10MB5316:EE_|CYYPR10MB7673:EE_ X-MS-Office365-Filtering-Correlation-Id: d3cd8b23-ad0d-4d84-608c-08dd1f98ac05 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016|10070799003; X-Microsoft-Antispam-Message-Info: TRabxMsofoM3ufigxFFKwFhVqiwCUzfaGkvMOEnYRz4qyx+bQ3TKkRcXaKYSQkRJ03EFDElrYOOF028gdfqVy6KSzAk2nCevUz/W3+x3Toz1Qbh2+Cbb0Ch4zGzOUgD7gpTCy9r3JR+xmM4rGvy7cAEep1bOwdbwtXBJQFe3XvetOLnrnTuKoolTdpF9OsaCaBBNbR/9Wq13/EM3NS0Q9YUJ1CBxiDR+QFJMFHIcuWj3eVPnbuAe4c0vc9dKNkt7gZPiTb4O66czO5tcagKL2e3O5oBJKO/ZpHHsyboRdVnZwozY+mTMhglYOQZaBmLAT1NYr76jLG+nP0I+ZGe/7V5JL4/rKVnY8cY8/v1VzVhPPJsoUsX8rqXf+cDMS8PVTjhi5U/dsFpDktG9b3hRlyAIpBURGqtpVi4xif/y4TjLc2jz8TXq5bH83uoeHH/6+mG+iPoW3l26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z6uo4W3JIhOwPkEs1cNqCUIUv7PQyESg9lzRZObIU2D4moXrRWsWF5j3rRuq2XPF+3iwqCGa+FtFQE9/3RRcumkCrgJLM0B/6PDyt5hQ/0WoCTkPbP03AwzSNvJuGiyTqlJA2LWtopWBqGE50VlOyHP+Hn/XjchWpqZQ29rETOJIIsgYmq2VAk37K0VFOxl6ujYKIbb8pgoaWlBFOYZ0ZK5lRmCcMOEKmAqhpm51JugBX19rAgVcrGBku6EHgBriG5N3Zn7YVTCfi2w9Oj7OdDdQtSUL6jJRL4cz6OZRsTCl+yWMeHJhlnFIXbo4goqtIhLaMNaEyxY= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3cd8b23-ad0d-4d84-608c-08dd1f98ac05 X-MS-Exchange-CrossTenant-AuthSource: BLAPR10MB5316.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Dec 2024 19:17:53.9844 (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: x2ImPU2sDZbNLThusyqr6U0vBqBzyFMUisGOnS/y8UAjID2n9AwLjrf2XGnsFpNH33a0eL6VfGthib549/MXD4A8jphO154RNyAZJd9GhDY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR10MB7673 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-18_06,2024-12-18_02,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412180149 X-Proofpoint-GUID: 1BGLA1VdAdgQXJyF3DWt_UhmWnX00JvR X-Proofpoint-ORIG-GUID: 1BGLA1VdAdgQXJyF3DWt_UhmWnX00JvR From: "Darrick J. Wong" commit 6b35cc8d9239569700cc7cc737c8ed40b8b9cfdb upstream. Use XFS_BUF_DADDR_NULL (instead of a magic sentinel value) to mean "this field is null" like the rest of xfs. Cc: wozizhi@huawei.com Fixes: e89c041338ed6 ("xfs: implement the GETFSMAP ioctl") Reviewed-by: Christoph Hellwig Signed-off-by: Darrick J. Wong Signed-off-by: Chandan Babu R Signed-off-by: Catherine Hoang Acked-by: Darrick J. Wong --- fs/xfs/xfs_fsmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_fsmap.c b/fs/xfs/xfs_fsmap.c index 85953dbd4283..7754d51e1c27 100644 --- a/fs/xfs/xfs_fsmap.c +++ b/fs/xfs/xfs_fsmap.c @@ -252,7 +252,7 @@ xfs_getfsmap_rec_before_start( const struct xfs_rmap_irec *rec, xfs_daddr_t rec_daddr) { - if (info->low_daddr != -1ULL) + if (info->low_daddr != XFS_BUF_DADDR_NULL) return rec_daddr < info->low_daddr; if (info->low.rm_blockcount) return xfs_rmap_compare(rec, &info->low) < 0; @@ -986,7 +986,7 @@ xfs_getfsmap( info.dev = handlers[i].dev; info.last = false; info.pag = NULL; - info.low_daddr = -1ULL; + info.low_daddr = XFS_BUF_DADDR_NULL; info.low.rm_blockcount = 0; error = handlers[i].fn(tp, dkeys, &info); if (error)