From patchwork Thu Oct 21 09:17:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 12574355 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C04AC4332F for ; Thu, 21 Oct 2021 09:17:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2D816611F2 for ; Thu, 21 Oct 2021 09:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231336AbhJUJTt (ORCPT ); Thu, 21 Oct 2021 05:19:49 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:37940 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231153AbhJUJTq (ORCPT ); Thu, 21 Oct 2021 05:19:46 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19L91dNL013146; Thu, 21 Oct 2021 09:17:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=fkRCxQ++sk/K3IQnDc4XmvjoP1osLq2GLGCtu2Y/lDY=; b=zMPdKUJV4mQ8vWrHXjQjGdu+huiaqm6FB5r7v0QXKSyoWX5Y3G83KSLhEDeHe/c1EEHy XsI6he7bIJOZOmrICJGjDodZGLfTH3KMbexysiYblTHDoOvt11n3yRv/iLCmixw9WsBT XYnpehwsoFMa0AAa+dFoH0U3ZdSdlycUwhX06qj5u6eq7nIYWwlN+Yw1P8nfGPp9kMSM 4fEjjONVnBLOjyASsZlZfZtMCcSaPV7QDmjx9GjDFAyF8neHJ2x8wG3eV2IHzyT3s1jY GuTcsBCuevXiyGpJuwP3AFPB/967XccTX1saduevM2P9ZWTSyYnm2IOSgCDOiFa1NpTi Yg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3btkx9wkwg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Oct 2021 09:17:28 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19L9BdYK066145; Thu, 21 Oct 2021 09:17:27 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2044.outbound.protection.outlook.com [104.47.56.44]) by userp3020.oracle.com with ESMTP id 3br8gvn7t4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Oct 2021 09:17:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PbZUHIz1+pQ+ezl1wVRCa7ajb7ZGKHeOimgu9KfOCLDNrYi2Ig98V4pQusNht5OQ2s5oaDwL9hB+UjJyVh93OrGhrOsyEtleCUKdSibvK1pzN6qPiKOkgDjWD7bKc092NlYhcT3TXaZVPQZh7IcWbscc71yiT0uDlA4QCeObV+DzNm7VWJMnNqV+mENqCkckOF2COTnIaER4kOE4hyqrRfZdUOlfTrJFPWLThyUq21hqJdfuD+W7Q6jGl2orehM6KQiSbAaheEQ60sWfXHOvOC+ummbobUVs39lYJaJKB4OsxfA0oL75vB3N6g8InslToWU82UFw40Q56p5PYrOW/Q== 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=fkRCxQ++sk/K3IQnDc4XmvjoP1osLq2GLGCtu2Y/lDY=; b=Jtyr3HDfmGPZzmNG3pDqxJte9CN6MSVBYftQd4Qexdmt7++XJhJjRgwL+VQuBV9aRaFpHtYPi0/ZEd2ES5XROXViYKZJYdgoFbHD0Gl1phvBZc24lwYjfUwwSeoSIzM2plT31JO1DuQixCVaJPHKJ3QALtOlhvovPmaEQRqpI2I6caJxvirknIBlhMNoM9W9Td1IXP+xuvqbJeunDdWFguHOJUzW4M5j/QKNVEmVz60iXzW6WqpSv4kIjy7mBJ1PYrxQ9IZw7GDTO6yf09gfDxdLaUp3ajCIvs97ETgEzm3KAUm2Bg15SrDyjM6yYxj8hA2h4PifJzy7gaNDuCv5bg== 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=fkRCxQ++sk/K3IQnDc4XmvjoP1osLq2GLGCtu2Y/lDY=; b=jkLmR+lQ3HiEQaEmybfHftYNfjbGZ88tyogvZtIgTypg5eTW4SECGykaJvFy1li/ZEzoRfOllhzpgWVjmSGZwJD3Y7IGMSqBVS1gLReJzKeih6iAFQlzItL514NtVa/6UzWbIAIa7xDDzAdoT569IubUPoXzSBoQCKSIlXG2Was= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) by MN2PR10MB4287.namprd10.prod.outlook.com (2603:10b6:208:1da::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Thu, 21 Oct 2021 09:17:25 +0000 Received: from MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::49a5:5188:b83d:b6c9]) by MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::49a5:5188:b83d:b6c9%7]) with mapi id 15.20.4608.018; Thu, 21 Oct 2021 09:17:25 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, josef@toxicpanda.com Subject: [PATCH v2 1/3] common/btrfs: add _require_btrfs_sysfs_fsid helper Date: Thu, 21 Oct 2021 17:17:04 +0800 Message-Id: <482134ca6a531a3d1f29326c0c7dad536f66de6a.1634807378.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0015.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::21) To MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) MIME-Version: 1.0 Received: from localhost.localdomain (39.109.140.76) by SI2P153CA0015.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.8 via Frontend Transport; Thu, 21 Oct 2021 09:17:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9b7a24db-7734-40be-993b-08d994739867 X-MS-TrafficTypeDiagnostic: MN2PR10MB4287: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L5lO+68CDoEMcrpbYYUPVU4RoKote3mRxc6iHuAf0jj1GQFHF+Q7ZE0D6694ChHOBO8HOBgtnQehCYbHaTu5jadF+PPpVNlLeJOOyBzMSyP1pEfYBE727V5NbjKGb+un3JZb0dcPrNDugNI8/3IwIt7QUA8B0LAJ4QicBQjkGGBwrEssa1fypXM5LBxvIjMgg0mXanLjXNLwiISVoaEu2e0yDpgGFYHIzk0U6xPZNOXvczkkjE9s7Jzk+M1W+GrEW4PWhTPYpEWZ6qQ69qv3IJCj+GAlPHAwjk+Z3yEXVS0k1eVwIY9aHb4cX0o7j2RYFQ9XiDYbMlLeV1iMteA2mueR3r4X7e/xKPDaCAJqOnVlXK5YZR8KZ48+x3Su2mHI8YvR5DBdsHwCqf8TAJyfNV+I4+zLFjYvhrfVQ0eCk/WxYufHVEn8QZALh+05eC2TYMGtg+uydUK+UiUcnaskpSeJjOYGra/vZNEPbN6AEdqDUry67P4MD0tWakKX2tVWazOLNqve17Lk8tP4hRdVmfUjC69HiN5w4RhhPkiUJs5dQpe8mq/aQ1i0TNEteeKTWqaorJOI/uQvdNV1l8qsFkRw+j2lU2l2iNnDiPHg9Me0AUH88I1kJDO3rtj3Fb/PG2Z4BG48Zok97kRYKtYXxdwufz03uc35LTRXrm9AKKpTOkDIVsZMAy8zNk85j393X6BWIK8og+Ri6y3p5F90rg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR10MB4128.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(52116002)(66946007)(508600001)(66476007)(38350700002)(186003)(36756003)(66556008)(5660300002)(8676002)(86362001)(6506007)(2906002)(4326008)(8936002)(6666004)(6512007)(316002)(2616005)(38100700002)(44832011)(26005)(6486002)(6916009)(4744005)(956004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SOt1gtRykFWy7ACAEdaFqzeyzD39ClVIRB6QvOKrf7OFjg7ZmTXxsXjNDxDeassEIMXKyp0bJizs3EpdP1k6ydbp9PWbkXL8tVVbJSGldm8vCtz9bFWGsJk59vD+WaACmKZiXI9fCIgAUCuFQ3tbQbcgzWRH6o7+nFUEgnnrmpEJ7jOnoTLTVpPcPYxmPLjrNits0/lMvNQbdau3JKjdwAyIpfg2d8rd5QTqqXHa2gO+DPW8m+/A6Wscm1jPTA/785+Tv/KGbSOwxPfpVUdP3e0JPc8soaGSg3jq72rtQ5lqU4DD5uzvQsy3T87+U35VeKUUpvkWxvCr/dH+aKVjTFlsFpTx/xTLpvi3lbyfhEkix2F0vxpLgs+n936M1owvTw/yziOLzuepe+/tIDCSy8NxI9ADnX64YkzH9AAdtB7ylNhDhX8UkuvJbbr2tZjQl6mw4DzthXFzU3rsb9Lmm0lQABdFyEY9tKFusxtiW4uMSY91UCsa4SnlBCcoUyCpvyPNP59ullnUP/cJ0cNQ1okKyPqNFFsTBlWHGLyz5suDi4AxLDaaELsk7rCgSlrATj11cTzXV1ERZhMLe/+2YqmsGeWnuMlBYCVBZ1ObGTe9buKdWb9NxMcbFydO2N5RABlb12ZxcgAMzcxVHO3Yp/YJjIqrd68Gw7X5pAB4kT8HFXxNEcg9d8kD6Wy+hRNL2o7Qqa3N3iEsUosrr1JP0LgK8HhhIaVKrqfmssr9pq5PMcL32bPVUe0wmIN8UMu+1vjKxCZYzZcpCOiaqTZjy0CzviAIe+La03HEL+E3BZl2tclvBih4xtUr1g8XJHJg0IXM6wCzCE/5UjGLvoO1X1XWMBeneTYB/u24ugnjtFoN+V8q3V0ZfDsGjJOLMcPBPnOk9FUsdRhgbxFjjOLSJlkkyIOEvZRQFWFJhuMqyaxSaNiPd7j7mAS8CX/tOGK7xiY8UZnXv+Wm54MMgEmbSrwJSAgBR4yfYEk0jf+7PkVA4nJg5tGxsTmba3b/MLwx9HkXz2FJb3j4U2lNWdCqzwJud127WD+Ph/AcjR9PzVs6kUggjA3FzVY8FgnypWaUad74DMrZZAGe8uwSqScCEodVTknEAhT4Hz+4GTbMis2TSf9DudP1LQKUUx0EM+O3C2xcxjU4bHfAMx+j9tKfPuChdicy7vBgwT/wxMsUVuPYeLvC630adRssqT5eCD3C2OaBOjxbDEEdN8jO1LC/QdCgj+hz+nGeIi4bs7WGjHDp1zjD1gXpy5yKfoGyA1v827dAzTpPRdHUENpxSvO1uwKQkPgvuxt1pT8g3Mjr3/XDJpKnKQMJjj/WZ83xrMRhVy4Ufgr6CKDUOVG+xXpVM//5BZmOKx1O25yktrOl2C6mFNuYrlmABlqFXuY2J9ip2N/JdFjDipXB/T2oJvlejJ/sRKLRmOZR/pr83KBBjiM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9b7a24db-7734-40be-993b-08d994739867 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4128.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 09:17:25.3132 (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: anand.jain@oracle.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10143 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 adultscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110210046 X-Proofpoint-ORIG-GUID: aQrTfVtAwvfNrTESia08TFOU3XWWdz8a X-Proofpoint-GUID: aQrTfVtAwvfNrTESia08TFOU3XWWdz8a Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org It checks if the kernel has the following patch btrfs: sysfs add devinfo/fsid to retrieve fsid from the device that added sysfs interface to get fsid. Signed-off-by: Anand Jain Reviewed-by: Josef Bacik --- common/btrfs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/btrfs b/common/btrfs index ac880bddf524..5d938c19b56a 100644 --- a/common/btrfs +++ b/common/btrfs @@ -445,3 +445,17 @@ _scratch_btrfs_is_zoned() [ `_zone_type ${SCRATCH_DEV}` != "none" ] && return 0 return 1 } + +_require_btrfs_sysfs_fsid() +{ + local fsid + + fsid=$($BTRFS_UTIL_PROG filesystem show $TEST_DIR |grep uuid: |\ + awk '{print $NF}') + + # Check if the kernel has sysfs fsid support. + # Following kernel patch adds it: + # btrfs: sysfs add devinfo/fsid to retrieve fsid from the device + test -f /sys/fs/btrfs/$fsid/devinfo/1/fsid ||\ + _notrun "Need btrfs sysfs fsid support" +} From patchwork Thu Oct 21 09:17:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 12574359 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 479C7C433EF for ; Thu, 21 Oct 2021 09:17:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2FEB76112D for ; Thu, 21 Oct 2021 09:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231424AbhJUJTx (ORCPT ); Thu, 21 Oct 2021 05:19:53 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:41346 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231394AbhJUJTt (ORCPT ); Thu, 21 Oct 2021 05:19:49 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19L96cIj016734; Thu, 21 Oct 2021 09:17:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=EnBKdfXauWGEHZwUL5r0si5r3q43xzKHEH4bUFfmYvo=; b=OPvGEdImacSwH4AW/Q3XkBb0x25fpGjddh0KQ+IGAMbf52ObBG+YwWadSqTRQqIfqrbq djJclwvClB5aN7092p8JFZtDYEaRI8SwsrBznIqDdE9yzlrelEJ9US1t796HdBqW+mRM w8tXgA9iXJKBY6rVxKWcIdNN1nsrp8W6IwHhqbHfUMbIh13w2RcBoWZOWp4Lc84T6hHk ygL0b8Zv1Z/Ho4XaVy/dFG8OsfpKaRZsQeNch2ZiIsN8P+mh2JK2S21GVIkOYr6KCJYY Jq1NRr8PxfFj5rFMSHAOivcil/loHE1vwl4sLlF3aVDYTzsDZiYdSfM1D9Y2cCDyGzix Hg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 3btkwj55y7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Oct 2021 09:17:32 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19L9AsZA010094; Thu, 21 Oct 2021 09:17:28 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2042.outbound.protection.outlook.com [104.47.56.42]) by aserp3030.oracle.com with ESMTP id 3bqmsht9ry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Oct 2021 09:17:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N11PsmqT+6grJXNcig77QtZSAM013X+JhD22YBr7R7R7ivIwEkKjS2TrNtCNgiIAX/NfyTY4SBsmjTlymkoV6W27RISI6zLNV47TIvJs+TpMKtHPUEvrL2cYrTTyxYIPG/BAX7Ti8bp/gIxLGbGMFVjeHvrL7UsBXhHc7HWRUvESjn4ZD7/7n4rzOz41L5eP/JNDe5iYVAWhnaNrwzVC9XHN4y9wM6486DcvkSOZHOZCcBDRDb1gQt8eCSD55jOKk/9MatmJ3l9a7xBgb15oS96if+ThIIrJ63Q5qkCDzwsJrvNDbUs6VSN7XbKsTveG0i9ayQWiljazBCf6DXfhCQ== 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=EnBKdfXauWGEHZwUL5r0si5r3q43xzKHEH4bUFfmYvo=; b=FtAEMxwiZ9W3/gdgkL8cGQHOKHun3O8mOmpK48SStbEQtzM2bXTdWJP2yG8U0GkhaxZ5yF7ZYJz4vI67jfHA3UilwU7HlH+9l94jj5fhsq/MFN3nmxyzQhTqSGuw1Gj2yAxM5SuYWiKV61upLhSJtZflR4cMXZ4seUSkeWhNNgINAeq3POPgo4AHRSfB1XQVU8WxUiH6lJ9fTt09fHUQbA65FVtGmoshxzBex6KvjC82JHyiNNSG7BuVilXZ22MLUzfNYbVd5y4L4vYbScPAscBoK72QC6c/llKm5nCgVEv7BMCwrFP7IBa/DXDOmb569KD0uVw6nBT3ScPp26qvKw== 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=EnBKdfXauWGEHZwUL5r0si5r3q43xzKHEH4bUFfmYvo=; b=qbVhOyN7cEErOeJO9Gs2yvzBOZC18/KfxtZdxtPLMjigX6/Y2IMbGnrvDzyP3FjclgTM+odRqV/a2KJ+333L7ejiBgR0o874Ck0CUgQAbxVglAN3Ew69dG7hfLEGQI9K7KJsh/aRxF+aA7Bur2GEcTUHfs573NgDkFYfg+jH8JU= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) by MN2PR10MB4287.namprd10.prod.outlook.com (2603:10b6:208:1da::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Thu, 21 Oct 2021 09:17:26 +0000 Received: from MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::49a5:5188:b83d:b6c9]) by MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::49a5:5188:b83d:b6c9%7]) with mapi id 15.20.4608.018; Thu, 21 Oct 2021 09:17:26 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, josef@toxicpanda.com Subject: [PATCH v2 2/3] btrfs/248: validate sysfs fsid Date: Thu, 21 Oct 2021 17:17:05 +0800 Message-Id: <7098e26341837e377d1e67fc9db28fd291ad8d5c.1634807378.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0015.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::21) To MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) MIME-Version: 1.0 Received: from localhost.localdomain (39.109.140.76) by SI2P153CA0015.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.8 via Frontend Transport; Thu, 21 Oct 2021 09:17:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 51a26f49-b2bf-4de2-cde2-08d99473998c X-MS-TrafficTypeDiagnostic: MN2PR10MB4287: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gGXHWAUroqenmcoaL798nnMUBltD3kF64aA28cubf9bD7pl2Zy8sk0Imxy1gcugf8gC3U41IRrlG58RDwzZFNbb68fsoJjVPZ/xlG0nDKk5UGGbEQTlrEoLQIOmb0Ua5XP4dMu8MiQF0h0MvnooI0U3aQtznxkovtsGPXcQ/JLdixiPwTgI1+ejg+OkqT1S1Q0oyV1/efd31APscV6wevkzRaaS63HVTF1r4U0jlKQ1OWp5oxP74yMR2iqgWKmJuj0JwSQ9Z6abxb5edEyqPGs7F0zgMW4b1jQC/W9eM0DbegVD0CiFf9ldJ8R8GXJOC3TyAXC4vK2RwAoz4e6e8tjNAAE/QzSLw7veFatND/EuzfTRNwOm5YCi4HUtJb9Oe1YXtGVlJYQ7mQl/z0w0LKMx6fy0BvJOne8CD0NK43e67IvNGOV0tidipvtIa+urxj/zhNiMRkTPQ7ZFHG4b9U2MnpIS6UcLhSOQdb46mgQ7sw+l9cFilDxMnzphomndbsi0XktzLVMyXoCl9OJQ/Pb8d+8TW/yqzhRvrOZM4L/cffJHr4Nfx9gvQSA6wF/4OZXGUa+bwo6EgrwTNy2uSUWGYFExw2SVBZ0KJEq9qAtZc/MOrDlOS7nIwjnWwDzMnYCTssywW+bek1wLBOFK61dQk4fbA0P2aL/C6yojixWvr7ibn6ZLv+AX1nDpuaO2CYjozQssEjDAjVfukh8+lpQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR10MB4128.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(52116002)(66946007)(508600001)(66476007)(38350700002)(186003)(36756003)(83380400001)(66556008)(15650500001)(5660300002)(8676002)(86362001)(6506007)(2906002)(4326008)(8936002)(6666004)(6512007)(316002)(2616005)(38100700002)(44832011)(26005)(6486002)(6916009)(956004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: f3CnRTraMfRXQv3+yMRGayrhIS5Sf4+HptKxbV1QDFXT46eVityFzlrZqONhkI2cwvKj6U2nlMJMabV/c556isCaFZlfrkT5HPwv5URZe/XUdxEt2m523uEsCK7tCGEbvlj3w00MHu0jx3shhv7zrQuSYC5ygT/d65sDLxWs1LiAKeBnG3DuYGviLggKReNxYvTKU0WCMVUHpk0qK7I/hIB0B0SXbuloyP6NDEMAzi6NeZ1qsdWIHKppuhMYqy5vXqWEvcTFzKURu6gPhqSMLjHdP6sZ+rJY8QL4HJ7TTKXY1CGAd41KujtAoAIlMbhODwCwULguQEKuZ8YzzD9PR0XtE/EUEX+jP7QhxAnY6VotBXpNvl2a3Yyl5MKOsRORWaNg5CcLDd0Bf2cgJ5d5QJa/hXQ/TaVqFttgVl5XQstGDhsDtNSaUKpAuqpX3ITiVPmRfHMkaNfm7Rd477uMV5J6eEXTT5LE4Qeum1MM7gjkznFoNb2auybBvJKPFeMZ6xrGm0doLGFogq5ls+7M1/PkT++1cUulANIg45oTE1KlIrEl+WzZicx303OjdoxoKTAGxJQyjgq30uuLxp4+N2gkmwupjnd1uC40ppZ48tob5dnWTV3zlA5FSBj7vMkBOeaQv8vmsLK2IZLOvGu/oTRPUh3snt6jbOXDR8ubG7UTykOkhCnchIROv54WPdhVza4pPUfNO+wrZqobwsbeflmo6zn1/oCXrs53vuZKHz2tdEBEdFFimuNmJmmUSbiV9b6ZpObIeehHGlVZHQy59aYRUxA1RVsynF7oZRUPk7fFtxEFDTNQ/MzTAGpq2doSWEcDomiLw/6KmxSUlE4ZDeAyz5PgsArU0ACqMj90SGKjUXkncV5xe9OZQaiDlDiT5o7fVQcfU26bVopiCL47gT8ORyabCe5JfW4IP1pWSecb+5G9o7ShkRIWZ5MigJoNQJQzOvPnSHr0Up5X6r2N9qIp+b0ClbsKf+NXVswCfFypTfOEogJy6SSKEKZ3mmdyqlv3VtkAId5SnzdEgspQ48n9+lNEfxyWhHPqmKLj56le3g+11ke6KCgTtTQK1w6RvWDSfRPzI3g0BV3VOR7N1xpA+fX2eL4lhjAflqaUtM+uFIRchejPOObBPlJMKvWDpPp/KesEN+pMjE9yoErmJjWEPM0wxgBaEMz1nyUw1a/hImrawgfLHCwp2/+i+H4c77+Xhyf2nFX9BB5vBpEmht3dHnnpsfpeJe44fzdZKJcZGIseoIMh4vJOxXn2/hygBNYU80Z/xsK8Pv+lnqqNEfBdgml65FYXRGPKmdhM2g569qAQWUnLpEv7bcv8C0oqWOgPqzXia7RhrhdjSUVWRXkx5IyMscOpg83auso56Dct3+08J3AtqI0GEbYLZq0XLbdib6+wysddnzC2gEvGqV5U7bkIL57jsYoCB8tEGHg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51a26f49-b2bf-4de2-cde2-08d99473998c X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4128.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 09:17:26.9221 (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: anand.jain@oracle.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10143 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110210046 X-Proofpoint-ORIG-GUID: ACl7wdQNXAEul8maLQ_XXhhmION2y08X X-Proofpoint-GUID: ACl7wdQNXAEul8maLQ_XXhhmION2y08X Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org Validate if the sysfs fsid is the same as fsid as obtained from the superblock. Suggested-by: Josef Bacik Signed-off-by: Anand Jain Reviewed-by: Josef Bacik --- tests/btrfs/248 | 66 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/248.out | 2 ++ 2 files changed, 68 insertions(+) create mode 100755 tests/btrfs/248 create mode 100644 tests/btrfs/248.out diff --git a/tests/btrfs/248 b/tests/btrfs/248 new file mode 100755 index 000000000000..856cd489d4e4 --- /dev/null +++ b/tests/btrfs/248 @@ -0,0 +1,66 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2021 Anand Jain. All Rights Reserved. +# Copyright (c) 2021 Oracle. All Rights Reserved. +# +# FS QA Test 248 +# +# Validate if the sysfs devinfo//fsid behaves properly +# Steps: +# Create a sprout filesystem (an rw device on top of a seed device) +# Read the seed and sprout devices fsid from the superblock +# Validate with the sysfs fsid + +. ./common/preamble +_begin_fstest auto quick seed volume + +# Import common functions. +# . ./common/filter + +# real QA test starts here + +# Modify as appropriate. +_supported_fs btrfs +_require_test +_require_scratch_dev_pool 2 +_require_btrfs_forget_or_module_loadable +_require_command "$BTRFS_TUNE_PROG" btrfstune +_require_btrfs_command inspect-internal dump-super +_require_btrfs_sysfs_fsid + +_scratch_dev_pool_get 1 +# use the scratch device as a seed device +seed_dev=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{ print $1 }') + +# use the spare device as a sprout device +_spare_dev_get + +# create seed device +_scratch_pool_mkfs >> $seqres.full 2>&1 +$BTRFS_TUNE_PROG -S 1 $seed_dev +_scratch_mount >> $seqres.full 2>&1 + +# create a sprout device +$BTRFS_UTIL_PROG device add -f $SPARE_DEV $SCRATCH_MNT >> $seqres.full 2>&1 +_scratch_unmount + +# record the fsid of both seed and sprout devices +seedfsid=$($BTRFS_UTIL_PROG inspect-internal dump-super $seed_dev |grep ^fsid |\ + $AWK_PROG '{print $2}') +sproutfsid=$($BTRFS_UTIL_PROG inspect-internal dump-super $SPARE_DEV |\ + grep ^fsid |$AWK_PROG '{print $2}') + +# validate it with the fsid as shown in the sysfs +_mount -o device=$seed_dev $SPARE_DEV $SCRATCH_MNT + +cat /sys/fs/btrfs/$sproutfsid/devinfo/2/fsid | grep -v $sproutfsid +cat /sys/fs/btrfs/$sproutfsid/devinfo/1/fsid | grep -v $seedfsid + +_scratch_unmount +_spare_dev_put +_scratch_dev_pool_put + +echo "Silence is golden" +# success, all done +status=0 +exit diff --git a/tests/btrfs/248.out b/tests/btrfs/248.out new file mode 100644 index 000000000000..58af9173bea3 --- /dev/null +++ b/tests/btrfs/248.out @@ -0,0 +1,2 @@ +QA output created by 248 +Silence is golden From patchwork Thu Oct 21 09:17:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Jain X-Patchwork-Id: 12574357 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6719DC433FE for ; Thu, 21 Oct 2021 09:17:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4667F611F2 for ; Thu, 21 Oct 2021 09:17:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231406AbhJUJTt (ORCPT ); Thu, 21 Oct 2021 05:19:49 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:39056 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbhJUJTr (ORCPT ); Thu, 21 Oct 2021 05:19:47 -0400 Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19L90dSn009088; Thu, 21 Oct 2021 09:17:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2021-07-09; bh=pRsBeDPQ9BwQHs8LTTrzGOMQt44PZWvIB9jwecsNB54=; b=om9xUuzlZmyoxzvJaIvGaZrIXfkLMzD9FlvxyY1e0gbfxU/zSb/ql/NDcPkWB3zLkHC5 ovnCMgIhKnT0fPmm8Li69A4zXmnFrVuCofRSW14fL9aA5F9CA+8QMSTh3VxTeJ0oNDMs +ys+jbDpdXS5dS8pIcrD6+st9l0t+JsVa+lo/78jOSv2fouQz4xd1zHltQWQEFStAj9v 8TQVRpTqQsePBMlHL2KulQ/toNfmyDvedk5WHEIiL8Rfx8uw0ixNlGqpviIaiquPh7ih xxKzHGzeOuDxmb+vicv4hvOaVgm1XL+LYuGMtEPAHzz9r8F4nTv+awsRqxTJCoKC+rIw Ng== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3btqypkxd2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Oct 2021 09:17:31 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19L9BDKo124589; Thu, 21 Oct 2021 09:17:30 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2042.outbound.protection.outlook.com [104.47.56.42]) by aserp3020.oracle.com with ESMTP id 3bqpj8eube-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 21 Oct 2021 09:17:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V+ZNmjLQU2MeqlyLV1VRQECdxmUkdW4Bkh+zJwH9vkaPPoTDd0oVul9ZqP1BIr7CzKJsp4D0D7ZW21NXgqru+ZHSays596Gs1sdxmvBUz0LGVsct9kRn9U9bI1V0djM/109iniTtnINd4vDk/lgQNqvdfaZsozdbeeSA9ruYn2bxK6I6DBvVL/0Yowi5PnxR1548dxqYQHrKMb2MVSDqeiXzFmOpwcDASOHqxxiFQeeblWYyy6yv75mAV08c0HqWmTRGrvsl4CejpFgY5CPF8QlfYttF40hRBY9iiJNT4TQwFWQWGDBzzJaEYkR/kTRaqXi98hmMz7/m2oqPlWFzBQ== 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=pRsBeDPQ9BwQHs8LTTrzGOMQt44PZWvIB9jwecsNB54=; b=Wobt1A8450dLGFk/limzyLlUcQkQX7vLdjZ3nbsG7OU/0orm7JLeMaJ2nNkS3YJf2y6JuI2y2szY/RoBw0mFxgd1twnJw/9SpFjYpfKmkyeFtNy0cDcjCsG2op7XO3j/qi3C1M/rSy4wcc+rpkIOw6VcIOMsaGrT/VnPcp/8mNuLaZeXkQe0evRC2/1jgLmpBLdJki7AwrDq4ULv4N0pcKoCVzc8h7ecCWJ1NFS+vImqf499p7NVU912HfA+6/l+jWl4Lo2jWiEs5MtDzcB6BvH6NNFV5PRMuuOm6uC22N6AHfiiGbtX/Qqw4pDpGPaLUQh9HN6GSzmXmcz+529HIQ== 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=pRsBeDPQ9BwQHs8LTTrzGOMQt44PZWvIB9jwecsNB54=; b=a4XjHEXPNwcPUoyw7XVsPYFwR9Xu4pI3+ILK3BsNL1oyXYG6GhJuNCes2IZq5n2ZsFtxZ7MpJEW1oDKDihZJgpVHTM2P480o6O9qxXqtM0nyj+WvhG+jJN8Q7fu/h8GNMWVNndXDtRuncNogI5wU/u7RQJ61tWOQFXqLkr1X81Y= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) by MN2PR10MB4287.namprd10.prod.outlook.com (2603:10b6:208:1da::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Thu, 21 Oct 2021 09:17:28 +0000 Received: from MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::49a5:5188:b83d:b6c9]) by MN2PR10MB4128.namprd10.prod.outlook.com ([fe80::49a5:5188:b83d:b6c9%7]) with mapi id 15.20.4608.018; Thu, 21 Oct 2021 09:17:28 +0000 From: Anand Jain To: fstests@vger.kernel.org Cc: linux-btrfs@vger.kernel.org, josef@toxicpanda.com Subject: [PATCH v2 3/3] btrfs/249: test btrfs filesystem usage command on missing seed device Date: Thu, 21 Oct 2021 17:17:06 +0800 Message-Id: <56e053b9a4bacaa7d46ac24506a186602f0bcce8.1634807378.git.anand.jain@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: X-ClientProxiedBy: SI2P153CA0015.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::21) To MN2PR10MB4128.namprd10.prod.outlook.com (2603:10b6:208:1d2::24) MIME-Version: 1.0 Received: from localhost.localdomain (39.109.140.76) by SI2P153CA0015.APCP153.PROD.OUTLOOK.COM (2603:1096:4:140::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.8 via Frontend Transport; Thu, 21 Oct 2021 09:17:27 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7cb8823b-fbbf-4832-d9e4-08d994739a81 X-MS-TrafficTypeDiagnostic: MN2PR10MB4287: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AOU6eKIEDqhcexa2LmXu7lAHTBAWvesM4oyvsCE6HsKepQHDAROTjPl8uywkVd7BU2STd3Tbk6Ksb9m33Rvm/nA406TK09GeUNpGgQt3jHDXx4aVyc9pNWx8l1YYv7sSd3onQgISt/TxlQ/82+CFDKukdZfWzAFsTyONbltycZvvCBkQEjn6a/Gs32yzKCovQgDBMf8AlVNBSX90ZabuCWiFyz6T8/mjTYvuNNLas37ndiNtXn76O/JwJj1MSOOGk1sk86JzujUez2CuwjGNmFJsS3IkRsze+OodSMY85zlBxISx9q0vA4j1gxUl2KbVoA5ZN25FZud8AIV22j4l0jPiUVYmniEmBRwGobQ4aWOEpasdCDcFZgCUyYxw5ghyVxEe45J/lbzvVve4uAJ5kwRoxGQSwkEKNtFe/KqQ1UJyZn9gpZScGm2EEqyyXkJkXahHEXW71y5m51rlFYWd+b7G+2yHVhIApr8t06H3VU0j7mxehTmEc/ddoL00RRkdI1r8ogoEAKJbM2bug/uqvPX7ENOT6TIAyF7W2VUX0gg8DsKdjVXPY+WJsz4Tu+kI/iMc6MJeS/zsn1yfvcA6j+kffCNfoXls+paxWs2d0GaIv42k/58QLZgCC5NsJ580usyloZLGGTxCwLcvI/JxsCs9JkDJWtNNEsnXUERqiE+WaYyhHoY0pqT3qJbQV+pL78fdCP3xY+bZ93GaT89qgA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR10MB4128.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(52116002)(66946007)(508600001)(66476007)(38350700002)(186003)(36756003)(83380400001)(66556008)(5660300002)(8676002)(86362001)(6506007)(2906002)(4326008)(8936002)(6666004)(6512007)(316002)(2616005)(38100700002)(44832011)(26005)(6486002)(6916009)(956004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fvv1CqImI1wPEe3pe9jV0fYguNoVVmjxZpHyzxxnVDIsKHNeeEPU+xczEdft/QK3LFcrbo8nbVIx2i/UGXkh8KCRmGc7ddaxJVNzTJrBm9iFXPq4CQ9OckCtVWFBmVDq7Gu5M1VXwiV+u7//QX0pvy21qJ1Y04Y8kjndVaT9wa7RKK0eZreKSctr2Yp9G44EzICMuI6qLEOdIHNzuffMfRUgooRMf+u/pnOzQfr5zL8PYkqBMNDchtMTIj5ZqokqruvsP88RGpnhYzlgvkbzjHzjM4EDcp9c9GjhBa8tS7h1GiJ43wPQzWlLlnXgS+/5ts60Au2Kf4cJ3OsLWOVd3OC3WZzWTq1phHv4/DonTwI9BB4qDCKHSBPe0oFS4X1I4DG8wmOXkLXoLI5CV+YilBtOfhTrWTiMjZbHVcLgq2y6jWAUSrEG3M2SL2+q1ivK0iFiVH068rP6ix14lDRnxRl8c/ME/dCW4VXZ8IE4yJ++IbSYmbF5g2rLzoG5SCFJMhauQHglcd1eN+vqeSAZ5BiqQWNUFTwqZN7l7W0xe2uved9+7R6LDXSnGADKzP9hadbz6ZwBgprjgQ7vGELQpePEXIPXUyvOJODQttwB+Euye2+TX6Yz9hNEAqgvcopeYrlH73YDUf7MyZNga4gqZ2WcA61oqJULvDMIxZvNfvmjnfWFMT1O82mIkPEG0G9eBf8JqEJ/478cJ2qqA9OCbFxlHlwD/77KqxI3NQZIWqPzo9xGaYY0nyhv9L4x7dx3JOhLpMZxPa5xiRpDGsbGnMaRfXO7rFRVj+kRi65GoYx+E+M5VO7ywLZ3XVTMEVvyN8i7+r245u/vNjSzoBog+1adzDwzKKTqnCgY3RcKzSJU1sJpnaQzVDPMJrS4ikhz3GliSl6RZvImitUj1Ya9rUJdiyk0/IapWDx0J1GR1CgeYmOY/hcWhafdqCVvFqNB7vlZYsRSY3s9I4XZl7TykMqr8fwZnsWSaM2SCSdHm32OLEof67ptowyxMww0uFTPstGTgU2lDmaNGnaAMBo3KwJZ9BkLKVTLU/OfHNc95IrVIUx1Ny38mOTJYT9f2NbfNddtW/e6d8bRiW77SVc5Sj974WWhcDITngYiyqftBTDvVjjIyjjhB/m3OUgomLsxuj6yvCL2lLrBEsYKaqzziN6C8LM44YewbSiZjHLwWqFhPgFueb68W92bwhOsCZL1xgdt7mL6n6NtK47DsjzYDVzdpt4a6MS9FmFIyQ2nSj9MHrCz5wDUb+zKdcg6ug/aJK3zFqCzXApOHkwkrs1hKjMxcBBkvSvdjMgdEOuOO/AhpxQXor48hI0g1PSDloixYgtrgdwmi00shHWkSRrjXx6j6IbIWsUHNcd/StoKxfE5odmFo8l+poDbA4Uj0w4LvR6RfTVQPzZd7nUlIn1rkSZJMNua4FbCUXeyQ7l5yN4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7cb8823b-fbbf-4832-d9e4-08d994739a81 X-MS-Exchange-CrossTenant-AuthSource: MN2PR10MB4128.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 09:17:28.5410 (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: anand.jain@oracle.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB4287 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10143 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109230001 definitions=main-2110210046 X-Proofpoint-ORIG-GUID: VYU95l-o2Je0XuVVmYMtvySwLutfLgMI X-Proofpoint-GUID: VYU95l-o2Je0XuVVmYMtvySwLutfLgMI Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org If there is a missing seed device in a sprout, the btrfs filesystem usage command fails, which is fixed by the following patches: btrfs: sysfs add devinfo/fsid to retrieve fsid from the device btrfs-progs: read fsid from the sysfs in device_is_seed Test if it works now after these patches in the kernel and in the btrfs-progs respectively. Suggested-by: Josef Bacik Signed-off-by: Anand Jain Reviewed-by: Josef Bacik --- tests/btrfs/249 | 67 +++++++++++++++++++++++++++++++++++++++++++++ tests/btrfs/249.out | 2 ++ 2 files changed, 69 insertions(+) create mode 100755 tests/btrfs/249 create mode 100644 tests/btrfs/249.out diff --git a/tests/btrfs/249 b/tests/btrfs/249 new file mode 100755 index 000000000000..7cc4996e387b --- /dev/null +++ b/tests/btrfs/249 @@ -0,0 +1,67 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2021 Anand Jain. All Rights Reserved. +# Copyright (c) 2021 Oracle. All Rights Reserved. +# +# FS QA Test 249 +# +# Validate if the command 'btrfs filesystem usage' works with missing seed +# device +# Steps: +# Create a degraded raid1 seed device +# Create a sprout filesystem (an rw device on top of a seed device) +# Dump 'btrfs filesystem usage', check it didn't fail +# +# Tests btrfs-progs bug fixed by the kernel patch and a btrfs-prog patch +# btrfs: sysfs add devinfo/fsid to retrieve fsid from the device +# btrfs-progs: read fsid from the sysfs in device_is_seed + +. ./common/preamble +_begin_fstest auto quick seed volume + +# Import common functions. +# . ./common/filter + +# real QA test starts here + +# Modify as appropriate. +_supported_fs btrfs +_require_scratch_dev_pool 3 +_require_command "$WIPEFS_PROG" wipefs +_require_btrfs_forget_or_module_loadable + +_scratch_dev_pool_get 2 +# use the scratch devices as seed devices +seed_dev1=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{ print $1 }') +seed_dev2=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{ print $2 }') + +# use the spare device as a sprout device +_spare_dev_get +sprout_dev=$SPARE_DEV + +# create raid1 seed filesystem +_scratch_pool_mkfs "-draid1 -mraid1" >> $seqres.full 2>&1 +$BTRFS_TUNE_PROG -S 1 $seed_dev1 +$WIPEFS_PROG -a $seed_dev1 >> $seqres.full 2>&1 +_btrfs_forget_or_module_reload +_mount -o degraded $seed_dev2 $SCRATCH_MNT >> $seqres.full 2>&1 + +# create a sprout device +$BTRFS_UTIL_PROG device add -f $SPARE_DEV $SCRATCH_MNT >> $seqres.full 2>&1 + +# dump filesystem usage if it fails error goes to the bad.out file +$BTRFS_UTIL_PROG filesystem usage $SCRATCH_MNT >> $seqres.full +# also check for the error code +ret=$? +if [ $ret != 0 ]; then +_fail "FAILED: btrfs filesystem usage, ret $ret. Check btrfs.ko and btrfs-progs version." +fi + +_scratch_unmount +_spare_dev_put +_scratch_dev_pool_put + +echo "Silence is golden" +# success, all done +status=0 +exit diff --git a/tests/btrfs/249.out b/tests/btrfs/249.out new file mode 100644 index 000000000000..b79a5dca8820 --- /dev/null +++ b/tests/btrfs/249.out @@ -0,0 +1,2 @@ +QA output created by 249 +Silence is golden