Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp599288lqh; Thu, 28 Mar 2024 10:29:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUyvAZR15gek2InNNFHJxvDj/elSBywPB6CTqjursZziEf1SVTRsycC5QCE6blz4qKoMW0/8+2yiUxUMzd5VxNbWBrOiztTmorx0u4ZDQ== X-Google-Smtp-Source: AGHT+IGtBkg5PSKlLIRlnvRT6eDbnkaKs8a4UUY3p4hAfeLdmkZ84bbsddgHUWSOr4CQ5694NTtD X-Received: by 2002:a05:6a20:258e:b0:1a5:7a9b:fdaf with SMTP id k14-20020a056a20258e00b001a57a9bfdafmr1587518pzd.26.1711646997462; Thu, 28 Mar 2024 10:29:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711646997; cv=pass; d=google.com; s=arc-20160816; b=hQ62VQ7z0DrRcM11qzAsWBxe2eDKBaX98YQpU6gpEhlRaA2TTTg2HIExVDLm/8yhig 2yJJQ2QkMJ8WUyr3bTAFTLL47bpRmtpTOPbzAuYiykP7U5AMBi7FNXWtScIbwanFEEbA iIz6mr2F4x9xUDBXZpAdlZHZlNjjdRLN9K+y0qSn9B3QV54canpCQdGBFoIsWdPdqdkl J8sAYFFvM/82b+RFpaus2CtRRpxCpkeaQYrEReCBm93nQRoyJWqwEuXh0s20dIUHKN65 krwBW2cKJvdToGWFwjpqjh6ISGVZ6sWBViV+uams/7MfYOdsfN1pv79jSJB6auyRs/Wk iMfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vexROfUgZbp9joWEGcKEkiLDV8xtcwtsPBPisRYUDBA=; fh=mFjBxWtsA9NPNe3Gkwd5L+dWph7pq0ADh54Ay2V+KKY=; b=Qx8vNuMfVCcgebbtoyC9Y9VVMPrf9p85nl4Ipj+LaCVSucq3e/1WPD+yJeQaojwBoy k0HI1jNHzZilZgZ9H/3KEipBDKlMg3msmgJzABPzvbGKT8pmNqmJRuybvWEtTTuD4r3g +1+yA2ACxCgKzqA+fvECm6Fq23/OUwFkfQxWiRkXCKuC+M/YwsDqGuYhfFZtiFV6KsLA aj3S0Zrzft5gUvtsXrkG1EZuhY+E06EbnvMP03ew9U9+XmsxJSB1xPV9FbKjcxOnfMCr DzMHP7NELrapCvo6VuRN+JlepTeh1OeAbHoV4my96Wtxzjz/Zi9YI430md/cPHOCrTj6 Oo6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QlomeoeT; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-ext4+bounces-1768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w18-20020a63af12000000b005f06665a187si1792713pge.534.2024.03.28.10.29.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 10:29:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=QlomeoeT; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-ext4+bounces-1768-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1768-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0F9A329AC06 for ; Thu, 28 Mar 2024 17:29:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5E7881751; Thu, 28 Mar 2024 17:29:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="QlomeoeT" X-Original-To: linux-ext4@vger.kernel.org Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76CF37E115 for ; Thu, 28 Mar 2024 17:29:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711646988; cv=none; b=BV6pXOu4iiLbKNeAJvusaKeoWfP2djYxd1Zfj6HYrs9xd4d2Qa9gtQH5jq/0nHYxmP6QIh78rsR8KlCZjEltv7Lnuqyl5tAGP8V5YUTtqy5nhiJ8ucZIOWwLTPVI8CmFsAqzUGi+Ifh5ZuUJDX1vEV7sYN0+piO9JZoiEf9xHvE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711646988; c=relaxed/simple; bh=qUAamefM6ZUmnmlScGs1W0h/IiJRr10AeQs0Ofy+edg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EVU/lxrP6vozFA7Ugca6H6jLwV82k6PXoPSVGyvF8bzrZJqYbcawagwbifrn4F4dsuDPNWsG373Kv3igh09Bktled3ufiaJ1JwPCLHebg6uDEm0ZL/HB1YpTJ46KsKyAi9RuDxh+fDvwrJ+Ub/kROxx1xu/hWXiZBXtsr7EJw1w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=QlomeoeT; arc=none smtp.client-ip=95.215.58.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1711646984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vexROfUgZbp9joWEGcKEkiLDV8xtcwtsPBPisRYUDBA=; b=QlomeoeTry+9JLk+0RL64plx/pL+ORy66x70Td+sLVykqhvoVZ6dsL0jZWmqP1i0MCODHv zurwbzVFTi9ru55WVi/93lyzSXUTzhVOwqQjhyJcodch5hq/EITI9A6lRPEHD170luZh5r k044OWgyCGFqdcgdwaC6sY5H+KowSGU= From: "Luis Henriques (SUSE)" To: Theodore Ts'o , Andreas Dilger Cc: linux-ext4@vger.kernel.org, "Luis Henriques (SUSE)" Subject: [PATCH 3/4] tests: new test to check quota after directory optimization Date: Thu, 28 Mar 2024 17:29:39 +0000 Message-ID: <20240328172940.1609-4-luis.henriques@linux.dev> In-Reply-To: <20240328172940.1609-1-luis.henriques@linux.dev> References: <20240328172940.1609-1-luis.henriques@linux.dev> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT This new test validates e2fsck by verifying that quota data is updated after a directory optimization is performed. It mimics fstest ext4/014 by including a filesystem image where a file is created inside a new directory on the filesystem root and then root block 0 is wiped: # debugfs -w -R 'zap -f / 0' f_testnew/image Signed-off-by: Luis Henriques (SUSE) --- tests/f_quota_shrinkdir/expect.1 | 40 +++++++++++++++++++++++++++++++ tests/f_quota_shrinkdir/expect.2 | 7 ++++++ tests/f_quota_shrinkdir/image.gz | Bin 0 -> 11453 bytes tests/f_quota_shrinkdir/name | 1 + 4 files changed, 48 insertions(+) create mode 100644 tests/f_quota_shrinkdir/expect.1 create mode 100644 tests/f_quota_shrinkdir/expect.2 create mode 100644 tests/f_quota_shrinkdir/image.gz create mode 100644 tests/f_quota_shrinkdir/name diff --git a/tests/f_quota_shrinkdir/expect.1 b/tests/f_quota_shrinkdir/expect.1 new file mode 100644 index 000000000000..812fe44b887d --- /dev/null +++ b/tests/f_quota_shrinkdir/expect.1 @@ -0,0 +1,40 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Directory inode 2, block #0, offset 0: directory corrupted +Salvage? yes + +Missing '.' in directory inode 2. +Fix? yes + +Missing '..' in directory inode 2. +Fix? yes + +Pass 3: Checking directory connectivity +'..' in / (2) is (0), should be / (2). +Fix? yes + +Unconnected directory inode 11 (was in /) +Connect to /lost+found? yes + +/lost+found not found. Create? yes + +Unconnected directory inode 12 (was in /) +Connect to /lost+found? yes + +Pass 3A: Optimizing directories +Pass 4: Checking reference counts +Inode 11 ref count is 3, should be 2. Fix? yes + +Inode 12 ref count is 3, should be 2. Fix? yes + +Pass 5: Checking group summary information +[QUOTA WARNING] Usage inconsistent for ID 0:actual (4096, 5) != expected (14336, 4) +Update quota info for quota type 0? yes + +[QUOTA WARNING] Usage inconsistent for ID 0:actual (4096, 5) != expected (14336, 4) +Update quota info for quota type 1? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 14/256 files (14.3% non-contiguous), 1146/8192 blocks +Exit status is 1 diff --git a/tests/f_quota_shrinkdir/expect.2 b/tests/f_quota_shrinkdir/expect.2 new file mode 100644 index 000000000000..814f84a54fd6 --- /dev/null +++ b/tests/f_quota_shrinkdir/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 14/256 files (14.3% non-contiguous), 1146/8192 blocks +Exit status is 0 diff --git a/tests/f_quota_shrinkdir/image.gz b/tests/f_quota_shrinkdir/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..753774f6a11f8a60fdbdf2ce205e64a36d753893 GIT binary patch literal 11453 zcmeI#YgAL|xd335ai~RPTIz*^A*;1VkEMb$7%yPVayrU5$Q=SCgrEpWB1A45hF}tu z3Y~H*WdsERqH+nj!C*iFAtIxUM=oR8*&De9N+r(Tgb2(g5J+~%uCD$#tH+*yUCWdG z>s#OZ=l!1VUGMj9V*ZbQH1xa8ahq%s63@lQZkQXly%`x>n?3zvVAIw2zEfTQMdN?n z4!`*0mQQ{b@-w?%9o~BN+n?8F1biL!!S+)DJwM(tw|V{g^H5Q;?4)Coh9@)rBCFSH0ST{P0Jki8N799=~_bYkWjf65kHqQeZP|L z>^wA?r7kp1#xG0hw-ia~&%WO5Mr>PpQ7+_L(#6$jk3GE#&r%Z5l5Y9a8KXTslU>%z zTJhZ-Zma15J|%drF9Dwu0==O?;QPYE(4TUgIm-PeZ+5UJTAtWWY2z(?{=yge{WrCb4sD1cE8JsX zIbO9OQ^#LA=xMoGQeh!-E&CO{BMHN~1NgD=dfV)nwXYVV59;Dj%11ZH;krIz#^teB zzw^AeP1=jRZV?Qb+%FF5)6B(}7{%hd$ScqKB9)_rVz>I< z$CuJ8@WO2l`GR(~ykYM1w2@{-S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(c literal 0 HcmV?d00001 diff --git a/tests/f_quota_shrinkdir/name b/tests/f_quota_shrinkdir/name new file mode 100644 index 000000000000..8772ae5c814b --- /dev/null +++ b/tests/f_quota_shrinkdir/name @@ -0,0 +1 @@ +update quota on directory optimization