Received: by 2002:ab2:2441:0:b0:1f3:1f8c:d0c6 with SMTP id k1csp194938lqe; Thu, 4 Apr 2024 04:11:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVythQjqU+tL+D3pqzjH7a2mNHi6JduD/E5zmFcRKnj/4hAsteWu2pEuJjOjhlsrrvhKkE3bKXVvDMgs/Pn7cdXA8fMXFe/ws/eJLU7Eg== X-Google-Smtp-Source: AGHT+IFKrpYg1DoPE2/ot/1FOJ/1imCXEoL6eAIHDOVXP9wk1cD71J7kZjP/2im2ycyOhiSxuycQ X-Received: by 2002:a17:90a:69c5:b0:2a2:5f73:a57e with SMTP id s63-20020a17090a69c500b002a25f73a57emr2328180pjj.11.1712229062352; Thu, 04 Apr 2024 04:11:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712229062; cv=pass; d=google.com; s=arc-20160816; b=bI9/MCA5FBS/2xTUmOYJIROGOad8kuYPXlx4ThoflbDMk//WAEOFytJzdsQl+ajmah ErHGsp5z/DdG5K8wJtZm+M0+Hwwe65dfAkdyxet021p8PQfvZymbJ8Je5FXdYjsBeY6j ytHKEb7TnzRZ1ohtjYbyOqm+gtDcyNtIM+i1TnmzwYonJUicIApyy5rVNGTt9Y4C8ker GiC89/ILkbCCiByLuctOClHqBX8lRlrukskZT/PXbZ2ywjXRrySKn1f/3b2MOxIeUYMf wzqfWqC6nFhpsF0AV1rjRaq5PRACf3hnj0gRnuZjW4J2D1O4XMowZKMGGibLBaC6zME5 9oeQ== 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=y5d7+q3ENYu0RMN/jqEnrfco9Nv53OUp8Vk3no/lHqFxp8KAHrl9QUYDiEzbe4CbZC Q+poDNF3dGpBbWFBcgndHpn+SmnHKNLKjHrtfGltD7kvKeVRjHF1T2S0N80BnNcoKvP2 0djIrPeFZ4/YrUKyGkmrUZa14TM7q2ABXC2aXl9jQbPuGMPmWCOtBW5VWdDMIx6vaODv ncEhQVh/lcmwF6sXVqAkqE2xkYxeCRUeVLzB40A7QV33Uhgk2Jv3VTKn6TMWKZ1Mfbgt V0qO6cN+xDP9Kp8VuOI54GpvVA9KoxlMlfy5jcVkmSj03iyaViOl8n1DdATgkligzubk YseA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=YA2b4pTz; 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-1857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1857-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 gp20-20020a17090adf1400b002a08f48bbadsi1464196pjb.21.2024.04.04.04.11.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 04:11:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1857-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=YA2b4pTz; 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-1857-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1857-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 E65AB28542D for ; Thu, 4 Apr 2024 11:11:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD94480C09; Thu, 4 Apr 2024 11:10:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YA2b4pTz" X-Original-To: linux-ext4@vger.kernel.org Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (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 C8E6C823B0 for ; Thu, 4 Apr 2024 11:10:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712229043; cv=none; b=BZFr4xnk7oCqAkaIdJLOkTsINjlefuyCTbX9T59UjMdfzXqdFw2IcQ+m/7sbIBoUsxNzfVHf/ViMbR1FQxlP7Mzk2bpqw+OeKTZxhqNHzvcLvzzMNTagO1/2Ks3aqOkdI7dGE4Bbn3xeIGMJigS8+O8p04RPPKXqIisItEh4y+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712229043; c=relaxed/simple; bh=pNAKtrIVYsR9WuMDS7UeRJdP/IFpGkoXl9Ggzowl4Rk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SJvQUUYV4qf1uM2wfIyvuuTx3qPM9pA36iSiAvrOHd1nV31ED8i/34fsmfGFfrH3Ngen81OLDRmXY9rRVXKz42LPp/cVXvwaoUZj7WEdoMKxD3MfNH9SYCCKxCDl+GYK9XrR934JyIvB1oA+40jj95p6SUlwfNGva0cCiWVjtqA= 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=YA2b4pTz; arc=none smtp.client-ip=95.215.58.170 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=1712229039; 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=YA2b4pTzBeeFscLex/cerKQP4HykLMU6FfbUkjk3moyXR1ZUV0GOjtPEwt2Uojs709Slis +dBGthk0bBCMTtVjgMoVfc3hx0JLuo9TVaR2UmgOrrSZ2YeNJFbBBqgntZl08yiZcowPRC bN1eWn2+H2WdFrZ422aTTz8iR5kKEJ4= From: "Luis Henriques (SUSE)" To: Theodore Ts'o , Andreas Dilger Cc: linux-ext4@vger.kernel.org, "Luis Henriques (SUSE)" Subject: [PATCH v2 4/4] tests: new test to check quota after a bad inode deallocation Date: Thu, 4 Apr 2024 12:10:32 +0100 Message-ID: <20240404111032.10427-5-luis.henriques@linux.dev> In-Reply-To: <20240404111032.10427-1-luis.henriques@linux.dev> References: <20240404111032.10427-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^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