Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp345365pxm; Tue, 22 Feb 2022 12:00:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIcJW5PLoFxzybFGS5kZk2K70sQ7Q3MEIgWXxmhj/6WleXzMwuRhzTtdYl9YTmtOm/5z+S X-Received: by 2002:a17:903:32c5:b0:14d:55b5:7fd with SMTP id i5-20020a17090332c500b0014d55b507fdmr25288164plr.26.1645560043202; Tue, 22 Feb 2022 12:00:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645560043; cv=none; d=google.com; s=arc-20160816; b=E12Jj1oJ3cRkszwN/KBVHv+eMx9DYr5NO04VeKGn/IyQTYXz7St1yWFtFYCNTYt8OS E328MrpjY8E52T+OClG9Aho/c0CLNllPbIC/7BeV5TGlAUE+JGY2mk3OCk9g0NJIVtl8 d3tFZgl2lIhafZ44b392malToZ0YPpWqDDPQHspMcaVgi6gt4iLOcrQrRN/HcvamQO5T w4u2S6327JVbL1aBosXNBe0SYIB7861asD6VwtgvPZvsaANHOt6BTJxrD/ZnMpu+Ip4d Wvm2I2M/ShRGAT0QMs/sg1H1D5oF/SC35CsNnv3VsbYIdd9gIOeuleOjExrhQ/cx4457 sbvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=j2lxBEKXj31SxcbAozEFxIXgEqDLIsmOwAI5PHFvBrQ=; b=OmKVrc+lwbJplaTP1aCZd02eXObgYsYUS5oASZsqsObxY/eK7grcYC9XY6zrurbxEA z6yBcF+a4XtTKMlYokxjf8ZsO6fdu0OgVZ8YMSiw/pEIS0pdtll2GWKkd8hhXG9baaD0 rjzGxAF5aHH4VPCY+eAU9Kncx1Fdn4jZgOdvhmxGWNJXTskvu5sDYAGga4JGm0UbSWor 92n9P+19FrCBzXq+tz4btC7/byC88JlARQHMTpaRCNCH1MdtpplqplFBbLiDPWRBfjds swThVVIwCZW0h8w1GyqsOXhG7V0/bLdoDO+lGN1VBLKj7Md9vEtOGtZJc+o/RBiSlG+t C0Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=fvKCKcqs; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10si21988317pgb.483.2022.02.22.12.00.22; Tue, 22 Feb 2022 12:00:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=fvKCKcqs; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234430AbiBVRvb (ORCPT + 99 others); Tue, 22 Feb 2022 12:51:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234336AbiBVRva (ORCPT ); Tue, 22 Feb 2022 12:51:30 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2A9116FDC7; Tue, 22 Feb 2022 09:51:04 -0800 (PST) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21MHJu0g027294; Tue, 22 Feb 2022 17:51:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=j2lxBEKXj31SxcbAozEFxIXgEqDLIsmOwAI5PHFvBrQ=; b=fvKCKcqs5IFtnrqKI28DD8O2HVNIZfrW2gsV8VOS1OQZ4ntWJsMNjvZuO2o2gMRMo1JO AYgcgVRGXr5o828YGBYtRyOQfjncAWUZmPFpqV8nLp3dAhrpDuhvpRUJq6onk1zv7lJh 1GUTj+9v0yZmYtIeqVorl6uc9CNvt8yWghAKrJH7fUsTUtFl3xVtSsaD5yygFE7P72rH 1vFyvw/054c9SLO0qsnG70vJG+kK2UAIn29x0RhFUf2qAMK3/dDF5YBky+IhbqjsJVFN CzGjxo+hI76d98LInpjwBwjxuuylgJ4ocwihVazB+/LVinoRWvpN1ai1lI4HitGWCMS0 jQ== Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3ed1ctp0fa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Feb 2022 17:51:03 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 21MHlOeF024753; Tue, 22 Feb 2022 17:51:02 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma06ams.nl.ibm.com with ESMTP id 3eaqtj4xky-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Feb 2022 17:51:01 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 21MHowjf9765136 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Feb 2022 17:50:58 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8ABB0A404D; Tue, 22 Feb 2022 17:50:58 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3FDA2A4051; Tue, 22 Feb 2022 17:50:57 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com (unknown [9.43.41.242]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 22 Feb 2022 17:50:56 +0000 (GMT) From: Ojaswin Mujoo To: fstests@vger.kernel.org, linux-ext4@vger.kernel.org Cc: riteshh@linux.ibm.com Subject: [PATCH v2 0/2] tests/ext4: Ensure resizes with sparse_super2 are handled correctly Date: Tue, 22 Feb 2022 23:20:51 +0530 Message-Id: X-Mailer: git-send-email 2.27.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: LVVQGbPP0LaQ4kADcsZwuNRpcgxm10Q_ X-Proofpoint-GUID: LVVQGbPP0LaQ4kADcsZwuNRpcgxm10Q_ Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-22_05,2022-02-21_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 mlxscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 spamscore=0 mlxlogscore=570 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202220107 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org As detailed in the patch [1], kernel currently does not support resizes with sparse_super2 enabled. Before the above patch, if we used the EXT4_IOC_RESIZE_FS ioctl directly, wiht sparse_super2 enabled, the kernel used to still try the resize and ultimatley leave the fs in an inconsistent state. This also led to corruption and kernel BUGs. This patchset adds a test for ext4 to ensure that the kernel handles resizes with sparse_super2 correctly, and returns -EOPNOTSUPP. Summary: Patch 1: Fix the src/ext4_resize.c script to return accurate error codes. Patch 2: Add the ext4 test for checking resize functionality Changes since v1 [2] * In patch 2, don't iterate if the expected errno is returned * Code cleanup and additional comments for clarity (also see extra note in patch 2) * No changes in patch 1 [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b1489186cc8391e0c1e342f9fbc3eedf6b944c61 [2] https://lore.kernel.org/fstests/cover.1644217569.git.ojaswin@linux.ibm.com/ Ojaswin Mujoo (2): src/ext4_resize.c: Refactor code and ensure accurate errno is returned ext4: Test to ensure resize with sparse_super2 is handled correctly src/ext4_resize.c | 46 +++++++++++++------ tests/ext4/056 | 108 +++++++++++++++++++++++++++++++++++++++++++++ tests/ext4/056.out | 2 + 3 files changed, 142 insertions(+), 14 deletions(-) create mode 100755 tests/ext4/056 create mode 100644 tests/ext4/056.out -- 2.27.0