From patchwork Wed Jun 28 11:56:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1286EB64DA for ; Wed, 28 Jun 2023 11:56:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbjF1L4q (ORCPT ); Wed, 28 Jun 2023 07:56:46 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:26326 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbjF1L4e (ORCPT ); Wed, 28 Jun 2023 07:56:34 -0400 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 35SBTa0i022253 for ; Wed, 28 Jun 2023 11:56:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=Z/w5Y5SvI5SPpwNkOFxVJ/2dcoWp1m88XWcXV63rX6c=; b=nfjjCaDGgnpi+eD8en1dsaoEpgAMfvQ2X6IfUZgSFkcoJMz/ajtktYbYZMZOG1Gtg133 OhGaMJ0IW/IsyMm7TSPnzwOVXoo8WNm69xD9EAirj6ITsdagAMW6fuIC28LqiFVOoUXu przJC+4eWQrzwtmS9EzWhdSiznZQLvtGuRlAdCXO0qHJGZRCughlDptXo6svCPJh7dtA fc/BqbuSZBJlYJNmB8Afg9miRLMW0URr02CtU1n+nIclZNVhKmLrnQuCUadn3J+aZcwH zr9X6R6rmDrrDJmvE6C8HdE+xVWI5JGBJO8wkevScuwAYN9l4/hn+RNoJrBFL32EY9Rm AA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdqdtq9xr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:56:33 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35SAVTbK008742 for ; Wed, 28 Jun 2023 11:56:33 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx5wdyj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:56:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mcysLYgchd4crDauh4I04+ZwUApccj71uqXpmvEhF3lB63fXsV9GQxMvOPmvThbrF3PDUfz28uSdjwC9CUxAgg2F1K76CutRzd79kodM7gox3gGiej7ECFW/x2Y9QlRKqMU/ZL0KUNPy6wqpGCKTCiowNoHlPgzcH/hfW73/Kq3ueI6qjATP4n9u+QmBXXRzDbKWmcuh36gZkRe2cld0sdI5jClan7+0VoKVXSf41z5ZKHqalrLYLZOVSIy8j4/u/2yCEeSkkU2/+PvBy4rAaXJ0FGvk9FfKLV1aVPfOgSnR9ZOjc3BtOim9s9xAaEhkE7YDoSfDsvm7ePmn36xrYQ== 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=Z/w5Y5SvI5SPpwNkOFxVJ/2dcoWp1m88XWcXV63rX6c=; b=VJnzwJTOZ70gzpUOPzrme7T9QBo5c8TlvgHvRYbJb3gsA8JOI9LIdPE20UA5rQ+WKLA6cOktl+ymfpXowh7266TeosjZicTN/19NwYDxb7yyewLf7O4q4/4u75sINyGw2lR3HgcVaJX5TkFua9P4zljd12nje197XLp4WiF/J0JqvLVeGSWfsZDn+splhL3pGdMY6z0zeb439LAvye0lFmexBfr20wPmh/ZM8uUMeCUdF4aLWT2GpoEVl0dPRMlL4a4A9UNZdUBbBUk6nbLEodf7VT9Xa3yodklc8N4QB7/srnO7eWR9kMvcCCCJP7XnPkBCveSDKBoT26xU++o9Yg== 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=Z/w5Y5SvI5SPpwNkOFxVJ/2dcoWp1m88XWcXV63rX6c=; b=pOjSdCCh3iMzdeb6uB1KZ4mvq/D9Rgb+r66Hrj9TQv1DXLXQ1j4e9NbQt+g+H3nZEivCt1YEYyHGPdtljdBy9YgRlrp/RNgn+FFVskKkX08tq0Ic8ZBf/lJ8vfK8yNO5XUS6AGApDQHL/Sc/+ot+S65MC0Yh36yqOPGQ/pyz2Rg= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:56:31 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:56:31 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 01/10] btrfs-progs: common: add --device option helpers Date: Wed, 28 Jun 2023 19:56:08 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI1PR02CA0027.apcprd02.prod.outlook.com (2603:1096:4:1f4::18) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: 1de7c461-6370-4684-03ac-08db77ceb672 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 51SNcQt0QUV/ckhS4EWbgUnG/FjrbxC/kINJQhVlcAqMIwMDtAoSZ5Tx4hph/QSl2gxzQfTuXXLnq4s54eJjyoZzS51XVV/eEH2GknGmBavee6YGmRqpuztORsVgqV3pvtFqmK43N6UBQ2gvr4xig1sobvpV2owfmb4rugas16pVgtz5GMulOJKtmVqHM8LuQnmGVCAy1pmMMd32LGAKL+9gN9tCwH4yKvNXsfVRMB3lbaIlOgEDA6dZzCRsbhE3BZ/YbB3m+Wvs4U56XXJalCmFqGPjuiV2dOR+/atBp2wGITK63HeaTg+M4VJNlyVkjz7Io2cgv7oMRyrYZKsxVUKQY4srZYfrbzJtq2t8QqLBCjdCQKNvtQ4KsmogYSNjs5VzGo9wlMgj7tN8u7P+D4hYJZIupU6bBj/g20mH/43CQrqYx+m1Qe8S4CAZZadQZUOqxVW4j68DmgkjGpvYtCJGeNkiLcdX9GFkBg2AbnIjdhFi44CqXHAdfJPOf+ydFTDEK8ZEvt6Iku51M/Igd0VcUvoc0IQZb9f8GQSkJz6jMgkU89m8W0dvGik7NInq 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(6512007)(26005)(2906002)(83380400001)(6666004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /JqEG5aPtanCmxvAcq4m9I1rD0l1Z9UnmUCeux6BApoGF2MnILX288Xw3r84/3KlhBGzeMjjJIrUZfDUXV+DTIktaWQrW1qNG1FKN1UkpLyCpfAwyxttlV0ayRZy/6gJcEHFSqZtTnF55vfz0ZcUuolUWDYeyRTBd8ohnPR5XL8Eiaku11CGcoeXl6FIlBd5N823DfU1z8DDnhFLDJbULhz4PDxMSeNibgRVMUl/2nmGJ9YUDs8a90h5Pwn2vR+brLLXEHShwroQ07NkTxWercJQCa8M1BQFfYog9cL6SlwZlm35u9Rfo2CTMpKkzEIv16NbWz5yU9nVc+16WpjZ6SOpZ6N2e8dHtlN1Ks9YcOTPhT0G7x8T5LpiZ3cXlUUcsUqq1gLniYtW+E1sPaVFkYIsO09HrBTnzn1x+cbYoNCUMG6TezGvQqavME/Yj8IOrDBh679Tnpbh1MeXoEiyVUQ4+Vi/9BulOuORMi/o1b4PrDeFn/ngcx9itp4feMoi9AyPsGT1inG3zqc7BunxgK90yNVXUbpYjTybyGORsziceSMZIcuujmh4x0+pd774Or2/Z9sRnC4aJo60+r2RW3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0: G2ZVbr65hM3Ll1FpXNVTNklAyCjAICkKkqznvfD5ksx4TT6eYFIP6C3r6yhEJcbPcONcdxE2LoQnMTp39WmybxHQBbzzr7ZK8DO8Ja0E4kYEs5uTN3k1SZZs0wBIjUt4idRCoiO8HpC5m7t99WmyPVLI14fsL0uKDBIZcDvSTWRalj4TOQ8PlKBRIl/NTNjEAQASFYuZlUL76A4ZF+UKksEHknAU6apw2JoRdLh0tsLjbk44Xm4lBVsssQj73CxwpH0Fi4WP6qD086l4lPH/wLNJPpG6ft/eZcuFCYW8wiMwk6LM5Yd8CjVsJD1Znqndgz9uwiVDaakWK2gAt12oIwOsWvvTiyzVGPlZfheV4Ni8vMRIL88Seyk5iJ0vX5+Hf13vcCRb3VPpLrDKLyhvbO5ssmSem956BMYOXB68fsIG/cQlNNb+PMqSTlrUP7msUiweHGtK80sb9aWNRVRIExG/p/0VfL7iUQWNgDWCm8jMjcaMpdl8OcVRKjWADcrD4VokMZEmEuovQkSvBKMMZ8qyRgoePfbUZLXDef4TdTejdalURB/2YCla48uTo0tTe4VJ3eBWdFa4skmaPteuwMPViXWWEsQ3p6oNFW6q0LJjqQZfrQ1WLtnkE5HAw9nIhyUT4Vt2c5PTPy9wYhrWjmlpbSyiLmHBVxUwVs0VE5YztKLF6zUzG1A86SLoEzYYTnx18c2sYmdac5GUSL2RbVOKfoFybL5qBmrjGpNq2X5PTIUPoMJ4+KdH4V0NYUYK2TGO4x00eLULLIVVzUDQ1w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1de7c461-6370-4684-03ac-08db77ceb672 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:56:31.3678 (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: JAbvTZOk+9E8GDbhLAGAmc4cRoasOlWRgiRywF2WqSFGdYqF610n3w/nP1SOEfYXtBOGjb0zF22aEKpS97TVxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-GUID: VZAFPMqLMXlJzA-UCi2vujw2VDOLq3Pm X-Proofpoint-ORIG-GUID: VZAFPMqLMXlJzA-UCi2vujw2VDOLq3Pm Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Preparatory patch adds two helper functions: array_append() and free_array(), which facilitate reading the device list provided at the --device option. Signed-off-by: Anand Jain --- common/device-scan.c | 32 ++++++++++++++++++++++++++++++++ common/device-scan.h | 2 ++ 2 files changed, 34 insertions(+) diff --git a/common/device-scan.c b/common/device-scan.c index 68b94ecd9d77..ba11c58d00d2 100644 --- a/common/device-scan.c +++ b/common/device-scan.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #ifdef HAVE_LIBUDEV @@ -540,3 +541,34 @@ int btrfs_scan_argv_devices(int dev_optind, int dev_argc, char **dev_argv) return 0; } + +bool array_append(char **dest, char *src, int *cnt) +{ + char *this_tok = strtok(src, ","); + int ret_cnt = *cnt; + + while(this_tok != NULL) { + ret_cnt++; + dest = realloc(dest, sizeof(char *) * ret_cnt); + if (!dest) + return false; + + dest[ret_cnt - 1] = strdup(this_tok); + *cnt = ret_cnt; + + this_tok = strtok(NULL, ","); + } + + return true; +} + +void free_array(char **prt, int cnt) +{ + if (!prt) + return; + + for (int i = 0; i < cnt; i++) + free(prt[i]); + + free(prt); +} diff --git a/common/device-scan.h b/common/device-scan.h index 0d0f081134f2..d3b5f7d2753f 100644 --- a/common/device-scan.h +++ b/common/device-scan.h @@ -59,5 +59,7 @@ int add_seen_fsid(u8 *fsid, struct seen_fsid *seen_fsid_hash[], void free_seen_fsid(struct seen_fsid *seen_fsid_hash[]); int test_uuid_unique(const char *uuid_str); int btrfs_scan_argv_devices(int dev_optind, int argc, char **argv); +bool array_append(char **dest, char *src, int *cnt); +void free_array(char **prt, int cnt); #endif From patchwork Wed Jun 28 11:56:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17378EB64DC for ; Wed, 28 Jun 2023 11:56:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231605AbjF1L4r (ORCPT ); Wed, 28 Jun 2023 07:56:47 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:37880 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231161AbjF1L4k (ORCPT ); Wed, 28 Jun 2023 07:56:40 -0400 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 35SBTD8V032742 for ; Wed, 28 Jun 2023 11:56:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=AQUOyrJc5//iZmCmNe48oI9hTZBhAJBsg5w5WX7TDI4=; b=LEDT5o02qVk4P2AGrB+mwMGFrnihYj5p4wTdqyEILqXID5IyyOwN0G/R4z754qO/ltZI 1URzUUeKUjvIb84pwH69R0QX1UaohGFZdQ2QiQ852vKo0zVZXPEyyQIXd/Rf3+hfU7i1 iRJJAOmw/8piUV2vF89K2ggQC1WjJDlim2ZzGLsksw4FpavL9m0LdVs3ND2vcwakGyC4 E/w45/riZY0lLIck0pU2kTduSWWfrLHFKqpDAmv+VTMWD1d0i3ntaRnAyf2A4M47riHw Fa9z2fie+JPjX+jMDna3T/D3+vJ9fzUnWXFABbBqh8ELHxO9eOrGOuYcA27WOFVZhIyr 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 3rdq30yds1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:56:40 +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 35SBBweT029619 for ; Wed, 28 Jun 2023 11:56:39 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx5wabf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:56:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bc+Y6YXOiqDhNvvClkYT/vNfmY/ComiMTiGZBoJ//IKHQzTOAWfAWaMIN/KHwJIuFuo1tUSCJNYxReZyHLho3b8T0BFNsGwV1Zl9NZRCJcKfB7OnBN1J6agJCQgTb1F4SfoEA4g0v19szJpdzrCZQlV18P7Ofo2i+AAYHSHEz0tbjyw0buoUZaAnDJZJWT3+3DqKcBXG3S1m7KLUXSm5ud1fFz3IJwXuA8uliw6dBd8WBG3keuwCR+mwf8kIw3zsaZ9PbydaSMm7Bk2ygnjvwUkHm/JNwb9G3nWkeCJRPRAkDWrZAXLZd2rwFwWcQQzbNSEGt1Qr/EOGjE7bh3c+PA== 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=AQUOyrJc5//iZmCmNe48oI9hTZBhAJBsg5w5WX7TDI4=; b=QGaLLYLvKmtSQqf40BiXyBVBjrzmysUKu8NTzEX9PCrrSMspjJoJ0xqd90A/GPcJqllTsl/9tMxDOzX4l99lN/+uU9XdaXa2mKKceqPM2i21uAoN51dE1jhw4KvHV9q2psbo6+w3l0N+0SwXWCPkhveA7WTBWzKjH2XS0T1xyU+DjsUZ743mwHPMgqgiFmIsx+ZLrALfVfRwRXkxLtMx+cXMgvWnSGUgslhOy87UxQMX8cVt6VCAFbbSPH1lRKbAFcvExqTJRmhb5ZWKifOZ+Wsg1KdGvc6634jHugQmrAHMxOpOTwZTMQdVLVntpCRPASbIlAkOrwAz4aDuN2n8Jg== 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=AQUOyrJc5//iZmCmNe48oI9hTZBhAJBsg5w5WX7TDI4=; b=U17VBAHxaJMU0WCebqGeQSr4jTufUt3vsbFex88v0VIoHnG/63D8kDluvpyGavYWN8nZRSuRJ7xl4Yj0xzQgbfPgixwwKAIbDVt0XvAPoKh1ePh0ndujUcsDlVZZ4iw1FLfSahmFIcVxQalfG/HQf+yvZYLPUuW+3DkQsavHqU8= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:56:37 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:56:37 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 02/10] btrfs-progs: tune: consolidate return goto free-out Date: Wed, 28 Jun 2023 19:56:09 +0800 Message-Id: <07e80c700e3bdaf4acf7468237c5d31051d7563b.1687943122.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR02CA0061.apcprd02.prod.outlook.com (2603:1096:4:54::25) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: a57b7df4-aa16-4ada-2ce6-08db77ceba5b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1/H10Bq5h+AI1DS+/XdIM1TdZtFPbIXhMelRk170v0+97liLWEFi8kvIHmGI/YgSFG9zpJbtiQBDkyPklGwbNAmihQXAalVv4b7LxuzDfyhL1XUmfccgzSUebt6BliOrUcfObG8GAyKWHuzuA5jP0IKpF6Xh7+TOJ7RSCDhZYvcZzflPux13xxN5kHCltqWFUObQI3bsvFrKLdiO8EMgjpFy0YvZiRuUCEB8ajeZ6vs4CeofedtC8h4lYe8+8jtDgIppVaYGsXFIzRXvNET4TZhaH5rtOat4JvgTp3WOKnh+Wq4RO+veGHSNPue73vwd1489NW7mK3QRF6BqJximSQU9BzDPVhGfeHBZw+7yF3g2sKaHSgkGbB5p5Wt007XhM0RdFR4g7vg33W+dgK56v1/oKtfo+/fIB3AaL9IOAwjlJT2KcXOqejFXmlDo2MY+gg602WryEO/U4a9rZjv/txOf7v7EzKcfXg/fV05Snjb0gBcNeUYk6Q8sOmFo6GuAMUnSVb1SQR4od0QjrL2Sqbu0wGiwIW1nEwnLgLZJfHa3jfenten76AuRB1viHzIW 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(6512007)(26005)(2906002)(83380400001)(6666004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gqfvRyr/UvsW8Pz4VU2QML6/+aRmv/VtHjxJKxb3UbxJxRMl/d4EkdMBNpnV5I+1xW2e4u3E9SyT3NGVN7j37hGBvh/OW5fLiL6iaUFvYbuOKTMV/BEgTiVCndrxjQIJGrYQMOy9I5TWwc5aW8CSuv2sVb6q0p2nQqUSdhMgC2XHKWQEleRUO0Nah48eQWIIX60k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w38+byAmC/jV8DQFFJTtbH1yJXnleQ7jOzhOexuTaPzI8FhfqMOHD4/4qiQ40KoOF+Zeww+RpLHc0bYFxikrz68y3NAFq6kq4M4GRh3v7pzoL8PK073jaL0zExNezc5tNncBtdn0FXdK9W1nZ+cKbtyTb9mFuisNynmrys7/f/aZdB6lfpu3DuqgeX3uCB0T/GPFbF6ub6VFAaD5zSH6d2SVb38kTuYreMuOlmEv1DGihENieONSQ6EJyf1obcSymMkhaL7ovclXxsqBcKie5MbdG2HZZVFg2Va/+q+jo+ZQa9LzooUUutp X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: vd/97IAwwxMHahNL7sorNyBEh913Bibquq2DszmQ3d55OgQdkdjbewE7NPKfmCupd/tq5gbTJJJw8yumcVmh1ZPJTCojpmuBST3LJ8LdiFrSAIVtA8r2wqiGICWl9k+f5zhEIRLn8bo79tJZzfsb7khviSdDE4nTsd9mJc06nwPgcs6ZvviaAryO4DZm+NXXDHAar4KRxJaPr1k8cxHeBrydkAN+ng9uI9pG3Tl4SyX4IDD97iADncKwIV9I7uvFtNkJOBXln6r55EVjglIPfL9vu5KHU/iDFS98oP7nc2AzDCRexzcpCg1l9ER7fldIeLE8S8oK/Uw3HGpoV2VupMHhvczSP1kD1I/fs7mwWM1qMY5Gv/JifvrG3p9NnJCpUlRGiuHpNOBJpEDBl8Yl5Hn2lhDHZdRYm/P14Ol1Z2OGJE0TfuIIgFCM1tj0ydO940jKVYwUrm/02K4zN81iNuwGemGtt36T/vi6BvJal32wo/OZXqAfchFdb+CCIjRXycc8JA9a+20Oo6jCaWAjSMXniPZ79B00SAC3jP3ia/qPqSwuRXa4BaQUQDJM3IWSbW+W3YNhKP4Nv2R3yubOZ8yaZTJxVJHBs3uCn+kdPCf3atObZiQahiOKLI3lLnKUAzFEkr0PPmqbRnMXxuQA/t7iZClqfIk1J9t2Z0yC3YuAg5yKUSaL5pBam/l/aefkwH09hZ6nr2hgPIAJOHICZvBtEiXNh0S1F6JRESC+nE01rEwnG+ae4JOzb1K2/uKrFOIYKFfcmHh7WWVEpjBiZA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a57b7df4-aa16-4ada-2ce6-08db77ceba5b X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:56:37.7713 (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: ia95n5f0eYUKEhivcWwkCqn7cYNOUjbRYlz4Qef90fEFWMUHuw4INMmxRA35/olKWPgKIQmNPiR8HneG86G7qA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-ORIG-GUID: QTjKO0o60p1m825rZ8qS7VfRr57d3GI2 X-Proofpoint-GUID: QTjKO0o60p1m825rZ8qS7VfRr57d3GI2 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The upcoming "--device" option requires memory to parse devices, which should be freed before returning from the main() function. As a preparation for adding the "--device" option to the "btrfstune" command, provide a consolidated error return exit from the main function with a "goto" labeled "free_out". The label "free_out" may not make sense currently, but it will when the "--device" option is added. There are several return statements within the main function, and changing all of them in the main "--device" feature patch would deviate from the actual for the feature changes. Hence, it made sense to create a preparatory patch. The return value for any failure remains the same as in the original code. Signed-off-by: Anand Jain --- tune/main.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tune/main.c b/tune/main.c index 0ca1e01282c9..0c8872dcdee5 100644 --- a/tune/main.c +++ b/tune/main.c @@ -145,7 +145,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) bool to_fst = false; int csum_type = -1; char *new_fsid_str = NULL; - int ret; + int ret = 1; u64 super_flags = 0; int fd = -1; @@ -233,18 +233,18 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) set_argv0(argv); device = argv[optind]; if (check_argc_exact(argc - optind, 1)) - return 1; + goto free_out; if (random_fsid && new_fsid_str) { error("random fsid can't be used with specified fsid"); - return 1; + goto free_out; } if (!super_flags && !seeding_flag && !(random_fsid || new_fsid_str) && !change_metadata_uuid && csum_type == -1 && !to_bg_tree && !to_extent_tree && !to_fst) { error("at least one option should be specified"); usage(&tune_cmd, 1); - return 1; + goto free_out; } if (new_fsid_str) { @@ -253,18 +253,21 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) ret = uuid_parse(new_fsid_str, tmp); if (ret < 0) { error("could not parse UUID: %s", new_fsid_str); - return 1; + ret = 1; + goto free_out; } if (!test_uuid_unique(new_fsid_str)) { error("fsid %s is not unique", new_fsid_str); - return 1; + ret = 1; + goto free_out; } } fd = open(device, O_RDWR); if (fd < 0) { error("mount check: cannot open %s: %m", device); - return 1; + ret = 1; + goto free_out; } ret = check_mounted_where(fd, device, NULL, 0, NULL, @@ -273,18 +276,21 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) errno = -ret; error("could not check mount status of %s: %m", device); close(fd); - return 1; + ret = 1; + goto free_out; } else if (ret) { error("%s is mounted", device); close(fd); - return 1; + ret = 1; + goto free_out; } root = open_ctree_fd(fd, device, 0, ctree_flags); if (!root) { error("open ctree failed"); - return 1; + ret = 1; + goto free_out; } if (to_bg_tree) { @@ -431,5 +437,6 @@ out: close_ctree(root); btrfs_close_all_devices(); +free_out: return ret; } From patchwork Wed Jun 28 11:56:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295638 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80549EB64DA for ; Wed, 28 Jun 2023 11:56:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231696AbjF1L4u (ORCPT ); Wed, 28 Jun 2023 07:56:50 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:49372 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231743AbjF1L4q (ORCPT ); Wed, 28 Jun 2023 07:56:46 -0400 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 35SBTqjU022794 for ; Wed, 28 Jun 2023 11:56:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=cbcO8yxPKmp46k7uri26D/xzTqdDhJAWykt9keeYsco=; b=dQSP+Gu7N0P7kU7Uf0ky05A4C8a/M1HUcTzppLSC36gXCEbZKP+mUX7VOSH/p0Cqd4Jy 3Xb3OUFBkDZYk3gfW0ktmyNUSc/hNJoDo6Fla2FtX+PbngfzWBIrQrQbTKGtZht/lbyN WO5cwm7MU8HNGdonJkg0tQK9pcwPyrFBGj8PJ5Pu1qpVDYt+CxXKxtzeZNq5dCdXhNep 6XbRkhMyv13Yvrl+W62+lU4O3maLCFvi4aiN7YEclBazk1dhSrVOPm+sMcwYnD3kjJE4 VLj2vfHaGnVC99FfIIi6XAr/H/RFZbgXanbpqkEGs+aiYPANl6zjEtt6nM4hsockDW+u SQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdqdtq9y6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:56:46 +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 35SBN3MD013097 for ; Wed, 28 Jun 2023 11:56:45 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2105.outbound.protection.outlook.com [104.47.58.105]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx64vsm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:56:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q7EPJjR4I6kOREvyvTnfXY3gelc3F+THxGF+eaWD3rpdqBRPEmZjbNfvv2CcVT0jvCToc+C8CnP3wqKrOPXHqP4HfYj8DDx4RLtGwW2T80PcGPp/pEPkNshJAoVbZZdnQU2jZtwd1nWy6xUHS6r80VR67kODFmVkl/y9c/85SRaooRGg9F2d3QRmAgOVUJ7D9wgwKUQScgRsqBGBKe/VG0TStC72qiJ630zyIvNXyhD6bTYNP1LJnnTPn7Fp+UVSVzFiaDukeeglyCY00nH596gIKT/dp9c7ycjiOTiWS5LfljdNMsQ9TZSNgzhCofhLwzbGR7e7urlUi1IxPTS86Q== 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=cbcO8yxPKmp46k7uri26D/xzTqdDhJAWykt9keeYsco=; b=Dh5XZ0MZQayVhWhAmNI61Lb6+uCo147stUvfExb3ZCzo49Dmuo6HsUpCimKBnSkeeE5CYgUTwgAbd46DRo0Z+shfmpsqfkmT/1exsOo7yGRebIzWGhAT+v2/rFFTA1LCWFj/h9yiGR1D5GuCIwmQCbvXoq9EbHWN80MBn5dneE153ChBvQgvFFqWPFqV7+IKYxIJEjXQNEowwS2q3XELvZ+zHIRPBgkovfNsgBco54oCCKbSN8T4/3zrHuIBUoaJW5iOw05NxiXBbI+CBFUmhehXAnVfM3rXNu61sSMxdWdJPPbSOL4DfTSO+XARfiUkrMa3yV2zlAAxExSc7rz0IQ== 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=cbcO8yxPKmp46k7uri26D/xzTqdDhJAWykt9keeYsco=; b=jTU+Z5iRxUHz6MHHqtj37ihqcH44FQmmVhvNmIDfq+Dg7o8SwdGYj2KkDGkiuSaOTKfdgwcpvHKKWNfWw6HxLQ9DBfx6ElfCyTQpPTkfkvnK+pPyRvWUZJqtbuoTzmMwBxspMtt/jpDr3DzfdatNWKMTomgVv/xpIul2mRxCBso= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:56:43 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:56:43 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 03/10] btrfs-progs: tune: introduce --device option Date: Wed, 28 Jun 2023 19:56:10 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SG2PR03CA0091.apcprd03.prod.outlook.com (2603:1096:4:7c::19) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: a47e479d-2d5b-4bf1-c44e-08db77cebdca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kVYPKs3MuQOo7VRWqQD+K34Wikf4w3VBgJ3Dp/2jlrDxlUO3KWpw7WdmAgcZ4yvEVXEyExluYB4yQrZqrTCgiCH9nYFddvAQVEVjIGTPnc/gevdz5vb/kc/QO13A2Fu2uD3GO7zl76z+yaiYwCkDZysEdf5q8MtCMcTmFd5eEHGg9aVtWmHHX5kMBXW8yqYEindk69s74Jf6DDgHXT1LZNnNgeRL6KnHK6xXYGw0mx3wjf36eFeeSOUXcamOYF4oe9i/0nn9q9zNvtWFdj/ggxasA/635shlCAmhDYtZ23G6mUON3KlogMZOBkYt6OQECGXsBK3OrsQip4Kdu3tOyye44h0al6DPeE0TjwCWzuEtFffB/gDaeL0/bZPNSNHZOivgMz348wJ08+dthZal4N8tjplU8g3wBjQwHZsMMG2xgqQ2lY/Qc4qGORNg6uULRl0dxMRwpZANyh9IM0DGcfDkGFN+AbcywwsT/1PxdwYigB+9+9FcGHF+g74u5acXF7ejI+2mKYZfYAu4jQcac/wxOWjlwVuTLyTCqSG1+5u+OqK98GKMTftmKy0ws9UT3MOtcZgTZUAJIX0+MumUiuFGlhdEyGWB3biSHo41xjM= 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(6512007)(26005)(2906002)(83380400001)(6666004)(2616005)(461764006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S8XAagCqoWQBt0mF9araySDAoHfdxOvQUvvnVoy3DCJWVgQtJrMkmR+imMCn9IQIIpVwKkoRVzc8fPPtFxTByqXqtnsVPoxBH83eGOadp33U9GKg6Rpz1vu/PmUfRDoKYRkfVH2cCRdnim6h1r1TjJdL9gvXHMzdbt5jcy87f4F4ZDjE75o9J0e3eYQ4n1+CNlVhXs/WRS+s+SYnHkBwu8QbX5l5yDJJnNggQM0MpfgCrehIpQ4h0jVFTn89jqqVPT1Wo6UaQOxbVsVxkWDBemETcjm7pqX1v21kOC871wNPxkiTPFdhiYl2rafLMvvLlglRmGypfCoDMsljx7s3mgoRE375NlaiVe9K/iQVz+UafYw5xMmvplqGo3qw7Wh9aWTARSj3mSki+VSySQhjAGID2VRvd1Dvtcmqs42IpBfCd2QBACYUgI9ubDhiwtPprdmrvrAihXkHmPLWhvIRY+rTVQ9w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IeIE6a5V0nthQ2zJC+Fsf4IDjgOX6EoajfOWIV+C62y/+dG X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 3AVEajBi/+YFLGd75bl1DJHODsQWmTrH2UciNKvOGJSK06Gbv/idEMIBTKo7UZ6IV5cx4ox6z9ep9vi0qTA60hVLmVln4lpaZFd657e+s1z3yHPm2V4mJzhD3sfQFsMI/WsFabdDUj2ggpn5cVQIZlelh+caEIM4WwpWMaipQVi87hcVJep3DAzwPPNjsDOXWZKc/PfBWxhpcWFv1acPupA8zw13gTOMc0dNNNb/gWpg40mgX7kDYfDCjzKMOTggn7inhiAm7qGnop6LbwA5rRPqm8GtF656hntBrxfGOquBYUqQptSuGEEmQK3KsaXhiN2RXhkuV0X6LwJmnAtb4/ugQEJFI2LErKkifHKiBuLP9z8n1J5RGqGU6Hhqmi1ZgA7lMbDeU60htlG9vFdpntqAR8boO37xhd16ANE7ZdxpIOLKpXB2S5ljOo+4XRRNrrE6xU0t6WB+WvPd0OLgbRr0gScKxlpXGbGF83JxMiOxJCsHjz3fiDQ0zbLovtc/haGljINE4rjFYBYpCw0HvC74+bOweRfZdtqnPEtgmdqmrhrXDbkMISdTnRHX9IbICw83jmXGJHKytof03ydYUiGwLgYD6GwBy+WJe8OsHQ+owloyqeBOpzrYLf3lI5aeeK0HradeS9K48xbFkuxWJs1dHlggosQipK1U8nRryMD6BBVNm4+vW0ponK902mNVUyQbP0scB0Oh2tRdGtFX1CbXIPdKQV0kvewmdPHICsyYQGO/48BJbJLXrC3BCL0jfxEochGxEXBwTFBrOdbAsg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a47e479d-2d5b-4bf1-c44e-08db77cebdca X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:56:43.7152 (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: nwZlOfB3TyVnbpkjSiNOH/sGIpWoUkHhbp10ExgrAVH93SYgA9ZrRYDXTJlheuR7S3lWYSYdHo2mVe7NfFY1Dw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-GUID: G54r0Szj94EH5w0pgXzj8-jOrHsZasXk X-Proofpoint-ORIG-GUID: G54r0Szj94EH5w0pgXzj8-jOrHsZasXk Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org As of now, btrfstune only accepts one device from the command line and then scans the system to find other parter devices if any. However, this method mandates always accessing the file raw image as a loop device. This patch modifies btrfstune to accept other devices or reg-files from the command line using an option --device and scans/registers them. For example: btrfstune -m --device /tdev/td1,/tdev/td2 /tdev/td3 or btrfstune -m --device /tdev/td1 --device /tdev/td2 /tdev/td3 Signed-off-by: Anand Jain --- tune/main.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/tune/main.c b/tune/main.c index 0c8872dcdee5..63e3ecc934cc 100644 --- a/tune/main.c +++ b/tune/main.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" @@ -117,6 +118,7 @@ static const char * const tune_usage[] = { "", "General:", OPTLINE("-f", "allow dangerous operations, make sure that you are aware of the dangers"), + OPTLINE("--device", "devices or regular-files of the filesystem to be scanned"), OPTLINE("--help", "print this help"), #if EXPERIMENTAL "", @@ -144,6 +146,8 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) bool to_bg_tree = false; bool to_fst = false; int csum_type = -1; + int argc_devices = 0; + char **argv_devices = NULL; char *new_fsid_str = NULL; int ret = 1; u64 super_flags = 0; @@ -155,7 +159,8 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) enum { GETOPT_VAL_CSUM = GETOPT_VAL_FIRST, GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE, GETOPT_VAL_DISABLE_BLOCK_GROUP_TREE, - GETOPT_VAL_ENABLE_FREE_SPACE_TREE }; + GETOPT_VAL_ENABLE_FREE_SPACE_TREE, + GETOPT_VAL_DEVICE }; static const struct option long_options[] = { { "help", no_argument, NULL, GETOPT_VAL_HELP}, { "convert-to-block-group-tree", no_argument, NULL, @@ -167,6 +172,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) #if EXPERIMENTAL { "csum", required_argument, NULL, GETOPT_VAL_CSUM }, #endif + { "device", required_argument, NULL, GETOPT_VAL_DEVICE }, { NULL, 0, NULL, 0 } }; int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL); @@ -210,6 +216,21 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) case GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE: to_bg_tree = true; break; + case GETOPT_VAL_DEVICE: + if (!argv_devices) { + argv_devices = malloc(sizeof(char *)); + if (!argv_devices) { + error("memory alloc failed"); + return 1; + } + } + + if (!array_append(argv_devices, optarg, + &argc_devices)) { + error("memory alloc failed"); + goto free_out; + } + break; case GETOPT_VAL_DISABLE_BLOCK_GROUP_TREE: to_extent_tree = true; break; @@ -285,6 +306,16 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) goto free_out; } + /* + * check_mounted_where() with noscan == true frees the scanned devices + * scan the command line provided device list now. + */ + if (argv_devices) { + ret = btrfs_scan_argv_devices(0, argc_devices, argv_devices); + if (ret) + goto free_out; + } + root = open_ctree_fd(fd, device, 0, ctree_flags); if (!root) { @@ -438,5 +469,6 @@ out: btrfs_close_all_devices(); free_out: + free_array(argv_devices, argc_devices); return ret; } From patchwork Wed Jun 28 11:56:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58921EB64DC for ; Wed, 28 Jun 2023 11:56:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231172AbjF1L44 (ORCPT ); Wed, 28 Jun 2023 07:56:56 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:45500 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231688AbjF1L4y (ORCPT ); Wed, 28 Jun 2023 07:56:54 -0400 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 35SBT8LG024960 for ; Wed, 28 Jun 2023 11:56:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=5LHVQbpO8MEvKQlTcUWudv+5R53EDHgfjymVlhBesZU=; b=kcU+w8q5j47LNGBTnCLuRoTv40fwrnCJhO1CousWAYjCFZ/HVDCfmpY72pxDxLAOwjLW rQdKMavFwkNvqLiFp5MP3GiyzeVepj2eIH49x+eCoeA/LXq+jwe/6gsyjORSlS9dVZWn hPbPVxu6acyuS/X5X5bjr3JlM5+8UAmm7sezOjtJXuaurWJzcw9UTJg/SkEWtd5QC9xp 9FTKPcpy00yBa+pyhThqDdZ0uU4kuTqBwm6tmtj/Co00aIF7diKnKdDJJMxg/p0dzLFY ETXpuQ0VtAKYzQZpYpLLKrJM1nbVjnuHz6DCfBOWOeSh2qBIAKMg9QYT3zmcGCNweHeq 0A== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rf40e5hxp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:56: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 35SBBgUw038194 for ; Wed, 28 Jun 2023 11:56:52 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2108.outbound.protection.outlook.com [104.47.58.108]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxcdna7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:56:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OoNVPWXTFPuzmPOBrV5I8xNvfM7Tx7XbAIkn2h4o/9W5quHx0ayLBx9EuZjKk80LFutiZW56y3TAnphYJQFvrAI84NhKnRrcLkJTuxlzUkdQtTRIcHHrTcU6PgVbjvIb9/QMdyBIgZbwXBaL4hi//4Zh12WGeyS8YraDGyT428OyU1pUfDdkzUStoOnTvd4NDZAdAS3Wnpp3cFSujeASCH6fieXWUZNeyAFviVp+qpvUMfJ/QspTlykMCt28TVrmnCINt8Vg0YGdRfUcLmQhz42+H+sx802+l3hGwYI+oK+kjYM4px0xx53CFQO400QLAUIADp0cj4KjpyTCuraC2Q== 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=5LHVQbpO8MEvKQlTcUWudv+5R53EDHgfjymVlhBesZU=; b=g4vuI306tdykz/lIX2+dah0bNESGVYV1NZBaUNlrQ16zW2H7uUAOKVFdnnDkbwCVF/YQDhPcSa7Ovs20N0CMWyKEXMdvNnpvvTBbTicDHAS0Qm75pGQIC/8kV9GB/w3ws/08HCdtXUZd24kPoK5rO2AbwdQx/8mz8KzAF5sd8zGWwCAa0L0g8GTDJxmymxsq2SzSIGy5dghim/1sJi6tMsY82djVvNZPglnmrbQnJJSKIyZyoR8tY2cL9o7DCtSXxEK0jmxI2Czc9ZQS1ba4UUR1V+oN51nS1X6dXQ/JvVXd1tlmg1IHcfudFyInj+4TXtpB8zuX7UpQjE6LO21yrw== 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=5LHVQbpO8MEvKQlTcUWudv+5R53EDHgfjymVlhBesZU=; b=ErDumrlz4isEM6JznwGHg75fKYCIfzaGB89ZtUmaDaLZxmcLN7rPei/0IP6I1TfO79sQ64AkSuuQJqdyKoDnptsN7u2TNFT7/EUV5BpNEDMeeYJJ14cQblEgQ1FAgGAG2iDEgzBsUZthZbJqR/RjjBisZtSDHvTrtZAcLty3PZs= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:56:51 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:56:51 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 04/10] btrfs-progs: docs: update btrfstune --device option Date: Wed, 28 Jun 2023 19:56:11 +0800 Message-Id: <8bfadf1467d7a5b7283d4bc4b5b00b7f070dd814.1687943122.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0009.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::18) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bbf1fdb-9bf0-40a1-8e27-08db77cec25f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YBhb69fbzakacbUQcjucofywAt1YxooWy4VncBR4lv+MQsTqmVBZdisozvR4Ukq88RovQ/5hfKyksq7uBZBMzYuuVbz8QDdjkpE5fLjnWOX/M4YwrB8j56qb/ZvMpYDYAT2VX0n1kqdRh+JE5gl3dk/O8iMy84AIwa9Rt2gLsQ0xYmODV2qfOqji8s/Yk7K/9WMLXFcrc8UfRPLK6Lc5Nvgzss6o+ReCuhix36xc1pnAM6OULTcF3wbYptNaOhk8PSkHaX6SPWGx697O0vNgjZ4aPuZyK0Oeo074MXZAsfAf8juyAACBU/RS1y4hyrxG+YwYGr4XRP2Si4c2vDvVaQgJKT6A9qeDdDIXh+zBxjAMKNn6keCxz0zYZBBOm0hRB0G/aZxV8yCe5DULZkKcjijhkCpqnVHNRReMb+12MRLwYjJcGV0OJuHuw2MkEkOQAHcf/pvq7q4an03G1Bj46L122rA4Wi88goJn+3BNTJFzI1n6qEuNIlNsR6p6bdKmI0KhdTLbVCA0kaZ6gbYMVTBINX77qTCwakL+el66Ym+3R37XE3OA7Y+5NaRSaj3g 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(15650500001)(6512007)(4744005)(26005)(2906002)(83380400001)(6666004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UsYkV1S43LrypmfgUan4CJWc4xcEjMqXVMSa/hRsjfEVB3Nxe8mxYJQOlshQSb/PdrO/c5y56tUdvCfK5Knut+sNSeK4Pgo2LN1ICLJZxED2IjsGWP/2zpzNH566rAYXGHW7BT/vaB0YyzZ5oUl+wUW6kZzAB+QTg7BAd98GEQGjKX+N231JM0/QqzDYjqXJ6xdGLBUmMPp8FRvBPRBbf0EX3qsRH9+3VmDqEZqssKbc+HPvpcka9YFDL2cvE95HJx4FzXhpT23N5RqNyOLdSu/ZHWjiT5//QOi7ue24iQgokXR10uJNFQqZzR1mmYw1swr4/+GxEUKjXtbdM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FqRZyigbxvcVK65rIQctYReYkHQG1f+0dtLPaLhoMVp+oNGWOO8lnk/uJuGSEXAfHfxdNiPPz+alUURcoRUe2jyhu3QN8KMezvB19CXv/ma1l2j9xwv/iXcBuODvU6e0zNaxzTDPkirRQUyjqE6xHw2gkano/ZJjn1ZVnVl9vcdeaOMGDnYx X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: GYGZ7g05LdRCF+yTCrZZyJNWgoiuwwOOtYBiWwycTeZT/brWT4Io3eZWA23mbp7rYaautp02yRo4vsxGzr13dtbRZ3FRF2VccktDVoUbneov3ehlWNup568p0r344p6z1WS2nj3Je0oMZ7teLADJ6O5S48XaeK0WV2mmNdoZRkm5o/EZTYpsEsX7JnyXEhKAI4tcwXNM5MmWB+RpRoUwLJ/dk8G0lUEJe5DHE504tlVO1mOA2k0/iUh0IDf0OBkbThXbfFmelPX8R5nifP5gJHyl8djrbek5bRsc+RuQI8tJm+4pLJ5xJb4w72jkl4In4vy0lZodSxteXfqoFuKCrW8C9/yjPfqSYYFqXqpzjxwYpRGapgAWMvzbHGnfxZIx9y21LcX+KJRLqVrH8hAmgYtzN1KsrQZvDLrEcuGyVPSvf5W33wy6FAOXIsaerCHRvmzQ3pnSyBAN1CrmOxQA3S18c3SC5ubwnq0aqNG4c/+EHekK3TdRzgAhBI+ys++cYI4Tpuen2zUsfmyAYPirhwl3WFPNg53Woe2Fz7DWlioC8NI7fpXRC3AbFhi0Y8t3leQ+rSmi807NGAfkEhRwJQ1mkuMgyIUNVYQSvKWENceo2jwfLvT0YJBjF1fZ7PFwtKJbB3i3/NJlauAwo8+dSHhJVEMdpSDUGOFBxcyErjQ52t7VfcrwRFsWgzWDmsopQFznk5jbEFjRTShBVPr+qvTPJtv0fG86n50ZLOL9r03S3KrFjvn1szZDjlPS6lV4W8jWaf8sMpx5KeQOHMxvtA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0bbf1fdb-9bf0-40a1-8e27-08db77cec25f X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:56:51.1999 (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: 2KSs+DcRXsQ4CfQPH8ZhieOtIP1Wi3nVeUekwJ1br1zT4jgPPFXIVRIxOgAMkhL7lkATSjwvsrbzp/8wFNipGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-GUID: 5i2dfVcyuY1GeSXxw4o6uwaDj1udt0su X-Proofpoint-ORIG-GUID: 5i2dfVcyuY1GeSXxw4o6uwaDj1udt0su Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Update the Documentation/btrfstune.rst to carry the new --device option. Signed-off-by: Anand Jain --- Documentation/btrfstune.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/btrfstune.rst b/Documentation/btrfstune.rst index 0510ad1f4c26..89f4494bbaf0 100644 --- a/Documentation/btrfstune.rst +++ b/Documentation/btrfstune.rst @@ -46,6 +46,9 @@ OPTIONS Allow dangerous changes, e.g. clear the seeding flag or change fsid. Make sure that you are aware of the dangers. +--device + List of block devices or regular files that are part of the filesystem. + -m (since kernel: 5.0) From patchwork Wed Jun 28 11:56:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295640 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B480CEB64D7 for ; Wed, 28 Jun 2023 11:57:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231162AbjF1L5D (ORCPT ); Wed, 28 Jun 2023 07:57:03 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:59542 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229747AbjF1L5C (ORCPT ); Wed, 28 Jun 2023 07:57:02 -0400 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 35SBTAus024981 for ; Wed, 28 Jun 2023 11:57:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=zNXXvqI/MqsnclqwZ7JX6FDZ6qvjDup4EQLqPgNELRw=; b=gjOnWhi4Pm2dXqUZKJffm6v/MWA3hz926g5FfPMEayXYzMh4o31ImhiW3IVKu24S33dW bLZ92y+kImc82S8iZY0CqOPTrYwrMC6MQkzxL7IuUnFYz8l2fIKEkVcj957Ng8xYCCyl n6YcbHR1vL/e3JnoTgCz0hxSCpfVFn8vBxfV/9PznAnJ8/f6pmYqpMnZSY5yiClkYkzO UpHN6ztAcGMvIxJ0VF8S5epaYMSO1+usxULxr8qHiY7owbOfxE1mN0uDI639F4r8Dj5X HIzd03Fz4tll9XDEiiSuHIeWN/58Ine8lgBCeKI3anUcmiorQT1xXSgCwHEmEqyZ0ZKg Bw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rf40e5hy8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:01 +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 35SBNNdt019935 for ; Wed, 28 Jun 2023 11:57:00 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2105.outbound.protection.outlook.com [104.47.58.105]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxbnyjp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dYOj5/a4kiS6VbctBasmWVRUX3FgpRQsm/2KO9Fl/mLN0gIUCPQm/1U5dd5Gi2t2pPa/8AY0xutAfuIy+O+iuljT3B2+NpSuB0bj746icY19vEJYiQ0ut0z2YFVJglGjtlBP2cspsRF+5u56zJiXr5VcJ49jpR26aWvHGPjuH/Lullhjd4AsHtmSGTtzbG2NQN2zR20SvXJPISuLFWrnySiGVpEp1vzNI+IB0oIsZyh2xXcrYRBvRvJDwiqqq8ozH6Jnm/zYr66ouaYWQQFYpoKhKOFLgZLfZ3yTzCDa3J6Z6o6bsdoBU6eHeKVRWqKiJKeXK7mpVgQipI8pNhxhCg== 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=zNXXvqI/MqsnclqwZ7JX6FDZ6qvjDup4EQLqPgNELRw=; b=feEadby3CP1KqHkr7RecINl8gRg35qNHpDiQxo6dIkx0FR80KtKa00LbfQqtk2dOG/yn7aM/F10d6aCbpKwoRz8Cm45jyTlQZ1uWHDs083OZtsFIUCwPDAXPcql0aVb/iaDl3b62jaO50epIaWv5EvnDyyKbT6wznwNJiFwERIce+ChUNtW6qZ6CBezsxpm7hs9pSFr2AiqLvk13rqshVpK6tFs+b5Es1oIiiBk/ycOb7xLHrPg26DUgqXxMdCM4aWq3izNqZCihaJMvCUgaaNvxLb0HxTakOeiukWAVj2lB+Qj3JyN0Q5ZEq64ZyuV5SBjHNoPkpVCwgKPrNiN+EQ== 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=zNXXvqI/MqsnclqwZ7JX6FDZ6qvjDup4EQLqPgNELRw=; b=AtKInhmw0sWR5nxpNKTdhkdXB4oCOswKTnL8K6BoskYwmoMNH8he+h7RZwoL8SCqguP1Sb+z3cpTZlPEXOtMI1xtFYWBFuFRkOyWOmoZ5R22W36EB2PZ/E2/TCY2rmBv4yB5AKfR5LlR2RLF6BurvOT+pRGtoYw3PZzeqaQwWfA= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:56:58 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:56:58 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 05/10] btrfs-progs: tune: introduce --noscan option Date: Wed, 28 Jun 2023 19:56:12 +0800 Message-Id: <503a67d396da4ed4385b3851f06c64203d1aafd0.1687943122.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR02CA0037.apcprd02.prod.outlook.com (2603:1096:4:196::8) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: 34630b5e-14f6-4638-5b1d-08db77cec6d5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: voC/VtK8A4JRm3G98u0loLxQ35is4Z50DXG9ul//Cd29cRl+oaDby4CZaMyB8q7fQYl0wRXtbISsbGP7s54smMffcO+9HJXknIycMVHNMmrHkmC8DFzgqRfY4IvviKNfnZcyWh9eGLxgZgoSo/K07acclyG0BT5l7ZjBCxDhDxuzzBOEp3l3mnf3uRH+WkhURu3jccTGB44C4a9Mwc+a0qoElnJI6sPEVkImpu+xkfmhUKXf/1oLCHZFp0I+xPxJhwxe8LWa+RmZeD3KNprr7zJD9tAJMOT+EmWhjIEhZFCgA9hNMp8x0KBkBhIRMRyAJi0ZyztHy5RywPDoql0RQzwkIx8geAUKVytQVcaiQYM9EZ1xi08D6opyHOeBLnIzAs/QG/u1xuLnihoRTAPI/vu7IeWp3BhLtIDIlRzhMj1mEta9t9v3r1cZvPXp5OGIEec7/0EHdnvS7ll8UOTydDwFZxf55oWRw3ugNZ47Yo5FfV80FirNIGDDk9aQgJJvnYabM8Wh5EKmmxqug84ZvSo2XqlThDMpyuIKunJJtUycK0eZ/bh+66LBKYIb6BVGHMYuhXxwYSvr388O7EFgj+d8X6eWNGXAw/WcbvLkwJL4sT9A7jLOdFXtFBR92K/M 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(6512007)(26005)(2906002)(83380400001)(6666004)(2616005)(461764006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: X7nXUJAVouWIeY4UdwMD2Mj0CBectNEFve2KC6nunfoQa8pwGbdnZXLxqxp997frKFlAQuEbbIbZqSbvQyT9Nd3Ma7GE078nj8YqIfG4E/8l2EiyPGQ8VUvvf3b9n7TdcqO7VmMQClFu1Ds9selN3959vaAuoeDPOl/f6ywy79jo+P+9roRI6rJ13WGd7gSq3fgoh70UuH3qtFukzkCn+7u2moBlcPkPhZTM96JoqH8nOkr46kfOzmbdkmU94h9fxoAT+uAjSKNVDcVAhtuYMsAXi2v7Kj+8Csz7z5TVAaMild7kTUmDPWlFpA81+ksF2xUt9JQKGP6mnwxA9X50WyukBPlLOzw0RKbvUWQVw+Sw6kpAwNBwoNkQZhgEtzzlTpYYTFR0F3eayyTIPbFLhvi25Wx+OcgzDadLpQ7pBz4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ACfl0HoblUZZeuoSdfT93+M4nk3vCccjeu/lDWLx3gC1bovaGNalb0YOGqMJwWy6LAMVl86q/kpaaB3cQ+du X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: MIzkZpAomZpdNA9HN94/e3mQ7ZS/mks7Gj7/CiCGq23sGVJgBKTgMUfS6qJEDIaF78ybP0NIOQvS25n2DidmcxsqMC1GYsVGx6O7OFRH/jlnEgSXVcWnNgFQzVlXNGo5p+lyfA8TgA2chX0s2DqjOyUXZ+4UzPBUCOfRrINh7ePVhYfiaJ99eNVD3niM+F14uqQK6xMjJdZioc/n1adTCW34SL4g7TMCj2Lz4iuv6joTe4i8qgNfyrBjRE5wYNp+jC5uG8AiMXA4XOaExbC24u7n1WjRVVW11VX61Zrfxx59XO2o7Rm7v3cnT6tfubjj9dLKbVIzqaMipOgIQWRxU7VZKSHSoQMyLS6Qk+Y0FY0SmecUnXNoqp0aex2M0aC1yJmXvlCwTbZTM06HKyZ9doZ/zlkdn2I6eYeKzAysuqLpARvUpnSTLRFc411C6i3TwQqTgGsou83pp4z7x8NNTVRRr9c/wGMOTePDg/LVQJq6mtNwUm0uVP+WHImMfVDfrdqjFT940PhOdN/H2knSgV97CHZN4iONtXl4Lo++YI6MSzs/WtqORs4c5U3V7Z/eTpSOLATVZgO00kgizn+zC+PS4JNJ8ZztQKrQeEGLbWq74ejERwyVKqdTpb3n0PCGUmd7su3no9DRegR8ujNSzGkj+Fbuenrck2mVp3taOC9l90Pmci+HgxG0wLn2Un0gJyH0xZHHpz10qlo2khnFypWiE/RBoadLS0ObgM1SeOwIw7iT7xuEKHJLvHK1kbt54QG2HtyRBaTZe+wDpfvVBw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34630b5e-14f6-4638-5b1d-08db77cec6d5 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:56:58.8567 (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: pPK7H2FuZu83JWWw2pAA7JRP2qO+8Znn7iLbBL2sO6yAbY0Zm3B7o6NtS/va3YMFmwRJ95rYUrGKvw4Yn/0sqQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-GUID: SHVjkZcbSmDFW9pnOgtEYtqFVIRhN1Yv X-Proofpoint-ORIG-GUID: SHVjkZcbSmDFW9pnOgtEYtqFVIRhN1Yv Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The function check_where_mounted() scans the system for other btrfs devices, but in certain cases, we may need a way to instruct btrfstune not to perform the system scan and instead only work on the devices provided through the command line. And so, add an option --noscan. For example: $ mkfs.btrfs -fq -draid0 -mraid0 ./td1 ./td2 $ btrfstune -m ./td1 warning, device 2 is missing ERROR: could not setup extent tree ERROR: open ctree failed $ losetup --find --show ./td2 /dev/loop4 $ btrfstune -m ./td1 Or just $ btrfstune -m --device ./td1 ./td2 The 'noscan' option is optional because there may be scenarios where we have a copy that we don't want to modify the fsid. In the following scenario, we keep 'td2' out of the metadata_uuid changes, even though its loop device is created. $ cp td2 td3 $ btrsftune --noscan --device ./td3 -m ./td1 Thanks Signed-off-by: Anand Jain --- tune/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tune/main.c b/tune/main.c index 63e3ecc934cc..570e3908ef8a 100644 --- a/tune/main.c +++ b/tune/main.c @@ -119,6 +119,7 @@ static const char * const tune_usage[] = { "General:", OPTLINE("-f", "allow dangerous operations, make sure that you are aware of the dangers"), OPTLINE("--device", "devices or regular-files of the filesystem to be scanned"), + OPTLINE("--noscan", "do not scan the devices from the system, use only the listed ones"), OPTLINE("--help", "print this help"), #if EXPERIMENTAL "", @@ -145,6 +146,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) bool to_extent_tree = false; bool to_bg_tree = false; bool to_fst = false; + bool noscan = false; int csum_type = -1; int argc_devices = 0; char **argv_devices = NULL; @@ -160,7 +162,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) GETOPT_VAL_ENABLE_BLOCK_GROUP_TREE, GETOPT_VAL_DISABLE_BLOCK_GROUP_TREE, GETOPT_VAL_ENABLE_FREE_SPACE_TREE, - GETOPT_VAL_DEVICE }; + GETOPT_VAL_DEVICE, GETOPT_VAL_NOSCAN }; static const struct option long_options[] = { { "help", no_argument, NULL, GETOPT_VAL_HELP}, { "convert-to-block-group-tree", no_argument, NULL, @@ -173,6 +175,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) { "csum", required_argument, NULL, GETOPT_VAL_CSUM }, #endif { "device", required_argument, NULL, GETOPT_VAL_DEVICE }, + { "noscan", no_argument, NULL, GETOPT_VAL_NOSCAN }, { NULL, 0, NULL, 0 } }; int c = getopt_long(argc, argv, "S:rxfuU:nmM:", long_options, NULL); @@ -245,6 +248,10 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) csum_type = parse_csum_type(optarg); break; #endif + case GETOPT_VAL_NOSCAN: + ctree_flags |= OPEN_CTREE_NO_DEVICES; + noscan = true; + break; case GETOPT_VAL_HELP: default: usage(&tune_cmd, c != GETOPT_VAL_HELP); @@ -292,7 +299,7 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) } ret = check_mounted_where(fd, device, NULL, 0, NULL, - SBREAD_IGNORE_FSID_MISMATCH, false); + SBREAD_IGNORE_FSID_MISMATCH, noscan); if (ret < 0) { errno = -ret; error("could not check mount status of %s: %m", device); @@ -317,7 +324,6 @@ int BOX_MAIN(btrfstune)(int argc, char *argv[]) } root = open_ctree_fd(fd, device, 0, ctree_flags); - if (!root) { error("open ctree failed"); ret = 1; From patchwork Wed Jun 28 11:56:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CC5CEB64D7 for ; Wed, 28 Jun 2023 11:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231304AbjF1L5S (ORCPT ); Wed, 28 Jun 2023 07:57:18 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:27122 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231394AbjF1L5J (ORCPT ); Wed, 28 Jun 2023 07:57:09 -0400 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 35SBTanu000846 for ; Wed, 28 Jun 2023 11:57:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=jswYXeUi32MCzO8Sf609YkUl0ex5Y0mQGYAKQUyG2Bk=; b=0zHFlnm4yM8RlzjvQ82Ml/ig4WEZbDpXFYtVgKmwjS41nYgCxag+DAOks6xNEoEPjqjC m+XXwGt4hb+tpS2CouBQdH8SHHAwvPNxHPK5AmsGHiISI2U1SosloAadHC7E83UwRVN5 hbRBQyNPRYEGuI1QVl0sihTaa+dm1Xr387AG7GBYhPQ1WPgvC2NxCp29NODVkB4zYBzK OZxvoZdvAnOOw8MiHnLsTTOk0QsVADwYJvByrlMSssiTMPox6Cd/55YXAvj1PNKdcl08 V+iHkbQ8JlG8s5zY5Di392uKIcEzFRoR6Ph9DIJnwVeab1VGa26ISkskskTfUMywgmxA Ww== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdq30ydt2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:08 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35SBPDwt008684 for ; Wed, 28 Jun 2023 11:57:08 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx5wem0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SnuPT/lPUVDn7iSOX9iHRVnHNQOOUKR+/Ew17SoVAR6LRbtVIEf8QePuPalcxm8fJKgNzp1zLny9ncfZbANzmxfMatrWFk2tIftmlM67+RqCRGdonVRkeyXBFlOel6zH+dDSMOHOM4r8ynnbgByWnl80YjEqCKMq6/4Sau3odTxPrf235Lesf4rwyDozefrkjO/HLL9kluHRe0yvjSe4CHuEfjuUrW6xu/JMT8zHQZVvLAW1UlfvvbY1N3/mXV+YMGEqQEHy2uzMZ/y0yNI4yWO9/OUEVI0DPk8e106JQk+B/rnsf5sv8Z8a3Iwlc4xbDzGoNPhAieGKw8uBBjRMsQ== 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=jswYXeUi32MCzO8Sf609YkUl0ex5Y0mQGYAKQUyG2Bk=; b=BJeCxLKj2O9XGRnk2LV4GTY9uft+Ay3QtrHHHXVj+u1O3S9HSyQCS61mAg2oZoY2SpynnWaRSyJrIt86njUmByGWDnzq1/0Tmwan9Oxj5LtQp+zKDZwObi+6WQgY5fQWn8g/ItdX4oFX6EgavzpckO1E1r8GRh96qa1dS2ihh4Mc/A7NAj49O61ESokMOJx9wPGFeoa3p1r9BvjvQxXg+ee/dy7exO/wChfEAM7So3uyuo4RoMID9euDjky0hAjp4tFtBDrz7O8S9B69ER38RY7iRLYTbHNQy2cvUM1DOmtGXej/iIRiVEhOLdxbnjHawJgAsk2YQJqVVKtKvzFq6g== 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=jswYXeUi32MCzO8Sf609YkUl0ex5Y0mQGYAKQUyG2Bk=; b=deAccfCeH5Bcll98t3zz9OxsV+2DaHu71WczGVJp3zYc4h3YcePNMx9zQJuFseithhkVtL4C4iAcakSO+kj/geOF3DjvTetT9FBe6FTBnje6MfuxP1xYOu4isrXHy3FbbWRUWc8PePLrl+YgvaHqM8aJjFeALqeH2czZB1VNsmw= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:57:06 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:57:06 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 06/10] btrfs-progs: docs: update btrfstune --noscan option Date: Wed, 28 Jun 2023 19:56:13 +0800 Message-Id: <9cb7c73724b98b8055b7908bcfd1400fcb3dcd0d.1687943122.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR02CA0051.apcprd02.prod.outlook.com (2603:1096:4:196::10) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: 0eb2cb26-f2ee-4377-b0d9-08db77cecb54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gJMwCqeqjh9UdZdud/SjdEsG/Xmwmk9/sEQ8dMbaLBF1UzF1BUTYHoaKu24gSnhH/lKub8SpBT66W0+Ss355oKZ+KHNPFDBLaVTEAg9pLf2l9c1B1C2njablTceFHVgaBpZZI4IrxN+2mzg1S1Z1RNkvZlhpQuWP8rnK1faXg4elByJ+zkXa8z+4j5bN3ByIvn0vDHZ+7wwJtF00MXoDhH8mCzMzaeC3kB1bG7J3JJRBiJK8F2YE/wXoDFTq3zn0YMnzwPJ0IhA+Mu531NL5/S9KvnYpvrTTAZZVjXlV1e7Z+pWwMAZHKoWAk9paD1TN40q2CYW3VreQlH3DwvqHNjHJEAGo+g1Ydi75XwFohDxyOy8B/skWcBvMOZgKohhYk5xbf+nRORnkMIE/pabR1qRIcizOTdVZox7CEgrdHIDz3zPoVObscoJEtpLIK7J1GEuoanp3rqpVI3m4JLiaZKA+7EeYYjP5rkuyKqzeNNrHCo9zvP2h4sdhJJcgnRZ4pX1uI5xg6httCeQ3kL+8GwV+LF9xmAKgKdkCA6830DDAkiADdlib//VyaomDIrlQ 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(15650500001)(6512007)(4744005)(26005)(2906002)(83380400001)(6666004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MbvvEBE8/XXBVYStODnZzB2SFSS70ucnxAB4PhhjyV4ECLBy1q4PVDDGn9Qv36WlM722FxvcGLraA/b7Og2V2f3nDYPLyUIBj99vBvrZkYrCaX/5Vml38pwK+7kgpb83lqZj/bBZz9jFHgbzHkg0VIE391RlJY0RArywRhC079h2/nUKLVMbwq6ymAuHs9lYHa8gW7PKSd9wxcNK+JWLz0CnVHFwkXsvcsSDFxx7aaDlPRDRvMSCxF5Z502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Eqc0+PNjGEQZli3yZtcQSCbn8i0fwJ5GzutCVJd6W8gxcVKZ6F3xzPGZKkygnQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0eb2cb26-f2ee-4377-b0d9-08db77cecb54 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:57:06.2388 (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: VAbG+dMlwjtnYkeG/CXEH8JA2j4aK3fFkeb7A92Bf215GdPuJdzT/g4LCe4GiABXRzIfRn4CwPxtgzrAaM5tPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 malwarescore=0 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-ORIG-GUID: iHhl0vC5pDiUyHluUpY788NW-085RVQw X-Proofpoint-GUID: iHhl0vC5pDiUyHluUpY788NW-085RVQw Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Update the Documentation/btrfstune.rst to carry the new --noscan option. Signed-off-by: Anand Jain --- Documentation/btrfstune.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/btrfstune.rst b/Documentation/btrfstune.rst index 89f4494bbaf0..71a05506ab13 100644 --- a/Documentation/btrfstune.rst +++ b/Documentation/btrfstune.rst @@ -49,6 +49,10 @@ OPTIONS --device List of block devices or regular files that are part of the filesystem. +--noscan + Do not automatically scan the system for other devices of the same + filesystem, only use the devices provided as the arguments. + -m (since kernel: 5.0) From patchwork Wed Jun 28 11:56:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295642 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 865CAEB64DA for ; Wed, 28 Jun 2023 11:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231515AbjF1L5V (ORCPT ); Wed, 28 Jun 2023 07:57:21 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:41966 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjF1L5R (ORCPT ); Wed, 28 Jun 2023 07:57:17 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35SBTTGb005365 for ; Wed, 28 Jun 2023 11:57:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=HpsbEeepyNUf/ydbzfxK3MzrqTMaQ945OFrlXzKl1EU=; b=E3KzGlxUBP7SNKND4jh4T5TFlph4Q5wGjHpSuzSYJy8qlCQDNa790IjNA8nRnt7mcUq5 0NSqxf5qJWWhOdbUdJDwrYFXj8I9GyOtKsq/qvjlCvhr7iM6VGvtOIyJJh1+yxEntOvu 7aJFhQzZfO07oUVrjX+YFDBkcXR4MnaoNVm2GSJvEimiUua3Up5xK1vhoSYhhg/61PsS vzW0pRDXDIS0lE6SJ9LE85EMuQcP1qVFfYE04jpU5QY+t9p47pJUdE/5+W9x7457zI8w ZAXO69rIzhkN0SvqU8njRKo9ckI2SwYuD2wlDXX2Qn5bOmVoyGhMDIWqVk+7xKDRNYs4 uw== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdrca732f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:16 +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 35SB4WYl013185 for ; Wed, 28 Jun 2023 11:57:16 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2105.outbound.protection.outlook.com [104.47.58.105]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx64wcf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oMRRzxMz0R3D3BP0a+Kscg9S5Lw+gItE/gThUx2dJ/ifYe0nWfscv0FRlmLBtuptP6sh9UyFlwbaEp1G11ZqD8ETNmYBiOmp8CIu1eeqR4ZTUI5ZHGWcjVdwqfuSg+BvBNuwc4nu556P7DTGshI1PVAgy/d6W3QxqC5iLVSu7syc9GguEMaaLHcFP8pzUI1roB/mc+SdL/J7vMLI+Rg4JWMdZ5ft7LtUIuegmYF791FcvM/zCmZniLDMJ7+IUiGdHIcqWjOgs1YNBstGeu0IrDO78PsadNuOi3DpJ4V8hP5jveFBRnYO1FC67A5FLD973lLzeqY6S4boczkwtsoeag== 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=HpsbEeepyNUf/ydbzfxK3MzrqTMaQ945OFrlXzKl1EU=; b=PInycNeW73r2fSZH07HFtcGXNyrB/uD4j/lGYtbDGrVxtqwhG6H5/twMB7Hik6rO74LjajgBChXcSkgnIFEOHFgPDZ3mD73oOus0UXBDg1wyUb/Y09TE6Bwl7HtQlr0nRpj1BjUXkk/Zk3/iOzBQNBrQxGd3yROYbEeKNjD17s/x6z1GfAZCvwQPP18fD5fcMv8elOFICGTy6j+fmxCrAvDfi9hd55uCh0nFMFXw4FM0ldYeZBe98/v4+u9y8bLlnVFBfZxdJ+q7ltmQWNO7xSVqyUK/De011C8uGY/T7M2vhOeodc1936EM4iCRkTwmlmnGfcNX6Uhh7cgp1Qex9Q== 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=HpsbEeepyNUf/ydbzfxK3MzrqTMaQ945OFrlXzKl1EU=; b=G3e/aEykWRboAVlyRbYyGeSod8l7nXInwHUU7I4WR0mS4KmzLuC5DyFy3Vau2sXlLa5YpIslkV8kyhRrpakoq8dMOiUL8ccRU153psmPk3BuQGocyBGIQYEJPnuMSfY+YjBxOi6envQmRjiYuye+0Tv4f2mTWKN1AHz6/0aY24o= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:57:14 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:57:14 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 07/10] btrfs-progs: check: introduce --device option Date: Wed, 28 Jun 2023 19:56:14 +0800 Message-Id: <64679fafee4e8865de841c120444ff6b31189d78.1687943122.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR06CA0012.apcprd06.prod.outlook.com (2603:1096:4:186::13) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ccc909c-1c51-4e2b-9e68-08db77ced00f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i8oBj99zUA3se8exTY19bPGhFnY8eQC8EgwRjksbbg2HZJf6axPvdj0rklRKXY+MDJRYYWTBJaH0JqifHKKrMU1lhn2DGZ5KocsiFzF30t7eBP2+wZ/KKv5XBWiHISqLTP10sPV64IIgxBMboTdwaffquZbls5wej0KZbyz7d9x5BSnkB9OHXis2mSzKUWjma67c30oAZCFpnfV6nrOpVW9Lq0Ql+L4MZKxXKMVh4Kg3bU5eVr/EECMKZpObBHPEWS7TrEr+Qsjc0xFRz3gQ2GXK9W+X6afDfk8T2y9NFnSEPOXbQBL4DFcPICGQdsPhTpYEL0KKFoCLoVOkCERKa1JjJp6POIPLVYW+iMOqMiaSMgsSB1ikKVH9KnsJSagu/Y96NQ3m446i6xL62teLLI/2RQt5eB/IG5F6bS7frbxIOeSPDyqP+oH/8wA7RoGVmOAl+ADqTiaGLEI5yDw/KQxcZWcQtKHdabXmHN1sUXBoRH6XtmDO6S7o/qgUhxWEhLXTq3Z1UwzjEmz+InV/I3KLGKgC7ogFzSG8T1M7fu3deZ0Z1S2OApmy/TF8qFri/moWL0AugH+NAzU6UeJe6k5iaP+L3Y3kSbhmwcDpgko= 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(6512007)(26005)(2906002)(83380400001)(2616005)(309714004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dUIt8ToNT1y2Yjid8NjEmXX5Z313AJ+VAxNQGKvghi7tni86U0dxvy2fl6hmtoG1YvAKC48Iu5h6f9AFwV/mDKtSCRWVcWNaxSgKqWrioTjUszKMwaNXxvPYmbfM0IZfmEuksHrvrihTJoZXhF/3o3WwHkG7HI1p/eo6eLi4V0ike19n1VGjSmMmDM743Rr3lhZ4hBerDUGu+nKCa0WTHVy9NsSm74bgBXdoEpclLFnQX4FNx1iLR5EBJhExHYGWAHo+x5HggoM9LAXBw72x/5oSxmNrxIa0u3U1HbThn5QcJBlohJP16FFfzJFfAG21LQGbo7MdRnyRTDjcuX9p2xVTHRWjiJ5QKbFSk2niM9JbVW4Xg7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ohB/Dca59vsdHLPdpJCbFG5yRH1k7EKlLhmwCVGz1biBKBZU/OumB9ivXv4++Nk9BCggIMT4A1Y0FN+d+I7PVySo7KFfJBCFpmWerUxugv6SNuzDPrqGB1LRdVdfZ2Pxh+AhFrEfOWQLB1LO1y8TfmwK2IVaWPKBUWO1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: bFjixbtcAQkQvQRX+0/zox5yTwjfl1eD/KcaUFOkER3qnMfb1UDa8s04GPvb/Z9TiSZT3IWGtqnHZcZ/SEPEJUNdTMvOinsDCu/rJvkM7icdoTPcua8x2njFULWeHhwR17miyuu5hKBdfV5K93NXyC060tCGXOajQMuipF0HGy4oLyf0ENM6x1F9Paks4HxTxOEbUpdX6CUiCmvBFeOowPjzV8vTdetkkszkHgpnLqtCdQVFvdFRkwhdb457wTSNQoOS+vwSyymRm9PQATjq8AACD1fENrijCsLm2QQ0PIKGexEBKfljq5WWHEUxBFIS0M0r31CsJUvxHt75FZzoAiPl/nG+XlVs0dVeeiZWzpaO9cwkdjxSZRyA+JGZSrUOgsyCNEZr+J1TJ51XTGkoQwz2bN42AHdKsXkm32vKtja6kt1e1a/JX0Lty8flXx9sPmKqAcejsaPSYxDXTDj/qBCWgsUFq8FWiEaSrx9OePl2chFZu2D9L4qYs+kFVvvPmGKYZ2ASrdtE32Mtd9frTI9U47++tUgctN/TY0TBAIipP1Cz6c1U75ZqzsecSiheMEvljCsKX+vFGB2ggVhrUtLNfLGGgZJTCq8SsY0+iq2qiuG39NOkuRKvtR8B51W5QiTsB3MKH+Fizg5N3130cXbQBhgjkcefv+wMFo7td2VWyvjNUpbCVzb8WtCGg9EnNZo74IBf5veLfpiqKwHO1FUWWB73XFGBbrzRo7C85AOWyWIVle5Y9OsZjtkXc1AU79I1L4XX+MlEQ86c7b61vA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ccc909c-1c51-4e2b-9e68-08db77ced00f X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:57:14.3410 (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: 6xUdLWCPco43diI/trw09jOqF5jUEHOg3NcRCp+kGq+5p1/AotuzqO6EGet/dmi8qy3kNFGMSCyuJnYIirJ/xA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 bulkscore=0 suspectscore=0 mlxscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-ORIG-GUID: rqGIbUiSYJs2QnFaDPP09jWKzUBes0VM X-Proofpoint-GUID: rqGIbUiSYJs2QnFaDPP09jWKzUBes0VM Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org As of now, btrfs check only accepts one device from the command line and then scans the system to find other parter devices if any. However, this method mandates always accessing the file raw image as a loop device. This patch modifies btrfs check to accept other devices or reg-files from the command line using an option --device and scans/registers them. For example: btrfs check --device /tdev/td1,/tdev/td2 /tdev/td3 or btrfs check --device /tdev/td1 --device /tdev/td2 /tdev/td3 Signed-off-by: Anand Jain --- check/main.c | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/check/main.c b/check/main.c index 2f4fa5ada339..7eb57f10aded 100644 --- a/check/main.c +++ b/check/main.c @@ -51,6 +51,7 @@ #include "common/messages.h" #include "common/task-utils.h" #include "common/device-utils.h" +#include "common/device-scan.h" #include "common/utils.h" #include "common/rbtree-utils.h" #include "common/help.h" @@ -9953,6 +9954,7 @@ static const char * const cmd_check_usage[] = { OPTLINE("-b|--backup", "use the first valid backup root copy"), OPTLINE("-r|--tree-root ", "use the given bytenr for the tree root"), OPTLINE("--chunk-root ", "use the given bytenr for the chunk tree root"), + OPTLINE("--device ", "use the given device or regular-file"), "", "Operation modes:", OPTLINE("--readonly", "run in read-only mode (default)"), @@ -9989,6 +9991,8 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) u64 tree_root_bytenr = 0; u64 chunk_root_bytenr = 0; char uuidbuf[BTRFS_UUID_UNPARSED_SIZE]; + char **argv_devices = NULL; + int argc_devices = 0; int ret = 0; int err = 0; u64 num; @@ -10010,7 +10014,8 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) GETOPT_VAL_INIT_EXTENT, GETOPT_VAL_CHECK_CSUM, GETOPT_VAL_READONLY, GETOPT_VAL_CHUNK_TREE, GETOPT_VAL_MODE, GETOPT_VAL_CLEAR_SPACE_CACHE, - GETOPT_VAL_CLEAR_INO_CACHE, GETOPT_VAL_FORCE }; + GETOPT_VAL_CLEAR_INO_CACHE, GETOPT_VAL_FORCE, + GETOPT_VAL_DEVICE }; static const struct option long_options[] = { { "super", required_argument, NULL, 's' }, { "repair", no_argument, NULL, GETOPT_VAL_REPAIR }, @@ -10035,6 +10040,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) { "clear-ino-cache", no_argument , NULL, GETOPT_VAL_CLEAR_INO_CACHE}, { "force", no_argument, NULL, GETOPT_VAL_FORCE }, + { "device", required_argument, NULL, GETOPT_VAL_DEVICE }, { NULL, 0, NULL, 0} }; @@ -10126,6 +10132,22 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) case GETOPT_VAL_FORCE: force = 1; break; + case GETOPT_VAL_DEVICE: + if (!argv_devices) { + argv_devices = malloc(sizeof(char *)); + if (!argv_devices) { + error("memory alloc failed"); + exit(1); + } + } + + if (!array_append(argv_devices, optarg, + &argc_devices)) { + error("memory alloc failed"); + free(argv_devices); + exit(1); + } + break; } } @@ -10200,6 +10222,19 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) ctree_flags &= ~OPEN_CTREE_EXCLUSIVE; } + /* + * check_mounted_where() with noscan == true frees the scanned devices + * scan the command line provided device list now. + */ + if (argv_devices) { + ret = btrfs_scan_argv_devices(0, argc_devices, argv_devices); + if (ret) { + ret = -EIO; + err |= !!ret; + goto free_out; + } + } + /* only allow partial opening under repair mode */ if (opt_check_repair) ctree_flags |= OPEN_CTREE_PARTIAL; @@ -10214,7 +10249,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) error("cannot open file system"); ret = -EIO; err |= !!ret; - goto err_out; + goto free_out; } root = gfs_info->fs_root; @@ -10560,6 +10595,8 @@ out: free_root_recs_tree(&root_cache); close_out: close_ctree(root); +free_out: + free_array(argv_devices, argc_devices); err_out: if (g_task_ctx.progress_enabled) task_deinit(g_task_ctx.info); From patchwork Wed Jun 28 11:56:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D9AAEB64D7 for ; Wed, 28 Jun 2023 11:57:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231153AbjF1L50 (ORCPT ); Wed, 28 Jun 2023 07:57:26 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:55010 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjF1L5Z (ORCPT ); Wed, 28 Jun 2023 07:57:25 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35SBTQkr005288 for ; Wed, 28 Jun 2023 11:57:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=ly8TthvVptid9kHhMGjloQHFFCY0mawizKNQHOJJjZM=; b=p4X2lDuuQHiUJruCjKgyPxhvoTtX6j+C5+JR8sAP0tOylQxPxCgDdr0bLuZDQGRUl4oy 1nSQb1EnU6bjbf3gYAqd/uQMl1QDf/BM4HCpDyDRYFN6P3dqjRpbcFnrDIsJ9aAhFv0/ rslUK28HOe58vWElbR9yiLYxpsBS9wbZ0crg90mfKcrzRcvfAmTQWTfKDBIVGURQg9/k XlmnNRxkRGYGqsRjtEra/on3qzLlibLdqle8E/j3JUdpz/AuE+6i4eD+VIu54K9Ggb6C 1viBMsE4hg/ac5z/Hu1d/gxdRjbYDcNZugTzegCgB3YyMViNXmbzgqBD5UsOwgxDg7zA Ew== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdrca732n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:24 +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 35SBDcca029658 for ; Wed, 28 Jun 2023 11:57:24 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx5wb3x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nR41+3FuOnNS8dbDsNWvFzmq7l0ZyNGqfyt+sYWkQ1HPsfZWF3PNsdejKEzw1IVq0dMUUN2Y+8GOpOo9GhI/mfGPHHvrbB7dvHTeIW9wamkmFATfnco044BaRVT4G21RylFSUNCskyANafoms6ySZj98LQK4sUeBd1leiEwYipiZ00k7sFsAkEFHhUq0fKWihMIzXN7ZplhxqZ4F6DNxDKShndNo2dPTH+bSnN1NoZvEzc8eEOkMtnx5vsPByR3tduSIDhMEJ5A2RzcRiJRUZ2AFHT1EAeGipkJJQQSpR6Da+gGUXvsV5otu32zcdjEkyR2I0LVaLg8Vg9qeRfKuEg== 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=ly8TthvVptid9kHhMGjloQHFFCY0mawizKNQHOJJjZM=; b=doFEC62DYIQJYOq8wawRb0R//mkffrPaC+fbn2MqG9g/dYLR5uO+wyhG326dibwHMmxRuCkI2foiWa0KiXzRb3vEeXlz9hN+Z/mtRY8m7mcY8FiXTULc7PzBSHLRPWRn3UbUfwBqjn6jjcKXG1s7E1GGifA8XDZemPPL0NyOyQyfig6nST5naOr4NL76VN0Tu8jfKHZ8SmJpJXx7uV59mEVKNEjFlMlcRtKvaJPQ4EkiDliSVSzriTkqT7DKnfDsjnqA4PnciiLEAFKgaIt4cJI2UjrdSAv040SHEGj4XfEnvipU5bbOzQD52S7KgePkeJV1N1vjdoQPXtfiF4VfQA== 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=ly8TthvVptid9kHhMGjloQHFFCY0mawizKNQHOJJjZM=; b=J1G3L0okXiQkY8S7Nk0ZG2sODzVSWgqp+8PJCNjSNL4s65XK8v1FcGc/s4HBQJ/5Guq4gMUZS1UzLENviBVPvJ+LmwfkbNdsbQQmhpVpJ9L0EOw3gLOHeTh0QFOcJMs3uiWNKxoV6wMruaQgMulDZFdmJzFBj2kXovicTPlMuSw= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:57:22 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:57:22 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 08/10] btrfs-progs: docs: update btrfs check --device option Date: Wed, 28 Jun 2023 19:56:15 +0800 Message-Id: <978b6965cb3a3b5153c58c1fd613ecee7e4c8f1f.1687943122.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SGXP274CA0007.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::19) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: a7be162b-3351-4a8e-8910-08db77ced4e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PjITDRju9sHGKOsDvGmZjIHLzO6/jGYkkDmLJ+c0ghr3ednxZNv3Hf07rlLwXy4+VHdpiqpmkhmYWmcqIR2bufydQe/pPvelCEIzZZC1m7Vk1+rh05kgTtJDJxI3tzpQwYdLyRthPlCXYA90ja5gkebBA6+xNuSiJFmPHF5VukVtGUnpF5JQH8ZbYGIlK24RsmPrsB8pg7D4JRn1cc00W4CAe4RA/u4UuVlMNBxbZ4gS7NVqBof5RWRf4lAJ1MQ/MFTjptOUgimqm7NHNy96D9iBYuOBeWdYciX8+A7bJRIzdo1R93sh0nfrjviaTiZ1vIp8bsHHgpFvduxTahpN4RtMVHl4oAu1iYRob7NaL3ppa/uLFF7DX5XMKYANriXFiO92ZhhxlBq+yEiaIhasmZb/qcFFPxd2QgRir+QhyegV/5EqC+3TIfJRveUlhjdsO69eZhi8mnaH6EPfZI2nlxMqmnyj2T0Ac9SivXEfGaT6OiaPCiw9HrKW7pJdJESR0JONSLNGsfV4Xkrh3bDWL6by7XLIR5Bg/VgiegPoPzBWrtQtTtOPz1XFTNnMfOeo 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(15650500001)(6512007)(4744005)(26005)(2906002)(83380400001)(6666004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cxz4a+q7Fih4LLv1eJeRg81ch+qQK2cFgGJJp29XunY2ujXyLCrMStLqqJF92l9IytFO2h4BHl8g4Ws3ad7IgQ6lMl89UdULFpzc54UtXG9Pt4ipcWV7Hn/lRZZqCgTVsAs/nE+Ii40/ZYhi6+h5oUal3NTSkY7ddGRXnSHuylXT3kC+6kTnwZzO00p6imZtM0KKW8I4QPzpT1YJZmaHK/w5G8szPCQDpw9+NxiADtaOl1sbLOZVhc26Us43S2+A+bjAzMsGLLEuK9V+a62G234GzMkT/pkdzNhSDJqBQNP3A0KsSmxkmYUNcVU9mpHwVi0917oHp3K0ovmlu/AOtuglTgLkqhWx33QiM4YBqYplWZyFFZfzyNXZ+tfVmbWNPLEU8dfABFYmZBt823dif/OkmIlyzL14eM7BR3bOE/ZgOAQMuKT8Ez0RM7+HpUZl01oG9yey3U11j5+CpPXLitK1Oi3EN7hByT+OJlT1f7vOvnSOrSJKStlkUU3TQ8X3IvWEWRHrcRz3vBIWmn5YuyiPdcUKbd0KfOdMqULbZeFeQANQjLYlrGnk3qZ6eh15/cVaZNXsYfs4zJMrinpI8OalgPShBhhpfaqJOyk71odE236OikUAFKLj6BlQSPvx9KDLD76mvftO7D/QCbx5QKjcSidnb5mGXJJc3+Mgw2tXV+fB60GS+rQLsm3FHs8zxRW0PzlfZbOJQPPR3GefIVzOETJUmOOlYtdROKu1moT1YPzs7VMSa37i4mPmIpw6FTyuSmnnnwh6uFuyt/M4JVNTFG9V4KcAik1mpqxDbEWZhXRfrsQ9rkpg1V5bAPqI7GkljFPDKkG8+iGhgbw3pfQUVer5ed3+OViCTPwrOq8crq//4GXvWoi14YhvrRUbtCixUfl2r1oYQc05mb5VZIWniWIh6jd9jjVtEvrwYk2n1Gmn04iShZ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oG/ExZwkMzUW4uIeT9AIoHA8sTZLTsRqwJElohXhLQKc24916RZKDCXZAhGZVgqn4L8FmnYXig04VHBh6Mq5ARM7wel5Io8m4C+7I4covGxF0cOJPhXVwTnZ6a8poE1Bj6N2PaIER/iVfDzD+7SXPq2mNFnm5LfwT1F2XejkhVM9S5Ty0qSk9dJSwoU1t25IdAh6xbl4Hx49FXyuRKkFtobkDOVtygac3vVQvHnFn3Bfi5JfL62rLwX+1JckxqZp0vRaC+5Dk4EJvd9Q/ZOgZTWptQpKokP8R9dZuDhyl6XUUZY8JfsPLnGrayVn8cxYa0zEtdlgzv+dsnxv9pXhgjjWTUk9Hrv9Jov0Y8/tTbuXUlFrtylNNvtNsIscrbUV6CiGJoxjItl/OeEwU3JngWsASsq/lmZRogfVw8/SuDvi8CfTb1/CFGcBib/IXjiVHtvZ7aLPFzFUQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a7be162b-3351-4a8e-8910-08db77ced4e9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:57:22.3094 (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: AyX2CsjxUmouqyJdXG9WX6FxmFUUchVcfTCoItZdFw+wymjaYt+jtVTJfu1qnUKpDn2HgBMOvwotjzBrwAPlAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-ORIG-GUID: d1tA46Q10tHrjYoUuiojRyaPOi0cwIW2 X-Proofpoint-GUID: d1tA46Q10tHrjYoUuiojRyaPOi0cwIW2 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Update the Documentation/btrfs-check.rst to carry the new --device option. Signed-off-by: Anand Jain --- Documentation/btrfs-check.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/btrfs-check.rst b/Documentation/btrfs-check.rst index 6ade9d51b4d2..bfdd48bbcbb7 100644 --- a/Documentation/btrfs-check.rst +++ b/Documentation/btrfs-check.rst @@ -86,6 +86,8 @@ SAFE OR ADVISORY OPTIONS --clear-ino-cache remove leftover items pertaining to the deprecated inode map feature +--device + List of block devices or regular files that are part of the filesystem. DANGEROUS OPTIONS ----------------- From patchwork Wed Jun 28 11:56:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 881F0EB64D7 for ; Wed, 28 Jun 2023 11:57:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231688AbjF1L5f (ORCPT ); Wed, 28 Jun 2023 07:57:35 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:6582 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231573AbjF1L5d (ORCPT ); Wed, 28 Jun 2023 07:57:33 -0400 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 35SBTOUG011292 for ; Wed, 28 Jun 2023 11:57:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=ql4gqAT5jI7slKWxysceoAQqTV6FL3XDczLSlmv0WwQ=; b=PQIYgI1vOugK5tEoJScRQ5J2REqxhL/V2zt/xLOkpaIftvkj3W2MeEVCtEV9mv5JqpUD hieyHh5BWZX8BjEr0JPJxSvVJp1l0lUzjsM1rVmc3KGqpjA/b24wuJ0q0mcHSD8z0/8z OC0sJjoLxlfmAGLGB6RpuWN/kjRpbEtxoHW/7cfZ9RgpNTH7xIb1s1JB6+DMhCMWyCFT +Pye8TDbISOc8rleeQZ3TNkxbbw6cMVKQ4xW25iX4fa6GlZj0YM6fExWBAton9UI0EAU j66xBdw/bsS/Yd44pRcR0UDKWKN74zlB1hCH+mTT7J7mUNDvWC1KpVBNU/dmD9eo6KXx 8g== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rds1u77pp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:33 +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 35SBfsFt029806 for ; Wed, 28 Jun 2023 11:57:32 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2176.outbound.protection.outlook.com [104.47.55.176]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpx5wb7a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GTSWjukqdLKU7QZjTGe5dR/lJBacn6edCLdZ6smh56Yxr/5fMTcv4T+y0lES10AIEpOSfgBap111viyOe8F31WvzJX+P+c/bDJZBUnEzUm+QGCMI5rqniyPTXN6DbiWTi4/bD2kShbwLCaYd5gIXaMa7Zqzw3Y6mVV254/KCrSnUaYjnVMy8yRSOcOPNInOwGNfrMOO/LJi0kn1M/1z0d7Tuh2Q0UmubHTcP3Cu/JqnKABqPvUJwu1EK516RW2lNdYJSCueXrCY0og3X2s9LXjxxI3Gsmo5+byvO+YUOLgkgIM6/T0RB6tBJPGzR7kJ11Yh8X4cVF7tn27NDw2ZQQg== 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=ql4gqAT5jI7slKWxysceoAQqTV6FL3XDczLSlmv0WwQ=; b=NocIqQNQI2aX1/9G09HGL3HLptsJ195s7Q/g9et1HrEOo4qeRTABPwQfQStopWck2GHshdhEg7tw5OZ0OdLbMd6aE+JY5TPVJEXvlT/XG2WpCc52GA5c4Y4eUbFxvASynmDTJTK/Crlb65+qxmETUQLFmu5BERrXA/5qSYvrvtWcBaoiDyewVFQdYFHuIy2Y3OJnBx1+UCvbuQkFyTfDJ6cQ7GleacJT0Pxw65xjF1Z1j3xmrkr7pF/A8uQYPo0eMebnvJLu8fI+7Yu6RLkhrCXDLTVqnEbrSxyDoAFYGtCEdqXsYZ/U9LDgbV7GySu3UqD7b+V1jCYcgcZOPADbhw== 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=ql4gqAT5jI7slKWxysceoAQqTV6FL3XDczLSlmv0WwQ=; b=ij9toI2agmtqKRl2BAV7W4gWvUL/VhiBg5MxW/4Ewv+1bNTDuGqAa3C62fevaxonEAySJmOyVqhtW1UPXcVVhP0dW48fZ1/D2MtTn3JLqOvkJqrLPcUTmulvIQh+NjDUio73XIaqwiR9XRU+3lNUVtxwqewgIvVISPLjV6vyKi4= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by SA2PR10MB4700.namprd10.prod.outlook.com (2603:10b6:806:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:57:30 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:57:30 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 09/10] btrfs-progs: check: introduce --noscan option Date: Wed, 28 Jun 2023 19:56:16 +0800 Message-Id: <9a7e479cb5122a04adf00a434eb003d6b386b8ee.1687943122.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR01CA0020.apcprd01.prod.exchangelabs.com (2603:1096:4:192::6) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|SA2PR10MB4700:EE_ X-MS-Office365-Filtering-Correlation-Id: 639d7c36-cb5f-46c3-4bbf-08db77ced9bc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SrZCT4tdLbcW7UDtsOZ/qJT+uekSTnXFvYwfg/rerKsYzCaRBPO1/VQvs5u8D5hw4y+7pNTx8vuoLhQF/pYH6ep4StwfV25Kn1ptFpiiAgc0n3aMSZ7qKZtOOMH2sK0TiykOjxtYLqO4HQtc5Q6jAbZ3dZJDuWAbXXCEdIfhSbi/GBBl6N3zfvVF0yo4nVEAiDPeo9GqDfOo732Lh4nB0MP9UUXPd85fn9EylhvF0tP+HvYakpr6wJhsXcCl5Hv3KChcT82CqtBDz04Q5cjxhS1exkk1mirhxPcxQcVf19INktagqA5y9jlKoKsSWXBdd+Epu+lmiy5xOk2sVhdzJm+D/v2HhsdmqPRln2boNIbgEe22tYboOIXvGA3zWk9PgxyDtinX2peZjt9sHTNAs8Fmia0EL/Pkpt9N9F+x4XfTJwLI7SYLtfZ2k71QJpeQYLLwc8nKBylhfhgV7fVwVRKAOujHvdR3fBHzVyPNcrBHgdQOBLNc6hYYuCAWGf0gm8iBBsRsP7W8scgilv2JqKZ2y/0JZynqBYY3vTTkYUHZllUY5nR8CpfE+Y+hFAwj 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:(13230028)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199021)(36756003)(38100700002)(5660300002)(44832011)(86362001)(41300700001)(66476007)(6916009)(8936002)(8676002)(66556008)(316002)(66946007)(478600001)(6486002)(186003)(6506007)(6512007)(26005)(2906002)(83380400001)(6666004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-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23WVP/ngou5tVqnI/YpTCETL3f3BSVDU6f+VWIs98XT/i1BftDFaCuvLVzjR+11UDycy9+I1jN5vknybUh9khHXCNqUB/IKbVUywFPteD6ZzXp7rPSWCJ0fTWFOKsdQ0YOu8s8fRh5PAkc2FZ1r49T+y/0UWaI7vDIU/femd0MFNN/Af9L8qO5JBN5IeYkKAbHLGJR4u/I/Ld2ec1iMdUyul/F+NLjtRXs9fzc4RG3aCzS+bawKl+gavsCPkC+/MsOLcQB1PvisgDCkW1l5U16TnGsLFerFwoXcP9FdhNtPG4OcWo0onuLoU29F/veHcRnQyAJebqkXbZvijsd5K/IqFkwh7yDF3LQA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 639d7c36-cb5f-46c3-4bbf-08db77ced9bc X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:57:30.5739 (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: pt4176izr0ieBp8UwiisjYMowUGrWRbFfluLErEZHlvDq7NoHQEr8oUPzA+D1/rtdtHIqMLHDprpCfA1vWKO5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4700 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 adultscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-GUID: mFlyn5eHbKT2C5eo_zBXHQArgzUUVUqX X-Proofpoint-ORIG-GUID: mFlyn5eHbKT2C5eo_zBXHQArgzUUVUqX Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The function check_where_mounted() scans the system for other btrfs devices, but in certain cases, we may need a way to instruct btrfs check not to perform the system scan and instead only work on the devices provided through the command line. And so, add an option --noscan. Signed-off-by: Anand Jain --- check/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check/main.c b/check/main.c index 7eb57f10aded..d4aa0db2514a 100644 --- a/check/main.c +++ b/check/main.c @@ -10015,7 +10015,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) GETOPT_VAL_READONLY, GETOPT_VAL_CHUNK_TREE, GETOPT_VAL_MODE, GETOPT_VAL_CLEAR_SPACE_CACHE, GETOPT_VAL_CLEAR_INO_CACHE, GETOPT_VAL_FORCE, - GETOPT_VAL_DEVICE }; + GETOPT_VAL_DEVICE, GETOPT_VAL_NOSCAN }; static const struct option long_options[] = { { "super", required_argument, NULL, 's' }, { "repair", no_argument, NULL, GETOPT_VAL_REPAIR }, @@ -10041,6 +10041,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) GETOPT_VAL_CLEAR_INO_CACHE}, { "force", no_argument, NULL, GETOPT_VAL_FORCE }, { "device", required_argument, NULL, GETOPT_VAL_DEVICE }, + { "noscan", no_argument, NULL, GETOPT_VAL_NOSCAN }, { NULL, 0, NULL, 0} }; @@ -10148,6 +10149,9 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv) exit(1); } break; + case GETOPT_VAL_NOSCAN: + ctree_flags |= OPEN_CTREE_NO_DEVICES; + break; } } From patchwork Wed Jun 28 11:56:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 13295645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 25E9BEB64DA for ; Wed, 28 Jun 2023 11:57:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231521AbjF1L5p (ORCPT ); Wed, 28 Jun 2023 07:57:45 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:2458 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231573AbjF1L5m (ORCPT ); Wed, 28 Jun 2023 07:57:42 -0400 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 35SBT8BP024967 for ; Wed, 28 Jun 2023 11:57:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=ow6YaI9oltxDzbRhjWQcqjUEAnzvTWUkA4lUZF1Jvf0=; b=w+LmuSaJhKdqLk7DqlrVb0h5yeNJO5f/vQ2EPZyhqVBnOtlMtSnGM9Ay1CWyi6wwIaFc UDoBOAC+y+DAOymR9uAvQvYI/9Mue+CLTmVrY0O3L3vMEse29KCDpJ79eXjHOv/9+zTt QVfimlhmS9PFR2I+ea/WmjI6KlGz7hsmbzs+Ygnp0cu7JOXtQPgRF4DvTLVQhGC2W7KL Ap1dUJ/61vbZU+RaQugtbeJdIfR/u2X8kLY4xUV4AKaRFtDN/BlBe2MCRvyUW7CdHfhI m1SijdpJ7ghFTvNQJA3ooM8oYGogiTf9QfsLK1RRLfDMwm16c8b5+ItMJ6QIkyT+/V+m ew== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rf40e5hyu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:41 +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 35SAcqxR004046 for ; Wed, 28 Jun 2023 11:57:40 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxbwt1a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 28 Jun 2023 11:57:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SMPH6Mpdwwyw6exH+DXDXVCqOIDhyOSZT736ie3SGNosN3dLBOq1dXv83ukNjAS/n+mBGuOGLyuzHbwRb8fzXLJK1agS7pPPUTMLGQCXH2/F3iWeS8WCEl88037w8HdLGzPAMsRQ9eomrK9a/CR45pJ1qF5O+T1FsD99D90Lbp4Rd9pD8TR/lheec/ukZ223RQSe++fsNnPyXIWuN5SZ40cbwKkE16W20p8OajEck0hp96Y4Z991hFkL5WpYZLeUy0NbdlPMOqLIANCS/+09l7JyI0Uxhcpjk+c9MEo8zBNrd3AseIMMtvexDusa1XCeqjlPIkRhh3IFr6bRnNef8Q== 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=ow6YaI9oltxDzbRhjWQcqjUEAnzvTWUkA4lUZF1Jvf0=; b=HJhlSNZpXt3Rs9oryrKsYWjxa/QA4MFFXPiCLT6d2yCuVQ93WhkZzVlnnlLVRtsRWEgXOxZwUggW0EhJI1x9GgNLGXHx0hknu5IY19pNkTTKWS/sMullPLQ0JoEAiWnFhcXIn5GVb/zzsaF+mPfe0whLYevAnjyisMm1gjEqSqtyiZaymIHKBsxH0PIiCyLvuQzE0S0AukYgVjfPrF6IsQZpqYj5ud6+ikphZarb9LymjzPrZXc1lTNra9VuLkLp4CHNe1+bItkFGrslfSNfnBfjRh/HJtWXEVkolfiLFmtA87CmkvzB39n38AaJXtnJAdI00VfxBN/FG/5k/3pywQ== 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=ow6YaI9oltxDzbRhjWQcqjUEAnzvTWUkA4lUZF1Jvf0=; b=CpYaeH31m2yAXHw+w3wEU5gFvp7mKjJpo1E4zuY623ri3OeIq+Zv8cKjLuwVGWVyKO2x7os9RCfma7fulTuiYE9SbHWJCAoI6nzMsFlmRfHou23KNBoCj2nIqXLhzHiKKD5xYRTca9ax/H/9pI1D1o0Jc4GIXoTA+SnCCYVsk+8= Received: from PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) by DS0PR10MB7272.namprd10.prod.outlook.com (2603:10b6:8:f7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 11:57:38 +0000 Received: from PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e]) by PH0PR10MB5706.namprd10.prod.outlook.com ([fe80::bc67:ac75:2c91:757e%7]) with mapi id 15.20.6521.026; Wed, 28 Jun 2023 11:57:38 +0000 From: Anand Jain To: linux-btrfs@vger.kernel.org Subject: [PATCH 10/10] btrfs-progs: docs: update btrfs check --noscan option Date: Wed, 28 Jun 2023 19:56:17 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI1PR02CA0011.apcprd02.prod.outlook.com (2603:1096:4:1f7::19) To PH0PR10MB5706.namprd10.prod.outlook.com (2603:10b6:510:148::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5706:EE_|DS0PR10MB7272:EE_ X-MS-Office365-Filtering-Correlation-Id: 244aa879-4b8e-40f5-8213-08db77cedea4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IdwxWwrsTR/TATg1BhjD/Rq7Iyb4ovbD3ZOj7vWtGxvpmq2lbhlyVYxC1dL1ETDRodC6XBGV5xIOtPhEsCg+7kcOSsm9z9gZKYreKuH8prC5nj4gqBUEAsbZOaKavZBeytzyowFy1rM5LETpn9xpcelU9vb0ABKC8sj0K/vPGhhVug1Uu90ThQxfPXOgxVQE4ppQ54w9bjh/saZPTT1SzV9GdFhYCFaJ7DG31Az4pGyqckjT7tqNQrEzOV63ILGt4fUtN1GVqbmou65fizeBxcfhaiZzATrh8UCoTenDthl/n2vn78LOxnzD/JLGQoQSS8xpHxSjXndZWZlQe968zbZqLAMV/kNpUVvJTSaXW2Rb6HNKYVcdvmF8QFRPwwxQY6voNYhDVJqqD1PSq9QrgEidyILhqU4rVbDiyfXAEVL6Lpaf1VudW9KiM5dnbcjWwt3lSMOUCWdtXhyvpx/TbDOi3uCBCXzqAB085RQccyftdl0vc33mYtXaIRjwHbgSYdC3jjFSptPO8nSGSnuwtHS8h9vssK4DH+XCNM5TqVbl6MtjuiJgYAleOmAqc+Co 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:(13230028)(136003)(366004)(346002)(39860400002)(396003)(376002)(451199021)(186003)(2906002)(4744005)(5660300002)(66476007)(26005)(6666004)(36756003)(6916009)(15650500001)(316002)(6486002)(8676002)(86362001)(478600001)(2616005)(38100700002)(44832011)(66946007)(41300700001)(8936002)(66556008)(83380400001)(6512007)(6506007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OZ5F5KiGYCzB/RxXY83AmPGCEwxZZ7XuOqihs8Snbieit0BZF+5zRvN6BWry36D8/t2goGsANBEbJe8K4cmJ/gZlx1DiBcAIZP+RRuVB/fUYVPpO+CvLaYjZwQFotLPWhagszecy5RCsLt2HTc+nswd244mf5Vr0AEHQlf3cpMQg8jHDtj7OQbiEmyZjvbXR8ZLiZBbrpcCQbp0GnPU8fYks/ahqLD8j1wYNioK5uKomBMo+AQmvHleSdBAAb6iAedwL9LuQgytDaX2IG50uEzLAp6ReNayfSwI6NdhCYIyBIMY3lRPbrxlQgvJb+AhgbR3QX7lYp8aWad+ghi8UeR2fx+j1xXYuFKSx8OtrKLm6ZlkdQu8OjFPV3tIklFeoj5Ad9SHOVHCT61/VxPmayXZuWp6Iv3HMJavoEjNfQwtp8/SLcXNH/yJGsZ7EGrj9D0Npxdu+g8vD7QNeoydn3B6dXmH/WuWIBiRh3lvB2HyOsbDrCyzL6gqtsiarbb6gL0H0+KNdy70oOAEZlBiBBWZDWVp2VXRNlf9RNq44YNRjeY/6NIFbm6CJrRMtGLCiqh3/IpNMzEclB966mqSEfypt9skJXj0ivW+ohbnizTjSK4bjHLHsNo7g1xK4jpLW01vVBib+lLff+aWqiJr5ASxqRO4nacEjTcabAhxwQ32zlR2sZAGlpvz8HM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O/uVWMyKId9HaxwfLbjXeQjZ4B2ZP44hnlK9FvdDvlmiUQbIjg1puh4h1dYjWy6uShmALImtD/ZUEKfwNRe28jbmNjZz4jwncYnzpnNPk9336mxjGxhnuwRYV9xMLEkHtYv6ayZNNctHFezVVlMEaFyfxT8pubSlhSbWU6ku+QWaP8A160+QFf5yYUmAanr3mbc427Pxv2IZLAJ8MCSherBrzY9sKckTJ8YSIxbbyuSiwW3f374QoDHoOywSEStgsceS8XXSPPECqsZFrqu6mykqOyC0K7Wi5Ww1xTZTdqmUHm0QkEiXBbvEhlaAIFaNygtjgayT0qoYBmvpPHfYGN7+fNJXGl4cd5d9M2uEgIDng4yETms8lpVXg/i+sniYy4nOKppPfYU860wRUN9UvNHhqQDkp8kBz0ZDs9yZkNAo9e3bnsCbyNL+NHPSRpjBkUXaxjuH4G5YTY0FVis/JaE25CYHrRZBGxf+c/sbiNEkWwaZjH/eTwpSkOaaT8Fm0bBUXEDk0VEAJJXI+laKN9OFf7DXpF4oqt4ZTnUq8MThX+wv/e0bdQ4jLpm2pN8zZiyFNSTqI+Z4fiX8I5z1QyNr/6CC1aEM18QH0d+eOqU1oJrkqi7j0CbO6DIpy4Ig/IbvlewFe+FTZmWJwhq4wL2hakEeRaCp9YLl54D6vkq24uK0RxqQZPddhC2PU9QAMUy//qiO+gks3WbOGP4Ww== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 244aa879-4b8e-40f5-8213-08db77cedea4 X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5706.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2023 11:57:38.6185 (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: xxzN0tfgdNj1VX7huvAON1l3Lz+qR3yeA9eIAXQLXU98/sRACY6hfgp99ivyqgZzrcSzRRS/AdIahBVtDhfkgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7272 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-28_08,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306280105 X-Proofpoint-GUID: Ru21Cc8PauL3PTGfUiejP1hGpQtR1mhA X-Proofpoint-ORIG-GUID: Ru21Cc8PauL3PTGfUiejP1hGpQtR1mhA Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Update the Documentation/btrsf-check.rst to carry the new --noscan option. Signed-off-by: Anand Jain --- Documentation/btrfs-check.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/btrfs-check.rst b/Documentation/btrfs-check.rst index bfdd48bbcbb7..5f4f724111b9 100644 --- a/Documentation/btrfs-check.rst +++ b/Documentation/btrfs-check.rst @@ -89,6 +89,10 @@ SAFE OR ADVISORY OPTIONS --device List of block devices or regular files that are part of the filesystem. +--noscan + Do not automatically scan the system for other devices for the same + filesystem, only use the devices provided as the arguments. + DANGEROUS OPTIONS -----------------