Received: from list by lists.gnu.org with archive (Exim 4.71) id 1cheF4-0007FK-3H for mharc-grub-devel@gnu.org; Sat, 25 Feb 2017 10:26:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cheF1-0007FB-FT for grub-devel@gnu.org; Sat, 25 Feb 2017 10:26:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cheEy-0006k7-A8 for grub-devel@gnu.org; Sat, 25 Feb 2017 10:26:35 -0500 Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:33436) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cheEy-0006hT-1k for grub-devel@gnu.org; Sat, 25 Feb 2017 10:26:32 -0500 Received: by mail-lf0-x22f.google.com with SMTP id l12so19030319lfe.0 for ; Sat, 25 Feb 2017 07:26:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=xdh9/4v5wt3Gtuny28yqKpNMgiS/Md/k3F8kD9h6kdQ=; b=ER0pPNZFObq31jwKHbLvDUDuaKK/DphJ6y+j0KOI5L6erPB5Yf7/S7gtmstbC8Vphz RCFdsgKtQvcOfRF9JKg3A0JCuF9QrS/VZJC161Ai9h/IqTJBBM3qCy5EDMjoYe214EvT IHnBKqRVwkyDAbohAXHr+JQ2tgazzDHxfimuwR2TJK0lskDA+F1uwT761JG5Db93xXKL j77xn0GVw3veTOMHsLIu5bQW8xczgO0I77aCyCul3k+AVKHA89QaBmIy0p/f4Q/o4I+/ f4cN9PN3ZtsI1FvCtTyWMIDUq6ebZ38VZ9hmA9i6pSohHbY95mqkraBv22Q0aZiqcXtF A/oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=xdh9/4v5wt3Gtuny28yqKpNMgiS/Md/k3F8kD9h6kdQ=; b=Ke8E6fM6rz/O14nf9Nr9b/wmB4XLTMsR6kUhgfwCDYbv6dHYPRCuyyOcVqUdLCrReZ eYkCe5B0YrOLjM69xift+oZOjD0ooUcleY7Act9o6JUpie9yl+yFM0C6KqVTxrVQxklL MxhNJYKNQcLxZfsV628LOkp6Ab9eHIoorc0D86rYZQT//hkTsiyWqZgPcH9oVqOq8cg/ d0x8zsQ+NGlXbjO0NM1V72TWSlbEXNn7NXzTzcbsF0kEk81OI/4TLY+4AHK9Watb1ZXu azqXlrzJ2eeffmckKPmEx8RdBKEb4WOK+z+xSTZKtpLZzUIBxevCMLq1VoVr4WrG3Muw 3mfg== X-Gm-Message-State: AMke39nu1YM/8pp/9dCQ7kHYugLd1v4wAv1USPcVCUAZdCGlhXbDtdr6IK8KrnI9y3pERQ== X-Received: by 10.25.67.29 with SMTP id q29mr125872lfa.72.1488036390551; Sat, 25 Feb 2017 07:26:30 -0800 (PST) Received: from [192.168.1.6] (ppp109-252-90-129.pppoe.spdop.ru. [109.252.90.129]) by smtp.gmail.com with ESMTPSA id h3sm2747985lfj.0.2017.02.25.07.26.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Feb 2017 07:26:29 -0800 (PST) Subject: sqaush4 tests (was: Re: [PATCH] squash4: fix handling of fragments and sparse files) To: grub-devel@gnu.org References: <9b1cfa75-4908-a49f-6186-981ea98ed115@gmail.com> <1487405803-2360-1-git-send-email-arvidjaar@gmail.com> <433d08cb-5793-9949-1aec-274ea8267fbd@gmail.com> <043cefd9-3f7c-16ce-a3f5-ff7d819adaf9@gmail.com> From: Andrei Borzenkov Message-ID: Date: Sat, 25 Feb 2017 18:26:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <043cefd9-3f7c-16ce-a3f5-ff7d819adaf9@gmail.com> Content-Type: multipart/mixed; boundary="------------911DE2503A56EB518CC61204" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22f X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Feb 2017 15:26:36 -0000 This is a multi-part message in MIME format. --------------911DE2503A56EB518CC61204 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 25.02.2017 18:23, Andrei Borzenkov пишет: > 24.02.2017 19:19, Andrei Borzenkov пишет: >>> How do you create those files reliably? Feel free to add any files to >>> grub-fs-tester. Feel free to commit without tests, we can add tests later. >>> >> >> I would say, we need to generally create less "nice" test files >> >> 1. Generate test files that are not exact multiple of filesystem block. >> This would cover squash tail packing and may uncover similar issues in >> other drivers as well. >> >> 2. Generate sparse files by seeking beyond end of file. We already had >> similar problem with indirect ext* blocks that was not caught by tests. >> We should produce holes both for direct and indirect blocks (we may pick >> common offset or make it fs-specific if necessary). >> >> 3. We need to produce really small files also to test inlining. Again we >> can pick common size or make it fs-specific. >> >> Assuming we generate files as described, for squash4 just call it with >> -always-use-fragments to force tail packing. -nopad may be interesting >> as well to stress our driver even more. >> >> > > Attached patch implements 1 + -always-use-fragments. It reliably causes > squash4 test to fail without my patch. I can change BLOCKCNT for squash4 > only, but I think it makes sense to do globally. > > sparse files need some tweaking in garbage-gen, will look into it. > Sorry, wrong patch attached. --------------911DE2503A56EB518CC61204 Content-Type: text/x-patch; name="squash4-tests.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="squash4-tests.patch" From: Andrei Borzenkov Subject: [PATCH] grub-fs-tester: improve squash4 tests 1. Make sure files are not multiple of block size. This will ensure tail packing for squash4 and may also trigger more codes paths in other filesystems. 2. Call mksquashfs with -always-use-fragments to force tail packing. --- tests/util/grub-fs-tester.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in index f363d6f..2337771 100644 --- a/tests/util/grub-fs-tester.in +++ b/tests/util/grub-fs-tester.in @@ -913,6 +913,9 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + *) BLOCKCNT=5242880;; esac + # Make sure file is not exact multiple of block size. This helps to force + # tail packing in case of squash4. + : $((BLOCKCNT--)) case x"$fs" in x"ntfscomp") setfattr -h -v 0x00000800 -n system.ntfs_attrib_be "$MNTPOINTRW/$OSDIR";; @@ -998,8 +1001,8 @@ for ((LOGSECSIZE=MINLOGSECSIZE;LOGSECSIZE<=MAXLOGSECSIZE;LOGSECSIZE=LOGSECSIZE + x"romfs") genromfs -V "$FSLABEL" -f "${FSIMAGES[0]}" -d "$MASTER" ;; xsquash4_*) - echo mksquashfs "$MASTER" "${FSIMAGES[0]}" -comp "${fs/squash4_/}" -b $BLKSIZE - mksquashfs "$MASTER" "${FSIMAGES[0]}" -comp "${fs/squash4_/}" -b $BLKSIZE ;; + echo mksquashfs "$MASTER" "${FSIMAGES[0]}" -always-use-fragments -comp "${fs/squash4_/}" -b $BLKSIZE + mksquashfs "$MASTER" "${FSIMAGES[0]}" -always-use-fragments -comp "${fs/squash4_/}" -b $BLKSIZE ;; x"bfs") sleep 1 fusermount -u "$MNTPOINTRW" -- tg: (892dfbe..) u/squash4-tests (depends on: master) --------------911DE2503A56EB518CC61204--