Received: from list by lists.gnu.org with archive (Exim 4.71) id 1chIbY-0004xa-AK for mharc-grub-devel@gnu.org; Fri, 24 Feb 2017 11:20:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chIbT-0004uI-AI for grub-devel@gnu.org; Fri, 24 Feb 2017 11:20:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chIbQ-000156-1w for grub-devel@gnu.org; Fri, 24 Feb 2017 11:20:19 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:36255) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1chIbE-0000w0-2R; Fri, 24 Feb 2017 11:20:04 -0500 Received: by mail-lf0-x244.google.com with SMTP id p197so1785171lfp.3; Fri, 24 Feb 2017 08:20:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=0i3hyhyAvXNl8TAP0iK/Ppr3m1wF2o1Yx54cCMD0gcU=; b=MVJpYatR0yuhvKZkAEoXqh0t420sXAvgAB0hHKDDdjQhoABLG/JgpHil0xsAj+kFks 3aU2rgFSxJop3SUflO5X2MlweFAKGzQRGcWxGXQLdDnObbar68FUSOWemZHw2vYijO/5 zOnc8TLWrqmMiyPw0dFun1pqf4Bp01EFY1A+JNyP2lFJrQHUcvc09jnOUJNlLz5PfoyB h+r038dFUC76kUiCVsTJhA7IxZekXpsYjGqMVflkVxRidzuN1KY8cbqe5UYteWQS4XBW LYcO5I6O/DmnOiLrU/SW8+3nB30qjnpLDzqK4E1QKmb0uBJDdZ65QtnMAAuDJmRNZKeG 4M+Q== 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0i3hyhyAvXNl8TAP0iK/Ppr3m1wF2o1Yx54cCMD0gcU=; b=EJtHPbk1vgWLJHL8ns/TH5K7WdnlFRfSeiFv/nljKNyQOno8x69VYvxBlq3pITTfbI ihe6G04XHmQtnqSRn1eH9As7IIZjDLfXHpAEWkx0iqCJxappS5LhkmQDfUNjKV0bQXso eKSF4oIdruATRL4Pxrk4Uh0tAx2ONeiYmrWAswbu/PkfBuCC+BvrRq3u8w2nwl+tYG8g BDDMQdJUNPZohqIhDmonFVaWS8jBfTBd5YHvnm01BFzHzns2c1XXPybqlQhgaoCTpu1/ lR+NYSUrkUbFW0BQt2+XvvEcNuxdrwPnYUfpWYCpLvCJOtMdHQR9cjqKK/R+LWR5fxRO GMBQ== X-Gm-Message-State: AMke39kdvZDn+Ek1NGOgraBdtELueQnVU8HlsPqms6deoBRueI5ibx999xVM2Yw66l2qHA== X-Received: by 10.25.215.5 with SMTP id o5mr1086333lfg.132.1487953201321; Fri, 24 Feb 2017 08:20:01 -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 i19sm1560769ljb.63.2017.02.24.08.19.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Feb 2017 08:20:00 -0800 (PST) Subject: Re: [PATCH] squash4: fix handling of fragments and sparse files To: Vladimir 'phcoder' Serbinenko , grub-devel@gnu.org References: <9b1cfa75-4908-a49f-6186-981ea98ed115@gmail.com> <1487405803-2360-1-git-send-email-arvidjaar@gmail.com> Cc: bug-grub@gnu.org, carlo@endlessm.com From: Andrei Borzenkov Message-ID: <433d08cb-5793-9949-1aec-274ea8267fbd@gmail.com> Date: Fri, 24 Feb 2017 19:19:59 +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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::244 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: Fri, 24 Feb 2017 16:20:22 -0000 23.02.2017 16:52, Vladimir 'phcoder' Serbinenko пишет: > On Sat, Feb 18, 2017, 10:17 Andrei Borzenkov wrote: > >> 1. Do not assume block list and fragment are mutually exclusive. Squash >> can pack file tail as fragment (unless -no-fragments is specified); so >> check read offset and read either from block list or from fragments as >> appropriate. >> >> 2. Support sparse files with zero blocks. >> >> 3. Fix fragment read - frag.offset is absolute fragment position, >> not offset relative to ino.chunk. >> > Go ahead. > Done with cosmetic changes (renamed one variable to better match surrounding code and removed now superfluous assignment). >> >> Reported and tested by Carlo Caione >> >> --- >> >> @Vladimir: we need regression tests for both of these cases. We could real >> small >> files only by accident - block list was zero, so it appeared to work. >> > 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.