Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp609826lqh; Thu, 28 Mar 2024 10:49:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUpx+xb+YH4Gl7pDCPjGTkAxe2QqSYkDlS2uE5J+/xf3aI6t92MQciXR3OlHmWhRZIwADMJJV1B6lUnMI7TPHK94p8HQk1/RFL53napxA== X-Google-Smtp-Source: AGHT+IG5kl+VMIrRhXBB+Zz3z3Lh8RrAdMSyUonTmOXLhGANn2GSMame5PR83jYrTDchGj9KWTaW X-Received: by 2002:a05:6a20:1b20:b0:1a1:4809:50d3 with SMTP id ch32-20020a056a201b2000b001a1480950d3mr3130982pzb.54.1711648142691; Thu, 28 Mar 2024 10:49:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711648142; cv=pass; d=google.com; s=arc-20160816; b=GyGi8Ddcd/vojmcNHFPJBAzufrcuEdk2AckK3smD1QFYmkkguz8wiHNOexfqkPaUpg 29yIXfgDPzlw0PZyrESUu9Z0h+ar6sucnc2pbnp5WXpVccFfOdoN96WYkztKVJsQx7Sf zsy/YJgdCBRZeTG+aSzYcQ44pQBXUpRKsJa9Paf6Ed2JyJRjJ1ottotIzFGEQrHYg96V mYbjz8kPhFPqTR2VsoDHsIDkIs/JeWZlpoF087C46fepytay0PurR50W3oledesZI6fs 1ub9wwM4DVwpuNJWORLaeIZEBKZikx74vD+zN2mkotx1krZDI0cw7AbaOytmCuT/vtqH P8uQ== 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=4d5yxLDZOYtkaoRdt4QlJaQrk8CcY5+L3UcAiDJim3k=; fh=mFjBxWtsA9NPNe3Gkwd5L+dWph7pq0ADh54Ay2V+KKY=; b=F3deTZnXLJ4vcP5RwQI0XwL02dVHV4R/EkmtFGFDdD7Djt3ADRpZaLKXwJ3jBp9N26 5yUpk0guo1CiniZl+xvRIpwVbbHaF9VJdzc6tWPmketwzRmOwrQHa40TpfyJjHzNYmhF RgpQvxfMBf77qAXa4j1/jfSKawbx+s7LUiJJLC17sd82rXQsDtZ0Goq6SSrxj7L6+kg0 tWB+gSc4sxTQCz64R5vUE3JBUXA00KVVAYdjUX25bTDf88EsutOkTUSJvD78+NaPbHx7 /07GFbjfMthqWgoD2JwkLBwD374KqAaIqmk7ObAFXrc2g4NRp4IypYVkD8lpO0qBKjSj qeyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qm9ejvIf; 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-1769-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1769-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j17-20020a17090a7e9100b002a095d3ecd9si4014176pjl.38.2024.03.28.10.49.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 10:49:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1769-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qm9ejvIf; 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-1769-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1769-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EE887B220BE for ; Thu, 28 Mar 2024 17:30:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A05608626D; Thu, 28 Mar 2024 17:29:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="qm9ejvIf" X-Original-To: linux-ext4@vger.kernel.org Received: from out-178.mta1.migadu.com (out-178.mta1.migadu.com [95.215.58.178]) (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 F266E7EF00 for ; Thu, 28 Mar 2024 17:29:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711646989; cv=none; b=orjTL9Sq4ZDQPNaDy/GI+21Ux9VJSjY4er1uCXhboQDEd/RQUCiqhPJnO6UsNtvMkSnz4YoO3D4oW2ESOIfffAltVTHgxZBT140ZdOtQDpLuyOia87YwNcgzz8/ZwBcJSnxk5aNiINdxGjTaGYdDt8mgxkqZCGTOqIDG/8wqqVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711646989; c=relaxed/simple; bh=pNAKtrIVYsR9WuMDS7UeRJdP/IFpGkoXl9Ggzowl4Rk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RREsfKPMo+Fmot7MPd3r13Ea/UAFDRy0n0byo0AoGRLqB4feDVuyw8LDDkaBiqbu/0YvRaPti7goD3GuI18cfjFkv5RDgXIWnSv4Ie6QK5Smk1rpVnJjP+83hzz47sU7bDJS+iryd17z7a7zfJhb1M8k+X/KIDnE07tNJiZUXxU= 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=qm9ejvIf; arc=none smtp.client-ip=95.215.58.178 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=1711646985; 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=4d5yxLDZOYtkaoRdt4QlJaQrk8CcY5+L3UcAiDJim3k=; b=qm9ejvIfKJev2MZ0yIW3Bm3hC4pSvQOrY/PrhyXmmPes3OPW8QzeIyEcgz+ffCREwTYlFF uBrIVIRc95wbeTYVougMhdSr350E2y7IC7mon7tbzPjyOsorTExtuFzzZ89ZxsnujCU0cN F4VLQxM8T5XBh4SDt0PWCAA0b3KGebY= From: "Luis Henriques (SUSE)" To: Theodore Ts'o , Andreas Dilger Cc: linux-ext4@vger.kernel.org, "Luis Henriques (SUSE)" Subject: [PATCH 4/4] tests: new test to check quota after a bad inode deallocation Date: Thu, 28 Mar 2024 17:29:40 +0000 Message-ID: <20240328172940.1609-5-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 is updated after a bad inode is deallocated. It mimics fstest ext4/019 by including a filesystem image where a symbolic link was created to an existing file, using a long symlink name. This symbolic link was then wiped with: # debugfs -w -R 'zap -f /testlink 0' f_testnew/image Signed-off-by: Luis Henriques (SUSE) --- tests/f_quota_deallocate_inode/expect.1 | 18 ++++++++++++++++++ tests/f_quota_deallocate_inode/expect.2 | 7 +++++++ tests/f_quota_deallocate_inode/image.gz | Bin 0 -> 11594 bytes tests/f_quota_deallocate_inode/name | 1 + 4 files changed, 26 insertions(+) create mode 100644 tests/f_quota_deallocate_inode/expect.1 create mode 100644 tests/f_quota_deallocate_inode/expect.2 create mode 100644 tests/f_quota_deallocate_inode/image.gz create mode 100644 tests/f_quota_deallocate_inode/name diff --git a/tests/f_quota_deallocate_inode/expect.1 b/tests/f_quota_deallocate_inode/expect.1 new file mode 100644 index 000000000000..2b2f128dbb57 --- /dev/null +++ b/tests/f_quota_deallocate_inode/expect.1 @@ -0,0 +1,18 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Symlink /testlink (inode #14) is invalid. +Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +[QUOTA WARNING] Usage inconsistent for ID 0:actual (15360, 4) != expected (16384, 5) +Update quota info for quota type 0? yes + +[QUOTA WARNING] Usage inconsistent for ID 0:actual (15360, 4) != expected (16384, 5) +Update quota info for quota type 1? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/256 files (15.4% non-contiguous), 1157/8192 blocks +Exit status is 1 diff --git a/tests/f_quota_deallocate_inode/expect.2 b/tests/f_quota_deallocate_inode/expect.2 new file mode 100644 index 000000000000..802317949959 --- /dev/null +++ b/tests/f_quota_deallocate_inode/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: 13/256 files (15.4% non-contiguous), 1157/8192 blocks +Exit status is 0 diff --git a/tests/f_quota_deallocate_inode/image.gz b/tests/f_quota_deallocate_inode/image.gz new file mode 100644 index 0000000000000000000000000000000000000000..798a72c3a0da0323fc55c5e034f778e967394c81 GIT binary patch literal 11594 zcmeI%eNYqUx&UyiRgMQsPLKCM5rNy&@i@JTaO(gyn54Bwu%aS@KoXLGC`cj%3rjQ* zg2hU`eAU`Q6+=`M67t1|OCTYMNYyF=B1u;HiWUXBD+!3pM|63*0<;ne|Yru^5mtbmzrFo={>8rrML%Ee8uX`}&l>)HyIhiM`?l!8 zzr9U)`^DDT9B%VE?Pm3~_)+VS*Q)$^^N!t~t4cW<+s=aa??*fw9p6o9CU1POevfa^ zM=hi06`QJavj^&Upu34uyNu=H+g|lU0?oQys&q7E7rKEE_>OXx~;@y{7=~fQSTZsSrM3< zr^-4+iJ<<)qRj$Fbz#@SmO-Uge!)WXVnW7~l2PHofL2?0u_awq z-iv{}iKqp0UJ@>vHz-|g7pH}vO!Iem$GMm;5a%`p;P=Kt@;kO{Js zYvyd;lx-AW9N|?0X*pKI!X#GMH^9Lx59Wf8XY?&ls-Z2nf*P+Y3}vzia_Up}E+HcX z-_2Ezh}RQVRP1V*pQk(zT3jrnPD>`z?_hZS6Gu;u-|O99KbjF1Ks)R5K{bMnyc{3b zh^SZkcwQT~5|bcmlZ_;RNZIFzZRr7V2kNhn%Sp{5&4{(2{eTF6dGd4D?y4ZpOtClb z(W3_^Ln^kX*JG@}M5~=}Z~d)}OY5;^X5n=^Ar5~Fp(Hq5n`)lxV_kkO8e+p=D zmn`S(^NV&Rj0!>%0^+g)W;auc2&cr$)~qU*UuFN&KH0Rbp#3B8h+k|c^hfZ3B6qAp zmtcj;M^BTLF4ji#dzNuR@WTaV*0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