Return-Path: Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.server123.net (Postfix) with ESMTPS for ; Sun, 5 Aug 2018 10:18:44 +0200 (CEST) Received: by mail-wm0-x229.google.com with SMTP id f21-v6so10611947wmc.5 for ; Sun, 05 Aug 2018 01:18:44 -0700 (PDT) References: <8cc41ecf-6a13-8dc5-2618-97300c46397b@gmail.com> <20180804204035.GA19119@localhost.localdomain> From: Milan Broz Message-ID: <575786ad-0507-3540-832b-3098c83add58@gmail.com> Date: Sun, 5 Aug 2018 10:18:41 +0200 MIME-Version: 1.0 In-Reply-To: <20180804204035.GA19119@localhost.localdomain> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dm-crypt] Test suite is now FS-dependent (Re: cryptsetup 2.0.4) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Guilhem Moulin Cc: dm-crypt On 04/08/18 22:40, Guilhem Moulin wrote: > Hi, > > FWIW, ‘tests/blockwise-compat’ doesn't work consistently on all file > systems. With > > BSIZE=$(stat -c "%o" $LOCAL_FILE) ## 4096 > > `./unit-utils-io $LOCAL_FILE read_buffer $((BSIZE-1))` fails with ext4 > (on read()) and tmpfs (on open(O_DIRECT)), but succeeds with btrfs (and > possibly other file systems). The test-suite doesn't pass if that test > succeeds. > > ## ext4 > $ strace -e trace=openat,read ./unit-utils-io $LOCAL_FILE read_buffer $((BSIZE-1)) > […] > openat(AT_FDCWD, "./blocwise_localfile", O_RDONLY|O_DIRECT) = 3 > read(3, 0x55914c895000, 4095) = -1 EINVAL (Invalid argument) > +++ exited with 1 +++ > > ## tmpfs > $ strace -e trace=openat,read ./unit-utils-io $LOCAL_FILE read_buffer $((BSIZE-1)) > […] > openat(AT_FDCWD, "./blocwise_localfile", O_RDONLY|O_DIRECT) = -1 EINVAL (Invalid argument) > Failed to open ./blocwise_localfile. > +++ exited with 1 +++ > > ## btrfs > $ strace -e trace=openat,read ./unit-utils-io $LOCAL_FILE read_buffer $((BSIZE-1)) > […] > openat(AT_FDCWD, "./blocwise_localfile", O_RDONLY|O_DIRECT) = 3 > read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4095) = 4095 > +++ exited with 0 +++ Ah, btrfs. Until now it was nfs nuances that breaks everything :-) (Direct-io should not be able to read buffer not aligned to block/page boundary, but btrfs has apparently disagrees.) Thanks for the report, we will fix it. Can you please send us (or create issue) report including kernel version? (Just any cryptsetup command with --debug on the same system is ok.) This is a new unit test, most of corner case scenarios are not used internally. I guess it is just another special case we did not know about. Milan