Message ID | 3c4582c2ab0ac2537ab70bce3ac3270f81468139.1738163840.git.anand.jain@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
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 1240115B102 for <linux-btrfs@vger.kernel.org>; Wed, 29 Jan 2025 15:22:00 +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=1738164122; cv=fail; b=h+KftAP2THBBOjGTX+2GfGa/grJm+StjXVW5eMSk1GNpKvSI4PxQ2tTBh8kwIP0i4Ij3sJWTRyg0gWMVDmhxgNF7E3s1sSe2ac7xkfbNhdjOOOfQ1iBY83I7rfiZYlwuLRFKT7y6NnhIrw2TjuoDEUPbRM4mrKHm/qVRInRWe1s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738164122; c=relaxed/simple; bh=ytPk/GZvxf3CPeoyEDXfQ6ki7yq111mvj57OV7QO2RA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=qt2WnNbS301d6pScr0aSYCFSHczjCdz5rFfR5T3WGw4rtIu5tme+CnTY6/DSjWubZmhgZisUlEVI/IHw+dko+gNUi6tLWtFMnKjNcS7JkgGvaWLxGVK3db6M0NAglpdvekML1bA1zgcUC1nYLFmqiZErP8Amnd0M1gkUfQKhi5o= 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=MZkCt7Vv; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=BjRn9o7w; 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="MZkCt7Vv"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="BjRn9o7w" 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 50TFGxDH011580; Wed, 29 Jan 2025 15:21:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=ZoqfeEIYKSvcHDfTqptEFKI5g2DYVrY/64IOJc5ixAc=; b= MZkCt7VvPY6CZGg6KSbpIgHZxzCXexshWQxp3YUbClShXUQDCWwIrSwVOR/ofVho YmdHv7mX3vxozM8KetPll3NbUHrJkMxLCrMgGX9hxxCiRU9S1ocXl0U1+1yBgqUT YJaQU9J5333SyisflJtfqnK8EDowY2CD23TzluJ5rQJ0EwWCXNxI3u7er+qeRzHF Kvu/4K7yrfLSo0M4ZeI2tL+/TiIMOLYO4rT8hFFdy3G4taJV1yFGd2q/VBhyGbVv X2YyYgHSw4QMzqIKdLcDoVsGSFMC7VSx7RGncJ5YZMv2I6XW1AiJGqSYKc9cysRt Hdi2jNIUecVsLSom5vgixA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 44fp8e04aw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2025 15:21:58 +0000 (GMT) Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 50TEKSch024257; Wed, 29 Jan 2025 15:21:57 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2040.outbound.protection.outlook.com [104.47.56.40]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 44cpd9vx4h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Jan 2025 15:21:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=u8RgY6NIfGxP/dWtVo3fefZGX1vr7FmmwF+Znr5y6vISoR1uJoJekPzVdCBJKRi7+gKOkujRcAMOvXvkFxiZdHfejwexWXotFDFovU4NM+KoM5fLtH5zmaxtlo2kKqx0b/KS66HwXCMmed5n4B3he3WrDGPavSlWBRvj8PHq1ApbDuF9/69/hO8ht+q3w2DjMS40Vbl2IGkno7qHgEaZz3EGoK8+t5oUOXWnH9oP1ARfL2sOR3NVEx736xUjfy7W5VbURsdYG15puhUpOuWjPhRdIOLer7liVBKiwBZtjoHstc9NYfdooJKNzacc5lopdwNAIlyWc4iZ/95sK+akSg== 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=ZoqfeEIYKSvcHDfTqptEFKI5g2DYVrY/64IOJc5ixAc=; b=C70LLRp9C7YWKqL/w7M89/xIRe4qF2lDvHWtc7MwNYK8/D4356t1BPjvcai6ukrByocXnWitPcY0BmVCYy4m9CIpWxEiUpPXE5aWoHGzwIyag3lhc7fehc43231n4KfjTD11K0bnw6a2zlTlPGswW8tnMxVQpsqqcOeWTsO+sesMuRrIiPPjNKI4nnf4dTOX8iLSwiRulPw8pOTrb9Cp8b2JBbXbc2szkwcOooJEmAAcPCGPm6dBtuk0KZUi91l1JSOuEq2wJ8I2RL/QW5VKKTCHrJBCOeUaAREe+PCTbAmxp1U4J08CNNlkcBWKR/+8PvnfAQX5HdJLfflXJ9nxcg== 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=ZoqfeEIYKSvcHDfTqptEFKI5g2DYVrY/64IOJc5ixAc=; b=BjRn9o7wG69dfHOoyaXWgNqu92W1u2uOZvZ/t03KHx29Z00pMSqRaPnjNkk34gX5quCh8/nOsZkdCWytQpXNAwTFpv8RSlqxJLrBFo0z1+yc4MHLBbZpEfJyE/iNlI5zLO5MnvOkkQFU8xTPxQ6fbFSo2rIE0KF+Rt+/Av2kNA4= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by CY8PR10MB6514.namprd10.prod.outlook.com (2603:10b6:930:5e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.17; Wed, 29 Jan 2025 15:21:55 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::fea:df00:2d94:cb65%3]) with mapi id 15.20.8377.021; Wed, 29 Jan 2025 15:21:54 +0000 From: Anand Jain <anand.jain@oracle.com> To: linux-btrfs@vger.kernel.org, dsterba@suse.com Subject: [PATCH v2] btrfs: sysfs: accept size suffixes for read policy values Date: Wed, 29 Jan 2025 23:21:46 +0800 Message-ID: <3c4582c2ab0ac2537ab70bce3ac3270f81468139.1738163840.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <8f77c6490a181cb0bb16c6b11131723e46c41108.1737566842.git.anand.jain@oracle.com> References: <8f77c6490a181cb0bb16c6b11131723e46c41108.1737566842.git.anand.jain@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG3P274CA0010.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:be::22) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: <linux-btrfs.vger.kernel.org> List-Subscribe: <mailto:linux-btrfs+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-btrfs+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|CY8PR10MB6514:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c45e885-aeaf-4587-5dc1-08dd4078a9d3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014; X-Microsoft-Antispam-Message-Info: s2MLwMobX9VaVoqhj+vbGsKe7xuolQuuqgG5H3v+SJepuhRI23UnB74IHHvS775nJNGtwU3Qwu2OqU+7hMdRPd/wENPuTf3GEOu8HBYDnAcNWo4B2DXNaZlkmeFe2DlfP/XFfrAfrhrbppIc9lXu3K1hi+1jUgJ2TyDv8rTogMP9BlS2gqgaR+2MYqud6YSVMunBXr15O3NK7RfHAOmAhbIBRoe8JD5pIez+DgqqKFiVNp1B9uqdBMIJb3i3kcxlNc2ZUCDHzd5FPcIFLPcLbI2n8hadbq2h76/aZeDoYEIs2ERI8g/HGsF0uSSowFrEG3VVyNeiQ1pAbyYIo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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:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /F3gX2tw0qIrdIXKBYgNWxL4pshnnsRGiR5QxYMn8xO37+2D2QxHMCT7GeeV1Zf7qWXRwh7WSWPDkOWZrweKySHWtrkPw8TDmJoQVd3Gw43xh1QlCsyrYODeMPm3/IXNBQXe9OMiGa3maEdK0qLzYl4C1weO5xI8UVnkxZk4BW42wab/kxLVOhPdcGrq+jwR7yu+bF5jFUA5dr3kzJ8b/kijQOQwfa9b+X211d9kdXELtO+ZSgYt0is1bJxgx/+oJWuiC+DmxkCbYb/u30aJnR3gMkV8heJ0q8fflrX+XSIpo3bC5YgYdVTn5pilXIFLDry/sjLNVa/4w4PCz0vD+3Fw1klzLKHSuK7P9vHWQZJSSGYjisbnLG5V9fCvctq7JmlXpHFUR9Jk320XQ0VcRyiSbk/0L/s0J2hNUv3k5xbK4aykBlEWnxtUSRAwTBejPgnjkp6J5uU8UXhTm4ZATrTrswRTtMoScI5Kj1heQwsQILoYahQFLU+thgYrQjOFKn2chapHJxZqqxGsm76xUqEVHqY1SemKBauZSCDhs4rRM5ZF3viIzo/Bj1/s0/p0Dmr2XiiOnLUiuR1wypIZ+vLALTSZ2nAPLRXtIt93nxqzHYRTwOaFk2QRjQvXh3MZJKF/l8i9osBerR7C7C0RusfdusFVZX6LhP8SYEaQlyk063b2nFRtQAZEOMIk4TCAWQhbl703qUvqG0pt7IGFBCxWj77UXWLEJbI+dLc/15MPgnBcvrB0UkoQKn81YFms4DTMtm/pN72fDQXze8aYPi4Y7YR17GMuLYtM7QVk2BeoXRCMmyXVODBZltpjSM2wpIgu7FuHBjxIwZ86zq6vIMWyYnb/huUWiwHQc2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z38i+N3KEVeHf2RcpUvOqDEqruqDPYoNTfx/lPV3pkMnvrmzGwc6zlNzIgoYhkc5+bkg4oBgMGj0bD7ipvd7+Otx2atNinO7a+q3rQghvvw6GRKcrlY4rDhucGOAoBgk1/Q6f1734QGFTu1AmU7SLYNV1o1VPl22g/3HvHGYLCv3WszWqUhtH74sOuqFLdT5WLpjMOlzGAhuUz+Z5qsCTCRGy43UX/dZrA7kPNEIJGoTRjY7KiQQU09MdsAVoSu6l8vehlJ1DZKK+AQRt+hhC0MDG65jebJUdLk1jEI4Sg7X/1TieR1ELGRA6B8pviUUacT0VvffTSRtoNIrbsjcTAU29LuzcQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c45e885-aeaf-4587-5dc1-08dd4078a9d3 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2025 15:21:54.7303 (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: We9l1PMKVIz5wVYD7T+9v3Dwe5fLn7+WUacZELrhY/fLihN7UhVfjqJ9Fhsmc4uVTsZcpRwRCYzxI7PZ6f7euA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6514 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=2025-01-29_02,2025-01-29_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 mlxscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2501290123 X-Proofpoint-ORIG-GUID: _yriSMCtMIdKTlBYK8-MjRfQFeXiV6Cn X-Proofpoint-GUID: _yriSMCtMIdKTlBYK8-MjRfQFeXiV6Cn |
Series |
[v2] btrfs: sysfs: accept size suffixes for read policy values
|
expand
|
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c index 53b846d99ece..cb6af316fffd 100644 --- a/fs/btrfs/sysfs.c +++ b/fs/btrfs/sysfs.c @@ -1342,17 +1342,18 @@ int btrfs_read_policy_to_enum(const char *str, s64 *value_ret) /* Separate value from input in policy:value format. */ value_str = strchr(param, ':'); if (value_str) { - int ret; + char *retptr; *value_str = 0; value_str++; if (!value_ret) return -EINVAL; - ret = kstrtos64(value_str, 10, value_ret); - if (ret) + + *value_ret = memparse(value_str, &retptr); + /* There could be any trailing typos after the value. */ + retptr = skip_spaces(retptr); + if (*retptr != 0 || *value_ret <= 0) return -EINVAL; - if (*value_ret < 0) - return -ERANGE; } #endif